pan/bi: Fix UBO push with nir_opt_shrink_vectors

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12026>
This commit is contained in:
Alyssa Rosenzweig 2021-07-27 16:45:17 -04:00 committed by Marge Bot
parent 16579ca4b7
commit 73f8ef2961
1 changed files with 6 additions and 2 deletions

View File

@ -79,8 +79,12 @@ bi_analyze_ranges(bi_context *ctx)
assert(ubo < res.nr_blocks);
assert(channels > 0 && channels <= 4);
if (word < MAX_UBO_WORDS)
res.blocks[ubo].range[word] = channels;
if (word >= MAX_UBO_WORDS) continue;
/* Must use max if the same base is read with different channel
* counts, which is possible with nir_opt_shrink_vectors */
uint8_t *range = res.blocks[ubo].range;
range[word] = MAX2(range[word], channels);
}
return res;