[Mesa-dev] [PATCH 03/29] nir/vars_to_ssa: adapt to different bit sizes
Samuel Iglesias Gonsálvez
siglesias at igalia.com
Mon Mar 21 12:05:42 UTC 2016
From: Connor Abbott <connor.w.abbott at intel.com>
v2 (Sam):
- Keep using nir_op_imov when calling nir_alu_instr_create() at
rename_variables_block(). nir_op_fmov is not needed anymore.
Signed-off-by: Samuel Iglesias Gonsálvez <siglesias at igalia.com>
---
src/compiler/nir/nir_lower_vars_to_ssa.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/src/compiler/nir/nir_lower_vars_to_ssa.c b/src/compiler/nir/nir_lower_vars_to_ssa.c
index 2331791..511662e 100644
--- a/src/compiler/nir/nir_lower_vars_to_ssa.c
+++ b/src/compiler/nir/nir_lower_vars_to_ssa.c
@@ -543,6 +543,8 @@ get_ssa_def_for_block(struct deref_node *node, nir_block *block,
nir_ssa_undef_instr *undef =
nir_ssa_undef_instr_create(state->shader,
glsl_get_vector_elements(node->type));
+ undef->def.bit_size =
+ glsl_get_bit_size(glsl_get_base_type(node->type));
nir_instr_insert_before_cf_list(&state->impl->body, &undef->instr);
def_stack_push(node, &undef->def, state);
return &undef->def;
@@ -627,6 +629,7 @@ rename_variables_block(nir_block *block, struct lower_variables_state *state)
nir_ssa_undef_instr *undef =
nir_ssa_undef_instr_create(state->shader,
intrin->num_components);
+ undef->def.bit_size = intrin->dest.ssa.bit_size;
nir_instr_insert_before(&intrin->instr, &undef->instr);
nir_instr_remove(&intrin->instr);
--
2.5.0
More information about the mesa-dev
mailing list