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

Properties

Link copied to clipboard

Functions

Link copied to clipboard
fun dispatchWorkgroups(workgroupCountX: GPUSize32, workgroupCountY: GPUSize32 = definedExternally, workgroupCountZ: GPUSize32 = definedExternally)

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

Link copied to clipboard
fun dispatchWorkgroupsIndirect(indirectBuffer: GPUBuffer, indirectOffset: GPUSize64)

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

Link copied to clipboard
fun end()

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

Link copied to clipboard
open fun insertDebugMarker(markerLabel: String)
Link copied to clipboard
Link copied to clipboard
open fun pushDebugGroup(groupLabel: String)
Link copied to clipboard
open fun setBindGroup(index: GPUIndex32, bindGroup: GPUBindGroup?, dynamicOffsets: ReadonlyArray<GPUBufferDynamicOffset> = definedExternally)
open fun setBindGroup(index: GPUIndex32, bindGroup: GPUBindGroup?, dynamicOffsetsData: Uint32Array<ArrayBufferLike>, dynamicOffsetsDataStart: GPUSize64, dynamicOffsetsDataLength: GPUSize32)
Link copied to clipboard

The setPipeline() method of the GPUComputePassEncoder interface sets the GPUComputePipeline to use for this compute pass.