GPUCommandEncoder

The GPUCommandEncoder interface of the WebGPU API represents an encoder that collects a sequence of GPU commands to be issued to the GPU. Available only in secure contexts.

MDN Reference

Properties

Link copied to clipboard
open external var label: String

Functions

Link copied to clipboard
external fun beginComputePass(descriptor: GPUComputePassDescriptor = definedExternally): GPUComputePassEncoder

The beginComputePass() method of the GPUCommandEncoder interface starts encoding a compute pass, returning a GPUComputePassEncoder that can be used to control computation.

Link copied to clipboard

The beginRenderPass() method of the GPUCommandEncoder interface starts encoding a render pass, returning a GPURenderPassEncoder that can be used to control rendering.

Link copied to clipboard
external fun clearBuffer(buffer: GPUBuffer, offset: GPUSize64 = definedExternally, size: GPUSize64 = definedExternally)

The clearBuffer() method of the GPUCommandEncoder interface encodes a command that fills a region of a GPUBuffer with zeroes.

Link copied to clipboard
external fun copyBufferToBuffer(source: GPUBuffer, destination: GPUBuffer, size: GPUSize64 = definedExternally)

The copyBufferToBuffer() method of the GPUCommandEncoder interface encodes a command that copies data from one GPUBuffer to another.

external fun copyBufferToBuffer(source: GPUBuffer, sourceOffset: GPUSize64, destination: GPUBuffer, destinationOffset: GPUSize64, size: GPUSize64 = definedExternally)
Link copied to clipboard
external fun copyBufferToTexture(source: GPUTexelCopyBufferInfo, destination: GPUTexelCopyTextureInfo, copySize: GPUExtent3D)

The copyBufferToTexture() method of the GPUCommandEncoder interface encodes a command that copies data from a GPUBuffer to a GPUTexture.

Link copied to clipboard
external fun copyTextureToBuffer(source: GPUTexelCopyTextureInfo, destination: GPUTexelCopyBufferInfo, copySize: GPUExtent3D)

The copyTextureToBuffer() method of the GPUCommandEncoder interface encodes a command that copies data from a GPUTexture to a GPUBuffer.

Link copied to clipboard

The copyTextureToTexture() method of the GPUCommandEncoder interface encodes a command that copies data from one GPUTexture to another.

Link copied to clipboard
external fun finish(descriptor: GPUCommandBufferDescriptor = definedExternally): GPUCommandBuffer

The finish() method of the GPUCommandEncoder interface completes recording of the command sequence encoded on this GPUCommandEncoder, returning a corresponding GPUCommandBuffer.

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
external fun resolveQuerySet(querySet: GPUQuerySet, firstQuery: GPUSize32, queryCount: GPUSize32, destination: GPUBuffer, destinationOffset: GPUSize64)

The resolveQuerySet() method of the GPUCommandEncoder interface encodes a command that resolves a GPUQuerySet, copying the results into a specified GPUBuffer.