summaryrefslogtreecommitdiffstats
path: root/src/glsl/nir/nir_lower_io.c
diff options
context:
space:
mode:
authorJason Ekstrand <[email protected]>2014-12-15 17:32:56 -0800
committerJason Ekstrand <[email protected]>2015-01-15 07:20:22 -0800
commit2c7da78805175f36879111306ac37c12d33bf65b (patch)
tree5fbfa3578dae242c5fa29cf46c647af351fda881 /src/glsl/nir/nir_lower_io.c
parent675ffdef3010400567a5f6f790f1f7bd2fede717 (diff)
nir: Make load_const SSA-only
As it was, we weren't ever using load_const in a non-SSA way. This allows us to substantially simplify the load_const instruction. If we ever need a non-SSA constant load, we can do a load_const and an imov. Reviewed-by: Connor Abbott <[email protected]>
Diffstat (limited to 'src/glsl/nir/nir_lower_io.c')
-rw-r--r--src/glsl/nir/nir_lower_io.c8
1 files changed, 2 insertions, 6 deletions
diff --git a/src/glsl/nir/nir_lower_io.c b/src/glsl/nir/nir_lower_io.c
index 91ad561fda5..af87c13e17a 100644
--- a/src/glsl/nir/nir_lower_io.c
+++ b/src/glsl/nir/nir_lower_io.c
@@ -140,18 +140,14 @@ get_io_offset(nir_deref_var *deref, nir_instr *instr, nir_src *indirect,
if (deref_array->deref_array_type == nir_deref_array_type_indirect) {
nir_load_const_instr *load_const =
- nir_load_const_instr_create(state->mem_ctx);
- load_const->num_components = 1;
+ nir_load_const_instr_create(state->mem_ctx, 1);
load_const->value.u[0] = size;
- load_const->dest.is_ssa = true;
- nir_ssa_def_init(&load_const->instr, &load_const->dest.ssa,
- 1, NULL);
nir_instr_insert_before(instr, &load_const->instr);
nir_alu_instr *mul = nir_alu_instr_create(state->mem_ctx,
nir_op_imul);
mul->src[0].src.is_ssa = true;
- mul->src[0].src.ssa = &load_const->dest.ssa;
+ mul->src[0].src.ssa = &load_const->def;
mul->src[1].src = nir_src_copy(deref_array->indirect,
state->mem_ctx);
mul->dest.write_mask = 1;