For AI agents: a documentation index is available at /llms.txt. Markdown versions of all pages
are available by appending .md to any URL.
Interface GPUComputePassEncoder
interface GPUComputePassEncoder {
label: string;
dispatchWorkgroups(
workgroupCountX: number,
workgroupCountY?: number,
workgroupCountZ?: number,
): void;
dispatchWorkgroupsIndirect(
indirectBuffer: GPUBuffer,
indirectOffset: number,
): void;
end(): void;
insertDebugMarker(markerLabel: string): void;
popDebugGroup(): void;
pushDebugGroup(groupLabel: string): void;
setBindGroup(
index: number,
bindGroup: GPUBindGroup | null,
dynamicOffsets?: number[],
): void;
setBindGroup(
index: number,
bindGroup: GPUBindGroup | null,
dynamicOffsetsData: Uint32Array<ArrayBufferLike>,
dynamicOffsetsDataStart: number,
dynamicOffsetsDataLength: number,
): void;
setBindGroup(
index: number,
bindGroup: GPUBindGroup | null,
dynamicOffsets?: Iterable<number, any, any>,
): void;
setPipeline(pipeline: GPUComputePipeline): void;
}
label: string;
dispatchWorkgroups(
workgroupCountX: number,
workgroupCountY?: number,
workgroupCountZ?: number,
): void;
dispatchWorkgroupsIndirect(
indirectBuffer: GPUBuffer,
indirectOffset: number,
): void;
end(): void;
insertDebugMarker(markerLabel: string): void;
popDebugGroup(): void;
pushDebugGroup(groupLabel: string): void;
setBindGroup(
index: number,
bindGroup: GPUBindGroup | null,
dynamicOffsets?: number[],
): void;
setBindGroup(
index: number,
bindGroup: GPUBindGroup | null,
dynamicOffsetsData: Uint32Array<ArrayBufferLike>,
dynamicOffsetsDataStart: number,
dynamicOffsetsDataLength: number,
): void;
setBindGroup(
index: number,
bindGroup: GPUBindGroup | null,
dynamicOffsets?: Iterable<number, any, any>,
): void;
setPipeline(pipeline: GPUComputePipeline): void;
}
Hierarchy (View Summary)
- GPUBindingCommandsMixin
- GPUDebugCommandsMixin
- GPUObjectBase
- GPUComputePassEncoder
Index
Methods
dispatchWorkgroups
-
dispatchWorkgroups(
workgroupCountX: number,
workgroupCountY?: number,
workgroupCountZ?: number,
): voidThe
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
- workgroupCountX: number
OptionalworkgroupCountY: numberOptionalworkgroupCountZ: number
Returns void
dispatchWorkgroupsIndirect
-
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
- indirectBuffer: GPUBuffer
- indirectOffset: number
Returns void
end
-
The
end()method of the GPUComputePassEncoder interface completes recording of the current compute pass command sequence.Returns void
insertDebugMarker
popDebugGroup
-
Returns void
pushDebugGroup
setBindGroup
-
Parameters
- index: number
- bindGroup: GPUBindGroup | null
OptionaldynamicOffsets: number[]
Returns void
-
setBindGroup(
index: number,
bindGroup: GPUBindGroup | null,
dynamicOffsetsData: Uint32Array<ArrayBufferLike>,
dynamicOffsetsDataStart: number,
dynamicOffsetsDataLength: number,
): voidParameters
- index: number
- bindGroup: GPUBindGroup | null
- dynamicOffsetsData: Uint32Array<ArrayBufferLike>
- dynamicOffsetsDataStart: number
- dynamicOffsetsDataLength: number
Returns void
-
setBindGroup(
index: number,
bindGroup: GPUBindGroup | null,
dynamicOffsets?: Iterable<number, any, any>,
): voidParameters
- index: number
- bindGroup: GPUBindGroup | null
OptionaldynamicOffsets: Iterable<number, any, any>
Returns void
setPipeline
-
The
setPipeline()method of the GPUComputePassEncoder interface sets the GPUComputePipeline to use for this compute pass.Parameters
- pipeline: GPUComputePipeline
Returns void
The
GPUComputePassEncoderinterface 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