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

Author: Jason Ekstrand <jason.ekstr...@intel.com>
Date:   Fri Mar 25 10:40:24 2016 -0700

nir/builder: Add a bit size field to nir_ssa_undef

---

 src/compiler/nir/nir_builder.h        | 3 ++-
 src/compiler/nir/spirv/spirv_to_nir.c | 4 ++--
 2 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/src/compiler/nir/nir_builder.h b/src/compiler/nir/nir_builder.h
index 94f183c..22646f7 100644
--- a/src/compiler/nir/nir_builder.h
+++ b/src/compiler/nir/nir_builder.h
@@ -75,10 +75,11 @@ nir_builder_cf_insert(nir_builder *build, nir_cf_node *cf)
 }
 
 static inline nir_ssa_def *
-nir_ssa_undef(nir_builder *build, unsigned num_components)
+nir_ssa_undef(nir_builder *build, unsigned num_components, unsigned bit_size)
 {
    nir_ssa_undef_instr *undef =
       nir_ssa_undef_instr_create(build->shader, num_components);
+   undef->def.bit_size = bit_size;
    if (!undef)
       return NULL;
 
diff --git a/src/compiler/nir/spirv/spirv_to_nir.c 
b/src/compiler/nir/spirv/spirv_to_nir.c
index 42a1f95..cbc87d1 100644
--- a/src/compiler/nir/spirv/spirv_to_nir.c
+++ b/src/compiler/nir/spirv/spirv_to_nir.c
@@ -1496,7 +1496,7 @@ vtn_handle_image(struct vtn_builder *b, SpvOp opcode,
          assert(w[5] == SpvImageOperandsSampleMask);
          image.sample = vtn_ssa_value(b, w[6])->def;
       } else {
-         image.sample = nir_ssa_undef(&b->nb, 1);
+         image.sample = nir_ssa_undef(&b->nb, 1, 32);
       }
       break;
 
@@ -1511,7 +1511,7 @@ vtn_handle_image(struct vtn_builder *b, SpvOp opcode,
          assert(w[4] == SpvImageOperandsSampleMask);
          image.sample = vtn_ssa_value(b, w[5])->def;
       } else {
-         image.sample = nir_ssa_undef(&b->nb, 1);
+         image.sample = nir_ssa_undef(&b->nb, 1, 32);
       }
       break;
 

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

Reply via email to