glsl: fix block index in NIR uniform linker
We only want to set the index for the first block of an array. Also add a comment about why we do not break here. Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4623>
This commit is contained in:
parent
5dbebf4982
commit
5d992b539e
|
@ -1269,9 +1269,15 @@ gl_nir_link_uniforms(struct gl_context *ctx,
|
|||
|
||||
if (is_interface_array) {
|
||||
unsigned l = strlen(ifc_name);
|
||||
|
||||
/* Even when a match is found, do not "break" here. As this is
|
||||
* an array of instances, all elements of the array need to be
|
||||
* marked as referenced.
|
||||
*/
|
||||
for (unsigned i = 0; i < num_blocks; i++) {
|
||||
if (strncmp(ifc_name, blocks[i].Name, l) == 0 &&
|
||||
blocks[i].Name[l] == '[') {
|
||||
if (buffer_block_index == -1)
|
||||
buffer_block_index = i;
|
||||
|
||||
blocks[i].stageref |= 1U << shader_type;
|
||||
|
|
Loading…
Reference in New Issue