From d369c00c83cba702fbb9d7ecab56880bed3ff8e6 Mon Sep 17 00:00:00 2001 From: Mike Blumenkrantz Date: Fri, 26 Jun 2020 15:44:03 -0400 Subject: [PATCH] zink: emit ubo variables sized based on the overall ubo block size if we're creating a block containing multiple variables, we want to create the whole block at once, not just each individual variable, as we have no way to reference individual variables in vulkan due to the requirement for VkDescriptorSetLayoutBinding members to have different binding values Reviewed-by: Erik Faye-Lund Part-of: --- src/gallium/drivers/zink/nir_to_spirv/nir_to_spirv.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 d974a34f958..d713e31566b 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 @@ -588,7 +588,7 @@ emit_sampler(struct ntv_context *ctx, struct nir_variable *var) static void emit_ubo(struct ntv_context *ctx, struct nir_variable *var) { - uint32_t size = glsl_count_attribute_slots(var->type, false); + uint32_t size = glsl_count_attribute_slots(var->interface_type, false); SpvId vec4_type = get_uvec_type(ctx, 32, 4); SpvId array_length = emit_uint_const(ctx, 32, size); SpvId array_type = spirv_builder_type_array(&ctx->builder, vec4_type,