mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-06 07:18:17 +02:00
zink: support loading any UBO
Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7079>
This commit is contained in:
parent
67e4bcb713
commit
1b6a80a467
1 changed files with 2 additions and 3 deletions
|
|
@ -1560,7 +1560,6 @@ emit_load_ubo_vec4(struct ntv_context *ctx, nir_intrinsic_instr *intr)
|
|||
{
|
||||
ASSERTED nir_const_value *const_block_index = nir_src_as_const_value(intr->src[0]);
|
||||
assert(const_block_index); // no dynamic indexing for now
|
||||
assert(const_block_index->u32 == 0); // we only support the default UBO for now
|
||||
|
||||
SpvId offset = get_src(ctx, &intr->src[1]);
|
||||
SpvId uvec4_type = get_uvec_type(ctx, 32, 4);
|
||||
|
|
@ -1571,8 +1570,8 @@ emit_load_ubo_vec4(struct ntv_context *ctx, nir_intrinsic_instr *intr)
|
|||
SpvId member = emit_uint_const(ctx, 32, 0);
|
||||
SpvId offsets[] = { member, offset };
|
||||
SpvId ptr = spirv_builder_emit_access_chain(&ctx->builder, pointer_type,
|
||||
ctx->ubos[0], offsets,
|
||||
ARRAY_SIZE(offsets));
|
||||
ctx->ubos[const_block_index->u32],
|
||||
offsets, ARRAY_SIZE(offsets));
|
||||
SpvId result = spirv_builder_emit_load(&ctx->builder, uvec4_type, ptr);
|
||||
|
||||
SpvId type = get_dest_uvec_type(ctx, &intr->dest);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue