summaryrefslogtreecommitdiffstats
path: root/src/mesa/drivers/dri/i965/brw_context.c
diff options
context:
space:
mode:
authorJason Ekstrand <[email protected]>2015-04-02 17:02:43 -0700
committerJason Ekstrand <[email protected]>2015-04-03 14:12:49 -0700
commitbff421332661bfd0f82ab9eee9e4fec9d06ed1a1 (patch)
tree59eee1a8af4906daeb0fcae2cb365765b54717f8 /src/mesa/drivers/dri/i965/brw_context.c
parentdccc57eaba5e5920a6c151e7abb386a636ebf861 (diff)
i965: Check the INTEL_USE_NIR environment variable once at context creation
Reviewed-by: Jordan Justen <[email protected]>
Diffstat (limited to 'src/mesa/drivers/dri/i965/brw_context.c')
-rw-r--r--src/mesa/drivers/dri/i965/brw_context.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/mesa/drivers/dri/i965/brw_context.c b/src/mesa/drivers/dri/i965/brw_context.c
index 84818f04e90..f0de711cedc 100644
--- a/src/mesa/drivers/dri/i965/brw_context.c
+++ b/src/mesa/drivers/dri/i965/brw_context.c
@@ -560,6 +560,12 @@ brw_initialize_context_constants(struct brw_context *brw)
.lower_ffma = true,
};
+ bool use_nir_default[MESA_SHADER_STAGES];
+ use_nir_default[MESA_SHADER_VERTEX] = false;
+ use_nir_default[MESA_SHADER_GEOMETRY] = false;
+ use_nir_default[MESA_SHADER_FRAGMENT] = false;
+ use_nir_default[MESA_SHADER_COMPUTE] = false;
+
/* We want the GLSL compiler to emit code that uses condition codes */
for (int i = 0; i < MESA_SHADER_STAGES; i++) {
ctx->Const.ShaderCompilerOptions[i].MaxIfDepth = brw->gen < 6 ? 16 : UINT_MAX;
@@ -573,7 +579,9 @@ brw_initialize_context_constants(struct brw_context *brw)
(i == MESA_SHADER_FRAGMENT);
ctx->Const.ShaderCompilerOptions[i].EmitNoIndirectUniform = false;
ctx->Const.ShaderCompilerOptions[i].LowerClipDistance = true;
- ctx->Const.ShaderCompilerOptions[i].NirOptions = &nir_options;
+
+ if (brw_env_var_as_boolean("INTEL_USE_NIR", use_nir_default[i]))
+ ctx->Const.ShaderCompilerOptions[i].NirOptions = &nir_options;
}
ctx->Const.ShaderCompilerOptions[MESA_SHADER_VERTEX].OptimizeForAOS = true;