From dfaa4375c3875f3d1de79574e45db6e62cfa0cf7 Mon Sep 17 00:00:00 2001 From: Rob Clark Date: Fri, 27 Feb 2026 09:17:13 -0800 Subject: [PATCH] rusticl: Let backend control convert_alu_types lowering Signed-off-by: Rob Clark Part-of: --- src/compiler/nir/nir_shader_compiler_options.h | 6 ++++++ src/gallium/frontends/rusticl/core/kernel.rs | 6 +++++- 2 files changed, 11 insertions(+), 1 deletion(-) 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);