diff --git a/src/compiler/shader_info.h b/src/compiler/shader_info.h index a63b9e66373..522a79736f5 100644 --- a/src/compiler/shader_info.h +++ b/src/compiler/shader_info.h @@ -513,6 +513,11 @@ typedef struct shader_info { */ enum gl_derivative_group derivative_group:2; + /* + * If the shader might run with shared mem on top of `shared_size`. + */ + bool has_variable_shared_mem:1; + /** * pointer size is: * AddressingModelLogical: 0 (default) diff --git a/src/compiler/spirv/spirv_to_nir.c b/src/compiler/spirv/spirv_to_nir.c index bc067d7b0eb..a2c0bd623bb 100644 --- a/src/compiler/spirv/spirv_to_nir.c +++ b/src/compiler/spirv/spirv_to_nir.c @@ -6499,6 +6499,9 @@ vtn_emit_kernel_entry_point_wrapper(struct vtn_builder *b, for (unsigned i = 0; i < entry_point->num_params; ++i) { struct vtn_type *param_type = b->entry_point->func->type->params[i]; + b->shader->info.cs.has_variable_shared_mem |= + param_type->storage_class == SpvStorageClassWorkgroup; + /* consider all pointers to function memory to be parameters passed * by value */