File tree Expand file tree Collapse file tree 2 files changed +5
-4
lines changed
packages/typegpu-concurrent-sum/src Expand file tree Collapse file tree 2 files changed +5
-4
lines changed Original file line number Diff line number Diff line change 1
1
import tgpu from 'typegpu' ;
2
2
import * as d from 'typegpu/data' ;
3
3
import * as std from 'typegpu/std' ;
4
- import { dataBindGroupLayout } from './schemas.ts' ;
4
+ import { dataBindGroupLayout , fixedArrayLength } from './schemas.ts' ;
5
5
6
- export const workGroupSize = 256 ;
6
+ export const workGroupSize = fixedArrayLength ;
7
7
8
8
const { inputArray } = dataBindGroupLayout . bound ;
9
9
@@ -12,7 +12,7 @@ export const computeShader = tgpu['~unstable'].computeFn({
12
12
workgroupSize : [ workGroupSize ] ,
13
13
} ) ( ( input ) => {
14
14
const threadId = input . in . x ;
15
- const length = d . u32 ( 1024 ) ;
15
+ const length = d . u32 ( fixedArrayLength ) ;
16
16
const log2Length = d . i32 ( std . log2 ( d . f32 ( length ) ) ) ;
17
17
18
18
// Up-sweep phase
Original file line number Diff line number Diff line change 1
1
import tgpu from 'typegpu' ;
2
2
import * as d from 'typegpu/data' ;
3
3
4
+ export const fixedArrayLength = 256 ;
4
5
export const inputValueType = d . struct ( {
5
- in : d . arrayOf ( d . f32 , 1024 ) ,
6
+ in : d . arrayOf ( d . f32 , fixedArrayLength ) ,
6
7
} )
7
8
. $name ( 'inArray' ) ;
8
9
You can’t perform that action at this time.
0 commit comments