[Mesa-dev] [PATCH v2 06/31] nvc0/debug: add env var to make nir default

Karol Herbst kherbst at redhat.com
Thu Jan 4 15:01:52 UTC 2018


v2: allow for non debug builds as well

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

diff --git a/src/gallium/drivers/nouveau/nvc0/nvc0_screen.c b/src/gallium/drivers/nouveau/nvc0/nvc0_screen.c
index 1df9a3bb98..298ec99a19 100644
--- a/src/gallium/drivers/nouveau/nvc0/nvc0_screen.c
+++ b/src/gallium/drivers/nouveau/nvc0/nvc0_screen.c
@@ -354,9 +354,16 @@ nvc0_screen_get_shader_param(struct pipe_screen *pscreen,
       return 0;
    }
 
+   long pref_ir;
+   char *use_nir = getenv("NV50_PROG_USE_NIR");
+   if (use_nir && strtol(use_nir, NULL, 0) == 1)
+      pref_ir = PIPE_SHADER_IR_NIR;
+   else
+      pref_ir = PIPE_SHADER_IR_TGSI;
+
    switch (param) {
    case PIPE_SHADER_CAP_PREFERRED_IR:
-      return PIPE_SHADER_IR_TGSI;
+      return pref_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