.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;
(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;
if (INTEL_DEBUG & DEBUG_SHADER_TIME)
emit_shader_time_begin();
- if (brw_env_var_as_boolean("INTEL_USE_NIR", false)) {
+ if (brw->ctx.Const.ShaderCompilerOptions[MESA_SHADER_VERTEX].NirOptions) {
emit_nir_code();
} else {
foreach_in_list(ir_instruction, ir, shader->base.ir) {
/* Generate FS IR for main(). (the visitor only descends into
* functions called "main").
*/
- if (brw_env_var_as_boolean("INTEL_USE_NIR", false)) {
+ if (brw->ctx.Const.ShaderCompilerOptions[MESA_SHADER_FRAGMENT].NirOptions) {
emit_nir_code();
} else if (shader) {
foreach_in_list(ir_instruction, ir, shader->base.ir) {
if (unlikely(INTEL_DEBUG & DEBUG_VS))
brw_dump_ir("vertex", prog, &shader->base, &c->vp->program.Base);
- if (brw->scalar_vs && (prog || brw_env_var_as_boolean("INTEL_USE_NIR", false))) {
+ if (brw->scalar_vs &&
+ (prog ||
+ brw->ctx.Const.ShaderCompilerOptions[MESA_SHADER_VERTEX].NirOptions)) {
fs_visitor v(brw, mem_ctx, &c->key, prog_data, prog, &c->vp->program, 8);
if (!v.run_vs()) {
if (prog) {