From 5ca94eabecaf552d8d1b28852b2acceb3380ca4e Mon Sep 17 00:00:00 2001 From: Mike Blumenkrantz Date: Fri, 23 Jan 2026 10:25:32 -0500 Subject: [PATCH] ntv: stop explicitly tracking variables for samplers/images it's technically legal for duplicates to exist so long as they are never accessed, so this was always wrong Part-of: --- .../drivers/zink/nir_to_spirv/nir_to_spirv.c | 16 +--------------- 1 file changed, 1 insertion(+), 15 deletions(-) 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 ef51ebc33b0..ae2d6403a52 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 @@ -62,10 +62,7 @@ struct ntv_context { SpvId ssbos[5]; //8, 16, 32, unused, 64 nir_variable *ssbo_vars; - SpvId images[PIPE_MAX_SHADER_IMAGES]; struct hash_table image_types; - SpvId samplers[PIPE_MAX_SHADER_SAMPLER_VIEWS]; - SpvId bindless_samplers[2]; nir_variable *sampler_var[PIPE_MAX_SHADER_SAMPLER_VIEWS]; /* driver_location -> variable */ nir_variable *bindless_sampler_var[2]; unsigned last_sampler; @@ -1279,7 +1276,6 @@ emit_image(struct ntv_context *ctx, struct nir_variable *var, SpvId image_type) bool mediump = (var->data.precision == GLSL_PRECISION_MEDIUM || var->data.precision == GLSL_PRECISION_LOW); - int index = var->data.driver_location; assert(!find_image_type(ctx, var)); if (glsl_type_is_array(var->type)) { @@ -1305,17 +1301,7 @@ emit_image(struct ntv_context *ctx, struct nir_variable *var, SpvId image_type) spirv_builder_emit_input_attachment_index(&ctx->builder, var_id, var->data.index); _mesa_hash_table_insert(ctx->vars, var, (void *)(intptr_t)var_id); - if (is_sampler) { - if (var->data.descriptor_set == ctx->bindless_set_idx) { - assert(!ctx->bindless_samplers[index]); - ctx->bindless_samplers[index] = var_id; - } else { - assert(!ctx->samplers[index]); - ctx->samplers[index] = var_id; - } - } else { - assert(!ctx->images[index]); - ctx->images[index] = var_id; + if (!is_sampler) { emit_access_decorations(ctx, var, var_id); } _mesa_hash_table_insert(&ctx->image_types, var, (void *)(intptr_t)image_type);