Module: Mesa
Branch: master
Commit: 8300bc1f1694dadb4af4a134ed1100de152e5eaf
URL:    
http://cgit.freedesktop.org/mesa/mesa/commit/?id=8300bc1f1694dadb4af4a134ed1100de152e5eaf

Author: Mike Blumenkrantz <michael.blumenkra...@gmail.com>
Date:   Mon Feb 15 15:22:46 2021 -0500

zink: handle 1bit undef values in ntv

spirv requires that 1bit values be bool types, not uints

Fixes: 93af00502eb ("zink: use uvec for undefs")

Reviewed-by: Jason Ekstrand <ja...@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9059>

---

 src/gallium/drivers/zink/nir_to_spirv/nir_to_spirv.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/src/gallium/drivers/zink/nir_to_spirv/nir_to_spirv.c 
b/src/gallium/drivers/zink/nir_to_spirv/nir_to_spirv.c
index e055b868796..9cd33915084 100644
--- a/src/gallium/drivers/zink/nir_to_spirv/nir_to_spirv.c
+++ b/src/gallium/drivers/zink/nir_to_spirv/nir_to_spirv.c
@@ -2860,8 +2860,9 @@ emit_intrinsic(struct ntv_context *ctx, 
nir_intrinsic_instr *intr)
 static void
 emit_undef(struct ntv_context *ctx, nir_ssa_undef_instr *undef)
 {
-   SpvId type = get_uvec_type(ctx, undef->def.bit_size,
-                              undef->def.num_components);
+   SpvId type = undef->def.bit_size == 1 ? get_bvec_type(ctx, 
undef->def.num_components) :
+                                           get_uvec_type(ctx, 
undef->def.bit_size,
+                                                         
undef->def.num_components);
 
    store_ssa_def(ctx, &undef->def,
                  spirv_builder_emit_undef(&ctx->builder, type));

_______________________________________________
mesa-commit mailing list
mesa-commit@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-commit

Reply via email to