From: Boris Brezillon Date: Wed, 19 Jun 2019 13:05:34 +0000 (+0200) Subject: nir/lower_tex: Add an assert() in nir_lower_txs_lod() X-Git-Tag: upstream/19.3.0~5258 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=56434450f634d54dd0e4bf3d243dbf931932ff93;p=platform%2Fupstream%2Fmesa.git 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 Signed-off-by: Boris Brezillon Reviewed-by: Alyssa Rosenzweig --- diff --git a/src/compiler/nir/nir_lower_tex.c b/src/compiler/nir/nir_lower_tex.c index 8a36edf..05b46b9 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);