summaryrefslogtreecommitdiffstats
path: root/balls.cl
diff options
context:
space:
mode:
authorSam Anthony <sam@samanthony.xyz>2024-10-30 10:15:46 -0400
committerSam Anthony <sam@samanthony.xyz>2024-10-30 10:15:46 -0400
commitefbb3e5c5315523ab55c7b856785e54db7eaf604 (patch)
treec8d8481485a32f72ba4efd82d5b9abca0a820e06 /balls.cl
parent8135cb3419b9fbe5f1c725ae05bc1d8f8dc1219e (diff)
downloadballs-efbb3e5c5315523ab55c7b856785e54db7eaf604.zip
collideBalls(): fix ball index array addressing
Diffstat (limited to 'balls.cl')
-rw-r--r--balls.cl4
1 files changed, 2 insertions, 2 deletions
diff --git a/balls.cl b/balls.cl
index 05a223b..bca7686 100644
--- a/balls.cl
+++ b/balls.cl
@@ -65,8 +65,8 @@ collideBalls(
float r1, r2, m1, m2;
id = get_global_id(0);
- i1 = ballIndices[id];
- i2 = ballIndices[id+1];
+ i1 = ballIndices[2*id];
+ i2 = ballIndices[2*id+1];
p1 = positions[i1];
p2 = positions[i2];