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
open external var label: String

Functions

Link copied to clipboard
external 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
external 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
external fun end()

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

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

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