diff --git a/src/compiler/nir/nir_shader_compiler_options.h b/src/compiler/nir/nir_shader_compiler_options.h index aca07312a77..ab23f7cb3bb 100644 --- a/src/compiler/nir/nir_shader_compiler_options.h +++ b/src/compiler/nir/nir_shader_compiler_options.h @@ -860,6 +860,12 @@ typedef struct nir_shader_compiler_options { */ void (*lower_mediump_io)(struct nir_shader *nir); + /** + * If driver wishes to control which @convert_alu_types to lower, it + * can implement this callback. + */ + bool (*lower_convert_alu_types)(nir_intrinsic_instr *convert_alu_types); + /** * Return the maximum cost of an expression that's written to a shader * output that can be moved into the next shader to remove that output. diff --git a/src/gallium/frontends/rusticl/core/kernel.rs b/src/gallium/frontends/rusticl/core/kernel.rs index 58d208348b2..a0f3963baf9 100644 --- a/src/gallium/frontends/rusticl/core/kernel.rs +++ b/src/gallium/frontends/rusticl/core/kernel.rs @@ -1047,7 +1047,11 @@ fn compile_nir_variant( } res.input_size = nir.uniform_size(); - nir_pass!(nir, nir_lower_convert_alu_types, None); + nir_pass!( + nir, + nir_lower_convert_alu_types, + nir_options.lower_convert_alu_types + ); nir_pass!(nir, nir_opt_intrinsics); opt_nir(nir, dev, true);