Module: Mesa
Branch: main
Commit: b7eda568a4acf8b3d551e22b6ef72689663f9550
URL:    
http://cgit.freedesktop.org/mesa/mesa/commit/?id=b7eda568a4acf8b3d551e22b6ef72689663f9550

Author: Mike Blumenkrantz <[email protected]>
Date:   Tue Aug  9 17:58:01 2022 -0400

nir/validate: clamp unsized tex dests to 32bit

this is the "default" size that's expected

cc: mesa-stable

Reviewed-by: Jason Ekstrand <[email protected]>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17874>

---

 src/compiler/nir/nir_validate.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/compiler/nir/nir_validate.c b/src/compiler/nir/nir_validate.c
index 3216e6ca066..eca05e0eab3 100644
--- a/src/compiler/nir/nir_validate.c
+++ b/src/compiler/nir/nir_validate.c
@@ -938,8 +938,9 @@ validate_tex_instr(nir_tex_instr *instr, validate_state 
*state)
 
    validate_dest(&instr->dest, state, 0, nir_tex_instr_dest_size(instr));
 
+   unsigned bit_size = nir_alu_type_get_type_size(instr->dest_type);
    validate_assert(state,
-                   nir_alu_type_get_type_size(instr->dest_type) ==
+                   (bit_size ? bit_size : 32) ==
                    nir_dest_bit_size(instr->dest));
 }
 

Reply via email to