Mesa (master): llvmpipe: switch to NIR by default

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Sat Dec 21 03:26:35 UTC 2019


Module: Mesa
Branch: master
Commit: e6b2af56cb037e3174d049478e0ad7c7715780e4
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=e6b2af56cb037e3174d049478e0ad7c7715780e4

Author: Dave Airlie <airlied at redhat.com>
Date:   Tue Dec  3 15:23:45 2019 +1000

llvmpipe: switch to NIR by default

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 at 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                           |  4 ++++
 .gitlab-ci/piglit/quick_gl.txt           |  5 ++---
 src/gallium/drivers/llvmpipe/lp_debug.h  |  2 +-
 src/gallium/drivers/llvmpipe/lp_screen.c | 28 +++++++++++++++++++++-------
 src/gallium/drivers/llvmpipe/lp_screen.h |  2 ++
 5 files changed, 30 insertions(+), 11 deletions(-)

diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 6d6d48ceefb..d4508f82a2d 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -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
diff --git a/.gitlab-ci/piglit/quick_gl.txt b/.gitlab-ci/piglit/quick_gl.txt
index 1836b1b2b03..fb73a0685a2 100644
--- a/.gitlab-ci/piglit/quick_gl.txt
+++ b/.gitlab-ci/piglit/quick_gl.txt
@@ -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
diff --git a/src/gallium/drivers/llvmpipe/lp_debug.h b/src/gallium/drivers/llvmpipe/lp_debug.h
index 96af8936c5f..972831a4f0e 100644
--- a/src/gallium/drivers/llvmpipe/lp_debug.h
+++ b/src/gallium/drivers/llvmpipe/lp_debug.h
@@ -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.
  */
diff --git a/src/gallium/drivers/llvmpipe/lp_screen.c b/src/gallium/drivers/llvmpipe/lp_screen.c
index 94810de8372..b238cce808f 100644
--- a/src/gallium/drivers/llvmpipe/lp_screen.c
+++ b/src/gallium/drivers/llvmpipe/lp_screen.c
@@ -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;
diff --git a/src/gallium/drivers/llvmpipe/lp_screen.h b/src/gallium/drivers/llvmpipe/lp_screen.h
index 6ac52b8b9f8..7c57f3ec1fc 100644
--- a/src/gallium/drivers/llvmpipe/lp_screen.h
+++ b/src/gallium/drivers/llvmpipe/lp_screen.h
@@ -60,6 +60,8 @@ struct llvmpipe_screen
 
    struct lp_cs_tpool *cs_tpool;
    mtx_t cs_mutex;
+
+   bool use_tgsi;
 };
 
 




More information about the mesa-commit mailing list