mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-06 02:58:05 +02:00
vtn: assert that vector shuffle indices are in-bounds
Reviewed-by: Jason Ekstrand <jason.ekstrand@collabora.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16667>
This commit is contained in:
parent
01ba3460a9
commit
54e1072ff6
1 changed files with 5 additions and 0 deletions
|
|
@ -3898,6 +3898,11 @@ vtn_vector_shuffle(struct vtn_builder *b, unsigned num_components,
|
|||
|
||||
for (unsigned i = 0; i < num_components; i++) {
|
||||
uint32_t index = indices[i];
|
||||
unsigned total_components = src0->num_components + src1->num_components;
|
||||
vtn_fail_if(index != 0xffffffff && index >= total_components,
|
||||
"OpVectorShuffle: All Component literals must either be "
|
||||
"FFFFFFFF or in [0, N - 1] (inclusive)");
|
||||
|
||||
if (index == 0xffffffff) {
|
||||
vec->src[i].src =
|
||||
nir_src_for_ssa(nir_ssa_undef(&b->nb, 1, src0->bit_size));
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue