[Mesa-dev] [PATCH 04/22] nvc0/debug: add env var to make nir default

Karol Herbst kherbst at redhat.com
Thu Dec 21 15:51:22 UTC 2017


can't be turned on for release builds for now.

Signed-off-by: Karol Herbst <kherbst at redhat.com>
---
 src/gallium/drivers/nouveau/nvc0/nvc0_screen.c | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/src/gallium/drivers/nouveau/nvc0/nvc0_screen.c b/src/gallium/drivers/nouveau/nvc0/nvc0_screen.c
index 90fc01ecd0..83884cb099 100644
--- a/src/gallium/drivers/nouveau/nvc0/nvc0_screen.c
+++ b/src/gallium/drivers/nouveau/nvc0/nvc0_screen.c
@@ -353,9 +353,15 @@ nvc0_screen_get_shader_param(struct pipe_screen *pscreen,
       return 0;
    }
 
+#ifdef DEBUG
+   long prefer_ir = debug_get_num_option("NV50_PROG_USE_NIR", 0) ? PIPE_SHADER_IR_NIR : PIPE_SHADER_IR_TGSI;
+#else
+   long prefer_ir = PIPE_SHADER_IR_TGSI;
+#endif
+
    switch (param) {
    case PIPE_SHADER_CAP_PREFERRED_IR:
-      return PIPE_SHADER_IR_TGSI;
+      return prefer_ir;
    case PIPE_SHADER_CAP_SUPPORTED_IRS:
       return 1 << PIPE_SHADER_IR_TGSI |
              1 << PIPE_SHADER_IR_NIR;
-- 
2.14.3



More information about the mesa-dev mailing list