summaryrefslogtreecommitdiffstats
path: root/src/glsl/nir/nir_search.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_search.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_search.c')
-rw-r--r--src/glsl/nir/nir_search.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/src/glsl/nir/nir_search.c b/src/glsl/nir/nir_search.c
index 3930795a041..f2797b2f5b6 100644
--- a/src/glsl/nir/nir_search.c
+++ b/src/glsl/nir/nir_search.c
@@ -275,17 +275,15 @@ construct_value(const nir_search_value *value, nir_alu_type type,
case nir_search_value_constant: {
const nir_search_constant *c = nir_search_value_as_constant(value);
- nir_load_const_instr *load = nir_load_const_instr_create(mem_ctx);
- load->dest.is_ssa = true;
- nir_ssa_def_init(&load->instr, &load->dest.ssa, 1, NULL);
+ nir_load_const_instr *load = nir_load_const_instr_create(mem_ctx, 1);
switch (type) {
case nir_type_float:
- load->dest.ssa.name = ralloc_asprintf(mem_ctx, "%f", c->data.f);
+ load->def.name = ralloc_asprintf(mem_ctx, "%f", c->data.f);
load->value.f[0] = c->data.f;
break;
case nir_type_int:
- load->dest.ssa.name = ralloc_asprintf(mem_ctx, "%d", c->data.i);
+ load->def.name = ralloc_asprintf(mem_ctx, "%d", c->data.i);
load->value.i[0] = c->data.i;
break;
case nir_type_unsigned:
@@ -300,7 +298,7 @@ construct_value(const nir_search_value *value, nir_alu_type type,
nir_alu_src val = {
.src.is_ssa = true,
- .src.ssa = &load->dest.ssa,
+ .src.ssa = &load->def,
.negate = false,
.abs = false,
.swizzle = { 0, 0, 0, 0 } /* Splatted scalar */