more cleaning up
This commit is contained in:
parent
2c7d72a699
commit
560398fefb
110 changed files with 931 additions and 2645 deletions
17
src/utils/graphics/get-workgroup-count.ts
Normal file
17
src/utils/graphics/get-workgroup-count.ts
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
export const getWorkgroupCount = (
|
||||
invocationCount: number,
|
||||
workgroupSize: number
|
||||
): number => {
|
||||
if (
|
||||
!Number.isFinite(invocationCount) ||
|
||||
!Number.isFinite(workgroupSize) ||
|
||||
invocationCount <= 0 ||
|
||||
workgroupSize <= 0
|
||||
) {
|
||||
throw new Error(
|
||||
'Invocation count and workgroup size must be positive finite numbers'
|
||||
);
|
||||
}
|
||||
|
||||
return Math.ceil(invocationCount / workgroupSize);
|
||||
};
|
||||
Loading…
Reference in a new issue