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 <erik.faye-lund@collabora.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6981>
This commit is contained in:
parent
76ac341675
commit
d369c00c83
|
@ -588,7 +588,7 @@ emit_sampler(struct ntv_context *ctx, struct nir_variable *var)
|
||||||
static void
|
static void
|
||||||
emit_ubo(struct ntv_context *ctx, struct nir_variable *var)
|
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 vec4_type = get_uvec_type(ctx, 32, 4);
|
||||||
SpvId array_length = emit_uint_const(ctx, 32, size);
|
SpvId array_length = emit_uint_const(ctx, 32, size);
|
||||||
SpvId array_type = spirv_builder_type_array(&ctx->builder, vec4_type,
|
SpvId array_type = spirv_builder_type_array(&ctx->builder, vec4_type,
|
||||||
|
|
Loading…
Reference in New Issue