From 636aba5811565e6a5c070e241f124c6e93f5dc26 Mon Sep 17 00:00:00 2001 From: Lorenzo Rossi Date: Tue, 17 Mar 2026 08:52:37 +0100 Subject: [PATCH] panfrost: Lower indirect derefs before lower_io This will surely lose performance in some cases, this is a temporary fix to align ourselves with how the Vulkan compiler works. We might be able to us indirect varyings directly in the future depending on how we handle their memory layout. Signed-off-by: Lorenzo Rossi Reviewed-by: Faith Ekstrand Part-of: --- src/gallium/drivers/panfrost/pan_shader.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/gallium/drivers/panfrost/pan_shader.c b/src/gallium/drivers/panfrost/pan_shader.c index f3afa3608e0..d19347141bf 100644 --- a/src/gallium/drivers/panfrost/pan_shader.c +++ b/src/gallium/drivers/panfrost/pan_shader.c @@ -536,6 +536,8 @@ panfrost_create_shader_state(struct pipe_context *pctx, pan_preprocess_nir(nir, panfrost_device_gpu_id(dev)); pan_nir_lower_texture_early(nir, panfrost_device_gpu_id(dev)); + NIR_PASS(_, nir, nir_lower_indirect_derefs_to_if_else_trees, + nir_var_shader_in | nir_var_shader_out, UINT32_MAX); NIR_PASS(_, nir, nir_lower_io, nir_var_shader_in | nir_var_shader_out, glsl_type_size, nir_lower_io_use_interpolated_input_intrinsics);