Skip to content

Commit 334b61a

Browse files
author
Attila Schroeder
committed
Allows the specification of workgroups for compute shaders and the specification of the dispatchSize
1 parent d893334 commit 334b61a

File tree

4 files changed

+4
-2
lines changed

4 files changed

+4
-2
lines changed

src/nodes/gpgpu/ComputeNode.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -219,7 +219,7 @@ export default ComputeNode;
219219
* @tsl
220220
* @function
221221
* @param {Node} node - TODO
222-
* @param {number} count - TODO.
222+
* @param {number} countOrWorkgroupSize - TODO.
223223
* @param {Array<number>} [workgroupSize=[ 64, 1, 1 ]]
224224
* @returns {AtomicFunctionNode}
225225
*/

src/renderers/common/Renderer.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2288,6 +2288,7 @@ class Renderer {
22882288
* if the renderer has been initialized.
22892289
*
22902290
* @param {Node|Array<Node>} computeNodes - The compute node(s).
2291+
* @param {Array<number>} dispatchSize - Array with [x,y,z] values for dispatch.
22912292
* @return {Promise|undefined} A Promise that resolve when the compute has finished. Only returned when the renderer has not been initialized.
22922293
*/
22932294
compute( computeNodes, dispatchSize = [ 0, 0, 0 ] ) {

src/renderers/webgpu/WebGPUBackend.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1318,6 +1318,7 @@ class WebGPUBackend extends Backend {
13181318
* @param {Node} computeNode - The compute node.
13191319
* @param {Array<BindGroup>} bindings - The bindings.
13201320
* @param {ComputePipeline} pipeline - The compute pipeline.
1321+
* @param {Array<number>} dispatchSize - Array with [x,y,z] values for dispatch.
13211322
*/
13221323
compute( computeGroup, computeNode, bindings, pipeline, dispatchSize ) {
13231324

src/renderers/webgpu/nodes/WGSLNodeBuilder.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1902,7 +1902,7 @@ ${ flowData.code }
19021902

19031903
const workgroupSize = this.object.workgroupSize || [ 8, 8, 1 ];
19041904

1905-
if ( workgroupSize.length !== 3 ) throw new Error( "workgroupSize must have 3 elements" );
1905+
if ( workgroupSize.length !== 3 ) throw new Error( 'workgroupSize must have 3 elements' );
19061906

19071907
this.computeShader = this._getWGSLComputeCode( shadersData.compute, workgroupSize );
19081908

0 commit comments

Comments
 (0)