GPUComputePassEncoder
The GPUComputePassEncoder interface of the WebGPU API encodes commands related to controlling the compute shader stage, as issued by a GPUComputePipeline. It forms part of the overall encoding activity of a GPUCommandEncoder.
Available only in secure contexts.
Extends
Methods
dispatchWorkgroups()
dispatchWorkgroups(
workgroupCountX,
workgroupCountY?,
workgroupCountZ?
): void;
The dispatchWorkgroups() method of the GPUComputePassEncoder interface dispatches a specific grid of workgroups to perform the work being done by the current GPUComputePipeline (i.e., set via GPUComputePassEncoder.setPipeline()).
Parameters
| Parameter | Type |
|---|---|
workgroupCountX | number |
workgroupCountY? | number |
workgroupCountZ? | number |
Returns
void
dispatchWorkgroupsIndirect()
dispatchWorkgroupsIndirect(indirectBuffer, indirectOffset): void;
The dispatchWorkgroupsIndirect() method of the GPUComputePassEncoder interface dispatches a grid of workgroups, defined by the parameters of a GPUBuffer, to perform the work being done by the current GPUComputePipeline (i.e., set via GPUComputePassEncoder.setPipeline()).
Parameters
| Parameter | Type |
|---|---|
indirectBuffer | GPUBuffer |
indirectOffset | number |
Returns
void
end()
end(): void;
The end() method of the GPUComputePassEncoder interface completes recording of the current compute pass command sequence.
Returns
void
insertDebugMarker()
insertDebugMarker(markerLabel): void;
Parameters
| Parameter | Type |
|---|---|
markerLabel | string |
Returns
void
Inherited from
GPUDebugCommandsMixin.insertDebugMarker
popDebugGroup()
popDebugGroup(): void;
Returns
void
Inherited from
GPUDebugCommandsMixin.popDebugGroup
pushDebugGroup()
pushDebugGroup(groupLabel): void;
Parameters
| Parameter | Type |
|---|---|
groupLabel | string |
Returns
void
Inherited from
GPUDebugCommandsMixin.pushDebugGroup
setBindGroup()
Call Signature
setBindGroup(
index,
bindGroup,
dynamicOffsets?
): void;
Parameters
| Parameter | Type |
|---|---|
index | number |
bindGroup | GPUBindGroup | null |
dynamicOffsets? | number[] |
Returns
void
Inherited from
GPUBindingCommandsMixin.setBindGroup
Call Signature
setBindGroup(
index,
bindGroup,
dynamicOffsetsData,
dynamicOffsetsDataStart,
dynamicOffsetsDataLength
): void;
Parameters
| Parameter | Type |
|---|---|
index | number |
bindGroup | GPUBindGroup | null |
dynamicOffsetsData | Uint32Array<ArrayBufferLike> |
dynamicOffsetsDataStart | number |
dynamicOffsetsDataLength | number |
Returns
void
Inherited from
GPUBindingCommandsMixin.setBindGroup
Call Signature
setBindGroup(
index,
bindGroup,
dynamicOffsets?
): void;
Parameters
| Parameter | Type |
|---|---|
index | number |
bindGroup | GPUBindGroup | null |
dynamicOffsets? | Iterable<number, any, any> |
Returns
void
Inherited from
GPUBindingCommandsMixin.setBindGroup
setPipeline()
setPipeline(pipeline): void;
The setPipeline() method of the GPUComputePassEncoder interface sets the GPUComputePipeline to use for this compute pass.
Parameters
| Parameter | Type |
|---|---|
pipeline | GPUComputePipeline |
Returns
void
Properties
label
label: string;