[Mesa-dev] [PATCH 2.1/2] SQUASH nir: Get rid of more designated initializers
Jason Ekstrand
jason at jlekstrand.net
Wed Jan 21 17:25:06 PST 2015
---
src/glsl/nir/nir_search.c | 24 ++++++++++--------------
1 file changed, 10 insertions(+), 14 deletions(-)
diff --git a/src/glsl/nir/nir_search.c b/src/glsl/nir/nir_search.c
index a7bd051..e69fdfd 100644
--- a/src/glsl/nir/nir_search.c
+++ b/src/glsl/nir/nir_search.c
@@ -221,13 +221,11 @@ construct_value(const nir_search_value *value, nir_alu_type type,
nir_instr_insert_before(instr, &alu->instr);
- nir_alu_src val = {
- .src.is_ssa = true,
- .src.ssa = &alu->dest.dest.ssa,
- .negate = false,
- .abs = false,
- .swizzle = { 0, 1, 2, 3 }
- };
+ nir_alu_src val;
+ val.src = nir_src_for_ssa(&alu->dest.dest.ssa);
+ val.negate = false;
+ val.abs = false,
+ memcpy(val.swizzle, identity_swizzle, sizeof val.swizzle);
return val;
}
@@ -265,13 +263,11 @@ construct_value(const nir_search_value *value, nir_alu_type type,
nir_instr_insert_before(instr, &load->instr);
- nir_alu_src val = {
- .src.is_ssa = true,
- .src.ssa = &load->def,
- .negate = false,
- .abs = false,
- .swizzle = { 0, 0, 0, 0 } /* Splatted scalar */
- };
+ nir_alu_src val;
+ val.src = nir_src_for_ssa(&load->def);
+ val.negate = false;
+ val.abs = false,
+ memset(val.swizzle, 0, sizeof val.swizzle);
return val;
}
--
2.2.1
More information about the mesa-dev
mailing list