summaryrefslogtreecommitdiffstats
path: root/src/glsl/nir/nir_lower_atomics.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_lower_atomics.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_lower_atomics.c')
-rw-r--r--src/glsl/nir/nir_lower_atomics.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/src/glsl/nir/nir_lower_atomics.c b/src/glsl/nir/nir_lower_atomics.c
index 874c5347634..c45b397afba 100644
--- a/src/glsl/nir/nir_lower_atomics.c
+++ b/src/glsl/nir/nir_lower_atomics.c
@@ -115,11 +115,9 @@ lower_instr(nir_intrinsic_instr *instr, nir_function_impl *impl)
new_instr->dest.is_ssa = true;
nir_ssa_def_init(&new_instr->instr, &new_instr->dest.ssa,
instr->dest.ssa.num_components, NULL);
- nir_src new_dest_src = {
- .is_ssa = true,
- .ssa = &new_instr->dest.ssa,
- };
- nir_ssa_def_rewrite_uses(&instr->dest.ssa, new_dest_src, mem_ctx);
+ nir_ssa_def_rewrite_uses(&instr->dest.ssa,
+ nir_src_for_ssa(&new_instr->dest.ssa),
+ mem_ctx);
} else {
new_instr->dest = nir_dest_copy(instr->dest, mem_ctx);
}