From: Jason Ekstrand Date: Fri, 25 Mar 2016 17:40:24 +0000 (-0700) Subject: nir/builder: Add a bit size field to nir_ssa_undef X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=d2eee52a6554217b21b93ab9d8ab39abee331dd8;p=mesa.git nir/builder: Add a bit size field to nir_ssa_undef --- diff --git a/src/compiler/nir/nir_builder.h b/src/compiler/nir/nir_builder.h index 94f183c1552..22646f7afb4 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 42a1f953848..cbc87d1f740 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;