From 98d486ea77c019e04c51e17a600e6a90ec3407da Mon Sep 17 00:00:00 2001 From: Samuel Pitoiset Date: Tue, 31 Mar 2026 17:52:15 +0200 Subject: [PATCH] spirv: handle untyped pointer storage class with descriptor heap It's possible with descriptor heap. Original patch by Faith Ekstrand . Signed-off-by: Samuel Pitoiset Part-of: --- src/compiler/spirv/vtn_variables.c | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) diff --git a/src/compiler/spirv/vtn_variables.c b/src/compiler/spirv/vtn_variables.c index 8b4cd797c4b..09749f8e1a8 100644 --- a/src/compiler/spirv/vtn_variables.c +++ b/src/compiler/spirv/vtn_variables.c @@ -1791,19 +1791,16 @@ vtn_storage_class_to_mode(struct vtn_builder *b, } else if (b->shader->info.stage == MESA_SHADER_KERNEL) { mode = vtn_variable_mode_constant; nir_mode = nir_var_mem_constant; + } else if (interface_type && + interface_type->base_type == vtn_base_type_accel_struct) { + mode = vtn_variable_mode_accel_struct; + nir_mode = nir_var_uniform; } else { - /* interface_type is only NULL when OpTypeForwardPointer is used and - * OpTypeForwardPointer cannot be used with the UniformConstant - * storage class. + /* OpTypeUntypedPointerKHR with UniformConstant is allowed with + * descriptor heap. */ - assert(interface_type != NULL); - if (interface_type->base_type == vtn_base_type_accel_struct) { - mode = vtn_variable_mode_accel_struct; - nir_mode = nir_var_uniform; - } else { - mode = vtn_variable_mode_uniform; - nir_mode = nir_var_uniform; - } + mode = vtn_variable_mode_uniform; + nir_mode = nir_var_uniform; } break; case SpvStorageClassPushConstant: