<div dir="ltr"><div>Thanks!</div><div><br></div><div>Reviewed-by: Jason Ekstrand <<a href="mailto:jason@jlekstrand.net">jason@jlekstrand.net</a>><br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Wed, Jun 19, 2019 at 8:09 AM Boris Brezillon <<a href="mailto:boris.brezillon@collabora.com">boris.brezillon@collabora.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">We don't expect the output of a TXS instruction to be wider than a<br>
vec3. Add an assert() to make sure this never happens.<br>
<br>
Suggested-by: Jason Ekstrand <<a href="mailto:jason@jlekstrand.net" target="_blank">jason@jlekstrand.net</a>><br>
Signed-off-by: Boris Brezillon <<a href="mailto:boris.brezillon@collabora.com" target="_blank">boris.brezillon@collabora.com</a>><br>
---<br>
src/compiler/nir/nir_lower_tex.c | 1 +<br>
1 file changed, 1 insertion(+)<br>
<br>
diff --git a/src/compiler/nir/nir_lower_tex.c b/src/compiler/nir/nir_lower_tex.c<br>
index 8a36edfbc5e4..05b46b902521 100644<br>
--- a/src/compiler/nir/nir_lower_tex.c<br>
+++ b/src/compiler/nir/nir_lower_tex.c<br>
@@ -1011,6 +1011,7 @@ nir_lower_txs_lod(nir_builder *b, nir_tex_instr *tex)<br>
if (tex->is_array) {<br>
nir_ssa_def *comp[3];<br>
<br>
+ assert(dest_size <= ARRAY_SIZE(comp));<br>
for (unsigned i = 0; i < dest_size - 1; i++)<br>
comp[i] = nir_channel(b, minified, i);<br>
<br>
-- <br>
2.20.1<br>
<br>
</blockquote></div>