Skip to content

Commit 440ea54

Browse files
s-rigaudSamuel Rigaud
andauthored
Examples: fix instancedArray call in WebGPU compute reduce (#31855)
Co-authored-by: Samuel Rigaud <[email protected]>
1 parent eeec0f4 commit 440ea54

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

examples/webgpu_compute_reduce.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -936,7 +936,7 @@ <h3 id="panel-title" style="flex: 0 0 auto;">Subgroup Reduction Explanation</h3>
936936
} ) );
937937

938938
// Represents array of data as uints in compute shader.
939-
const inputStorage = instancedArray( array, 'uint', size ).setPBO( true ).setName( `Current_${leftSideDisplay ? 'Left' : 'Right'}` );
939+
const inputStorage = instancedArray( array, 'uint' ).setPBO( true ).setName( `Current_${leftSideDisplay ? 'Left' : 'Right'}` );
940940
// Represents array of data as vec4s in compute shader;
941941
const inputVec4BufferAttribute = new THREE.StorageInstancedBufferAttribute( array, 4 );
942942
const inputVectorizedStorage = storage( inputVec4BufferAttribute, 'uvec4', vecSize ).setPBO( true ).setName( `CurrentVectorized_${leftSideDisplay ? 'Left' : 'Right'}` );
@@ -947,9 +947,9 @@ <h3 id="panel-title" style="flex: 0 0 auto;">Subgroup Reduction Explanation</h3>
947947
const rowSize = divRoundUp( size, numRows );
948948

949949
const workgroupSumsArray = new Uint32Array( numRows );
950-
const workgroupSumsStorage = instancedArray( workgroupSumsArray, 'uint', numRows ).setPBO( true ).setName( `WorkgroupSums_${leftSideDisplay ? 'Left' : 'Right'}` );
950+
const workgroupSumsStorage = instancedArray( workgroupSumsArray, 'uint' ).setPBO( true ).setName( `WorkgroupSums_${leftSideDisplay ? 'Left' : 'Right'}` );
951951
const debugArray = new Uint32Array( 1024 );
952-
const debugStorage = instancedArray( debugArray, 'uint', 1024 ).setPBO( true ).setName( `Debug_${leftSideDisplay ? 'Left' : 'Right'}` );
952+
const debugStorage = instancedArray( debugArray, 'uint' ).setPBO( true ).setName( `Debug_${leftSideDisplay ? 'Left' : 'Right'}` );
953953

954954
const buffers = {
955955
'Input Buffer': inputStorage,

0 commit comments

Comments
 (0)