Skip to main content

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.

MDN Reference

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()).

MDN Reference

Parameters

ParameterType
workgroupCountXnumber
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()).

MDN Reference

Parameters

ParameterType
indirectBufferGPUBuffer
indirectOffsetnumber

Returns

void


end()

end(): void;

The end() method of the GPUComputePassEncoder interface completes recording of the current compute pass command sequence.

MDN Reference

Returns

void


insertDebugMarker()

insertDebugMarker(markerLabel): void;

MDN Reference

Parameters

ParameterType
markerLabelstring

Returns

void

Inherited from

GPUDebugCommandsMixin.insertDebugMarker


popDebugGroup()

popDebugGroup(): void;

MDN Reference

Returns

void

Inherited from

GPUDebugCommandsMixin.popDebugGroup


pushDebugGroup()

pushDebugGroup(groupLabel): void;

MDN Reference

Parameters

ParameterType
groupLabelstring

Returns

void

Inherited from

GPUDebugCommandsMixin.pushDebugGroup


setBindGroup()

Call Signature

setBindGroup(
index,
bindGroup,
dynamicOffsets?
): void;

MDN Reference

Parameters
ParameterType
indexnumber
bindGroupGPUBindGroup | null
dynamicOffsets?number[]
Returns

void

Inherited from

GPUBindingCommandsMixin.setBindGroup

Call Signature

setBindGroup(
index,
bindGroup,
dynamicOffsetsData,
dynamicOffsetsDataStart,
dynamicOffsetsDataLength
): void;
Parameters
ParameterType
indexnumber
bindGroupGPUBindGroup | null
dynamicOffsetsDataUint32Array<ArrayBufferLike>
dynamicOffsetsDataStartnumber
dynamicOffsetsDataLengthnumber
Returns

void

Inherited from

GPUBindingCommandsMixin.setBindGroup

Call Signature

setBindGroup(
index,
bindGroup,
dynamicOffsets?
): void;

MDN Reference

Parameters
ParameterType
indexnumber
bindGroupGPUBindGroup | 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.

MDN Reference

Parameters

ParameterType
pipelineGPUComputePipeline

Returns

void

Properties

label

label: string;

MDN Reference

Inherited from

GPUObjectBase.label