nir/builder: Add a bit size field to nir_ssa_undef
authorJason Ekstrand <jason.ekstrand@intel.com>
Fri, 25 Mar 2016 17:40:24 +0000 (10:40 -0700)
committerJason Ekstrand <jason.ekstrand@intel.com>
Fri, 25 Mar 2016 21:04:05 +0000 (14:04 -0700)
src/compiler/nir/nir_builder.h
src/compiler/nir/spirv/spirv_to_nir.c

index 94f183c155261bd67e53c383e2f8d13caa83fafd..22646f7afb4c9053d2ddae43fd9b65d365f55471 100644 (file)
@@ -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;
 
index 42a1f9538483d5643284d4bc6ac04516afa68169..cbc87d1f740c076d528d4eca064b35b9539d5eb8 100644 (file)
@@ -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;