diff options
author | Boris Brezillon <[email protected]> | 2019-06-19 15:05:34 +0200 |
---|---|---|
committer | Alyssa Rosenzweig <[email protected]> | 2019-06-20 09:15:53 -0700 |
commit | 56434450f634d54dd0e4bf3d243dbf931932ff93 (patch) | |
tree | dcbc902026b9e8100baf59fa22a7b818ed05e598 /src/compiler | |
parent | babc3ad291b289e2bfe00e2d9e8496560d0993b3 (diff) |
nir/lower_tex: Add an assert() in nir_lower_txs_lod()
We don't expect the output of a TXS instruction to be wider than a
vec3. Add an assert() to make sure this never happens.
Suggested-by: Jason Ekstrand <[email protected]>
Signed-off-by: Boris Brezillon <[email protected]>
Reviewed-by: Alyssa Rosenzweig <[email protected]>
Diffstat (limited to 'src/compiler')
-rw-r--r-- | src/compiler/nir/nir_lower_tex.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/src/compiler/nir/nir_lower_tex.c b/src/compiler/nir/nir_lower_tex.c index 8a36edfbc5e..05b46b90252 100644 --- a/src/compiler/nir/nir_lower_tex.c +++ b/src/compiler/nir/nir_lower_tex.c @@ -1011,6 +1011,7 @@ nir_lower_txs_lod(nir_builder *b, nir_tex_instr *tex) if (tex->is_array) { nir_ssa_def *comp[3]; + assert(dest_size <= ARRAY_SIZE(comp)); for (unsigned i = 0; i < dest_size - 1; i++) comp[i] = nir_channel(b, minified, i); |