Skip to content

Commit 6ee14d1

Browse files
committed
alt fix
1 parent 16e1678 commit 6ee14d1

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

examples/webgpu_compute_prefix_sum.html

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -224,8 +224,9 @@
224224
const jStart = uint( pow( 2, iteration ).sub( 1 ) );
225225
const kIters = uint( pow( 2, iteration ) );
226226

227+
// Emulate iteration through and k
227228
const accessIndex = jStart.add( step.mul( invocationLocalIndex.div( kIters ) ) );
228-
const assignIndex = fract( invocationLocalIndex, kIters ).add( 1 );
229+
const assignIndex = jStart.add( fract( invocationLocalIndex, kIters ) ).add( 1 );
229230

230231
currentElements.element( assignIndex ).addAssign( currentElements.element( accessIndex ) );
231232

0 commit comments

Comments
 (0)