nir/builder: Add a bit size field to nir_ssa_undef

This commit is contained in:
Jason Ekstrand 2016-03-25 10:40:24 -07:00
parent b50f7f0011
commit d2eee52a65
2 changed files with 4 additions and 3 deletions

View 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;

View 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;