llvmpipe: switch to NIR by default
authorDave Airlie <airlied@redhat.com>
Tue, 3 Dec 2019 05:23:45 +0000 (15:23 +1000)
committerDave Airlie <airlied@redhat.com>
Sat, 21 Dec 2019 03:07:17 +0000 (13:07 +1000)
Add LP_DEBUG=tgsi_ir (tgsi already taken) to fallback to TGSI paths.

Disable NIR_VALIDATE in CI (Michel/Eric acked)

Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Tested-by: Marge Bot <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/2303>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/2303>

.gitlab-ci.yml
.gitlab-ci/piglit/quick_gl.txt
src/gallium/drivers/llvmpipe/lp_debug.h
src/gallium/drivers/llvmpipe/lp_screen.c
src/gallium/drivers/llvmpipe/lp_screen.h

index 6d6d48ceefb5b3163e672ae3a0adf15152d2de7d..d4508f82a2d0bad90cd31b7cb749899c7746b36a 100644 (file)
@@ -527,6 +527,7 @@ piglit-quick_gl:
   extends: .piglit-test
   variables:
     LP_NUM_THREADS: 0
+    NIR_VALIDATE: 0
     PIGLIT_OPTIONS: >
       --process-isolation false
       -x arb_gpu_shader5
@@ -542,12 +543,14 @@ piglit-glslparser:
   extends: .piglit-test
   variables:
     LP_NUM_THREADS: 0
+    NIR_VALIDATE: 0
     PIGLIT_PROFILES: glslparser
 
 piglit-quick_shader:
   extends: .piglit-test
   variables:
     LP_NUM_THREADS: 1
+    NIR_VALIDATE: 0
     PIGLIT_PROFILES: quick_shader
 
 .deqp-test:
@@ -572,6 +575,7 @@ test-llvmpipe-gles2:
   variables:
     DEQP_VER: gles2
     DEQP_PARALLEL: 4
+    NIR_VALIDATE: 0
     # Don't use threads inside llvmpipe, we've already got all 4 cores
     # busy with DEQP_PARALLEL.
     LP_NUM_THREADS: 0
index 1836b1b2b03bdda3bfea3c5728dccd8ba291edaf..fb73a0685a2a18e67e622b012d79fa60b55e8a71 100644 (file)
@@ -398,7 +398,6 @@ spec/!opengl 4.5/compare-framebuffer-parameter-with-get: skip
 spec/!opengl 4.5/named-framebuffer-draw-buffers-errors: skip
 spec/!opengl 4.5/named-framebuffer-read-buffer-errors: skip
 spec/!opengl es 2.0/invalid-es3-queries_gles2: skip
-spec/!opengl es 3.0/gles-3.0-transform-feedback-uniform-buffer-object: fail
 spec/!opengl es 3.0/minmax: fail
 spec/3dfx_texture_compression_fxt1/compressedteximage gl_compressed_rgb_fxt1_3dfx: skip
 spec/3dfx_texture_compression_fxt1/compressedteximage gl_compressed_rgba_fxt1_3dfx: skip
@@ -2222,8 +2221,8 @@ wgl/wgl-sanity: skip
 summary:
        name:  results
        ----  --------
-       pass:    19301
-       fail:      237
+       pass:    19302
+       fail:      236
       crash:        2
        skip:     1962
     timeout:        0
index 96af8936c5f423dc1aa7144d72b6049392c92412..972831a4f0e0d62fda9aeb0303946f8f7d24f33d 100644 (file)
@@ -45,7 +45,7 @@
 #define DEBUG_MEM           0x4000
 #define DEBUG_FS            0x8000
 #define DEBUG_CS            0x10000
-#define DEBUG_NIR           0x20000
+#define DEBUG_TGSI_IR       0x20000
 
 /* Performance flags.  These are active even on release builds.
  */
index 94810de8372eb83dc301a33a9a20f5e3b8a3010c..b238cce808f621d1ef38da1d866b5066b34b90e2 100644 (file)
@@ -73,7 +73,7 @@ static const struct debug_named_value lp_debug_flags[] = {
    { "mem", DEBUG_MEM, NULL },
    { "fs", DEBUG_FS, NULL },
    { "cs", DEBUG_CS, NULL },
-   { "nir", DEBUG_NIR, NULL },
+   { "tgsi_ir", DEBUG_TGSI_IR, NULL },
    DEBUG_NAMED_VALUE_END
 };
 #endif
@@ -395,8 +395,10 @@ llvmpipe_get_param(struct pipe_screen *screen, enum pipe_cap param)
    case PIPE_CAP_TGSI_FS_FACE_IS_INTEGER_SYSVAL:
       return 1;
    case PIPE_CAP_LOAD_CONSTBUF:
-   case PIPE_CAP_PACKED_UNIFORMS:
-      return !!(LP_DEBUG & DEBUG_NIR);
+   case PIPE_CAP_PACKED_UNIFORMS: {
+      struct llvmpipe_screen *lscreen = llvmpipe_screen(screen);
+      return !lscreen->use_tgsi;
+   }
    default:
       return u_pipe_screen_get_param_defaults(screen, param);
    }
@@ -411,16 +413,27 @@ llvmpipe_get_shader_param(struct pipe_screen *screen,
    {
    case PIPE_SHADER_FRAGMENT:
    case PIPE_SHADER_COMPUTE:
+      if (param == PIPE_SHADER_CAP_PREFERRED_IR) {
+         struct llvmpipe_screen *lscreen = llvmpipe_screen(screen);
+         if (lscreen->use_tgsi)
+            return PIPE_SHADER_IR_TGSI;
+         else
+            return PIPE_SHADER_IR_NIR;
+      }
+
       switch (param) {
       default:
-         if ((LP_DEBUG & DEBUG_NIR) && param == PIPE_SHADER_CAP_PREFERRED_IR)
-            return PIPE_SHADER_IR_NIR;
          return gallivm_get_shader_param(param);
       }
    case PIPE_SHADER_VERTEX:
    case PIPE_SHADER_GEOMETRY:
-      if ((LP_DEBUG & DEBUG_NIR) && param == PIPE_SHADER_CAP_PREFERRED_IR)
-         return PIPE_SHADER_IR_NIR;
+      if (param == PIPE_SHADER_CAP_PREFERRED_IR) {
+         struct llvmpipe_screen *lscreen = llvmpipe_screen(screen);
+         if (lscreen->use_tgsi)
+            return PIPE_SHADER_IR_TGSI;
+         else
+            return PIPE_SHADER_IR_NIR;
+      }
 
       switch (param) {
       case PIPE_SHADER_CAP_MAX_TEXTURE_SAMPLERS:
@@ -822,6 +835,7 @@ llvmpipe_create_screen(struct sw_winsys *winsys)
    screen->base.finalize_nir = llvmpipe_finalize_nir;
    llvmpipe_init_screen_resource_funcs(&screen->base);
 
+   screen->use_tgsi = (LP_DEBUG & DEBUG_TGSI_IR);
    screen->num_threads = util_cpu_caps.nr_cpus > 1 ? util_cpu_caps.nr_cpus : 0;
 #ifdef EMBEDDED_DEVICE
    screen->num_threads = 0;
index 6ac52b8b9f8133efaf7e020ee337eb523570a95a..7c57f3ec1fc86495fc74fa75fdb52c08a98ababe 100644 (file)
@@ -60,6 +60,8 @@ struct llvmpipe_screen
 
    struct lp_cs_tpool *cs_tpool;
    mtx_t cs_mutex;
+
+   bool use_tgsi;
 };