summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFrancisco Jerez <[email protected]>2015-05-05 23:02:05 +0300
committerFrancisco Jerez <[email protected]>2015-05-12 15:47:57 +0300
commit6de78e6b0c8aa4bd6bdd89e3ca33c2ccb9a5ac3d (patch)
treea5380e9cb4762742823324a9d11587bdf77e2a23
parentf1269a3e013e23135b2482e4f137d69ed6cc1734 (diff)
nir: Fix indexing of atomic counter arrays with a constant value.
Reviewed-by: Connor Abbott <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
-rw-r--r--src/glsl/nir/nir_lower_atomics.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/glsl/nir/nir_lower_atomics.c b/src/glsl/nir/nir_lower_atomics.c
index e82df016969..f6f89020f78 100644
--- a/src/glsl/nir/nir_lower_atomics.c
+++ b/src/glsl/nir/nir_lower_atomics.c
@@ -78,7 +78,8 @@ lower_instr(nir_intrinsic_instr *instr, nir_function_impl *impl)
nir_deref_as_array(instr->variables[0]->deref.child);
assert(deref_array->deref.child == NULL);
- offset_const->value.u[0] += deref_array->base_offset;
+ offset_const->value.u[0] +=
+ deref_array->base_offset * ATOMIC_COUNTER_SIZE;
if (deref_array->deref_array_type == nir_deref_array_type_indirect) {
nir_load_const_instr *atomic_counter_size =