summaryrefslogtreecommitdiffstats
path: root/src/glsl/nir/nir_opt_cse.c
diff options
context:
space:
mode:
authorJason Ekstrand <[email protected]>2015-01-21 11:11:03 -0800
committerJason Ekstrand <[email protected]>2015-01-21 19:55:02 -0800
commitf88c6a49970ee35d29840e03fd6512a7acd815fb (patch)
tree33be37b922ff06f88d963e901fbce145baa94445 /src/glsl/nir/nir_opt_cse.c
parent76086d7120152ebced634875889612d0c40a37bb (diff)
nir: Stop using designated initializers
Designated initializers with anonymous unions don't work in MSVC or GCC < 4.6. With a couple of constructor methods, we don't need them any more and the code is actually cleaner. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=88467 Reviewed-by: Connor Abbot <[email protected]>
Diffstat (limited to 'src/glsl/nir/nir_opt_cse.c')
-rw-r--r--src/glsl/nir/nir_opt_cse.c16
1 files changed, 6 insertions, 10 deletions
diff --git a/src/glsl/nir/nir_opt_cse.c b/src/glsl/nir/nir_opt_cse.c
index 89d78c8d34e..a33ebdd9981 100644
--- a/src/glsl/nir/nir_opt_cse.c
+++ b/src/glsl/nir/nir_opt_cse.c
@@ -187,12 +187,10 @@ nir_opt_cse_instr(nir_instr *instr, struct cse_state *state)
!exec_node_is_head_sentinel(node); node = node->prev) {
nir_instr *other = exec_node_data(nir_instr, node, node);
if (nir_instrs_equal(instr, other)) {
- nir_src other_dest_src = {
- .is_ssa = true,
- .ssa = nir_instr_get_dest_ssa_def(other),
- };
+ nir_ssa_def *other_def = nir_instr_get_dest_ssa_def(other);
nir_ssa_def_rewrite_uses(nir_instr_get_dest_ssa_def(instr),
- other_dest_src, state->mem_ctx);
+ nir_src_for_ssa(other_def),
+ state->mem_ctx);
nir_instr_remove(instr);
state->progress = true;
return;
@@ -203,12 +201,10 @@ nir_opt_cse_instr(nir_instr *instr, struct cse_state *state)
block != NULL; block = block->imm_dom) {
nir_foreach_instr_reverse(block, other) {
if (nir_instrs_equal(instr, other)) {
- nir_src other_dest_src = {
- .is_ssa = true,
- .ssa = nir_instr_get_dest_ssa_def(other),
- };
+ nir_ssa_def *other_def = nir_instr_get_dest_ssa_def(other);
nir_ssa_def_rewrite_uses(nir_instr_get_dest_ssa_def(instr),
- other_dest_src, state->mem_ctx);
+ nir_src_for_ssa(other_def),
+ state->mem_ctx);
nir_instr_remove(instr);
state->progress = true;
return;