summaryrefslogtreecommitdiffstats
path: root/src/compiler
diff options
context:
space:
mode:
authorKenneth Graunke <[email protected]>2016-07-14 14:18:33 -0700
committerKenneth Graunke <[email protected]>2016-07-15 17:17:10 -0700
commit52e75dcb8c04c0dde989970c4c587cbe8313f7cf (patch)
treed431e9711da17fd258a79b614ce26c925af7bc70 /src/compiler
parent50b9bb94219ae443d81cda1b15cda519d48dbdc7 (diff)
nir: Use nir_intrinsic_set_base in atomic lowering.
This is more readable and also offers assertions that protect against setting const_index fields on the wrong kind of intrinsic. Suggested by Jason. Signed-off-by: Kenneth Graunke <[email protected]> Reviewed-by: Jason Ekstrand <[email protected]>
Diffstat (limited to 'src/compiler')
-rw-r--r--src/compiler/nir/nir_lower_io.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/compiler/nir/nir_lower_io.c b/src/compiler/nir/nir_lower_io.c
index 1708e5b77e6..0a4de6a2d01 100644
--- a/src/compiler/nir/nir_lower_io.c
+++ b/src/compiler/nir/nir_lower_io.c
@@ -277,9 +277,9 @@ lower_atomic(nir_intrinsic_instr *intrin, struct lower_io_state *state,
nir_intrinsic_instr *atomic =
nir_intrinsic_instr_create(state->mem_ctx, op);
- atomic->src[0] = nir_src_for_ssa(offset);
- atomic->const_index[0] = var->data.driver_location;
+ nir_intrinsic_set_base(atomic, var->data.driver_location);
+ atomic->src[0] = nir_src_for_ssa(offset);
for (unsigned i = 0; i < nir_op_infos[intrin->intrinsic].num_inputs; i++) {
nir_src_copy(&atomic->src[i+1], &intrin->src[i], atomic);
}