diff --git a/src/gallium/drivers/zink/nir_to_spirv/nir_to_spirv.c b/src/gallium/drivers/zink/nir_to_spirv/nir_to_spirv.c index c1fb1ea7f74..6a7cd61423b 100644 --- a/src/gallium/drivers/zink/nir_to_spirv/nir_to_spirv.c +++ b/src/gallium/drivers/zink/nir_to_spirv/nir_to_spirv.c @@ -773,8 +773,10 @@ emit_image(struct ntv_context *ctx, struct nir_variable *var) bool is_sampler = glsl_type_is_sampler(type); if (!is_sampler && !var->data.image.format) { - spirv_builder_emit_cap(&ctx->builder, SpvCapabilityStorageImageWriteWithoutFormat); - spirv_builder_emit_cap(&ctx->builder, SpvCapabilityStorageImageReadWithoutFormat); + if (!(var->data.access & ACCESS_NON_WRITEABLE)) + spirv_builder_emit_cap(&ctx->builder, SpvCapabilityStorageImageWriteWithoutFormat); + if (!(var->data.access & ACCESS_NON_READABLE)) + spirv_builder_emit_cap(&ctx->builder, SpvCapabilityStorageImageReadWithoutFormat); } SpvDim dimension = type_to_dim(glsl_get_sampler_dim(type), &is_ms);