Interface GPUCommandEncoder
label: string;
beginComputePass(
descriptor?: GPUComputePassDescriptor,
): GPUComputePassEncoder;
beginRenderPass(descriptor: GPURenderPassDescriptor): GPURenderPassEncoder;
clearBuffer(buffer: GPUBuffer, offset?: number, size?: number): void;
copyBufferToBuffer(
source: GPUBuffer,
destination: GPUBuffer,
size?: number,
): void;
copyBufferToBuffer(
source: GPUBuffer,
sourceOffset: number,
destination: GPUBuffer,
destinationOffset: number,
size?: number,
): void;
copyBufferToTexture(
source: GPUTexelCopyBufferInfo,
destination: GPUTexelCopyTextureInfo,
copySize: GPUExtent3D,
): void;
copyBufferToTexture(
source: GPUTexelCopyBufferInfo,
destination: GPUTexelCopyTextureInfo,
copySize: Iterable<number>,
): void;
copyTextureToBuffer(
source: GPUTexelCopyTextureInfo,
destination: GPUTexelCopyBufferInfo,
copySize: GPUExtent3D,
): void;
copyTextureToBuffer(
source: GPUTexelCopyTextureInfo,
destination: GPUTexelCopyBufferInfo,
copySize: Iterable<number>,
): void;
copyTextureToTexture(
source: GPUTexelCopyTextureInfo,
destination: GPUTexelCopyTextureInfo,
copySize: GPUExtent3D,
): void;
copyTextureToTexture(
source: GPUTexelCopyTextureInfo,
destination: GPUTexelCopyTextureInfo,
copySize: Iterable<number>,
): void;
finish(descriptor?: GPUCommandBufferDescriptor): GPUCommandBuffer;
insertDebugMarker(markerLabel: string): void;
popDebugGroup(): void;
pushDebugGroup(groupLabel: string): void;
resolveQuerySet(
querySet: GPUQuerySet,
firstQuery: number,
queryCount: number,
destination: GPUBuffer,
destinationOffset: number,
): void;
}
Hierarchy (View Summary)
- GPUDebugCommandsMixin
- GPUObjectBase
- GPUCommandEncoder
Methods
beginComputePass
-
The
beginComputePass()method of the GPUCommandEncoder interface starts encoding a compute pass, returning a GPUComputePassEncoder that can be used to control computation.Parameters
Optionaldescriptor: GPUComputePassDescriptor
Returns GPUComputePassEncoder
beginRenderPass
-
The
beginRenderPass()method of the GPUCommandEncoder interface starts encoding a render pass, returning a GPURenderPassEncoder that can be used to control rendering.Parameters
- descriptor: GPURenderPassDescriptor
Returns GPURenderPassEncoder
clearBuffer
-
The
clearBuffer()method of the GPUCommandEncoder interface encodes a command that fills a region of a GPUBuffer with zeroes.Parameters
- buffer: GPUBuffer
Optionaloffset: numberOptionalsize: number
Returns void
copyBufferToBuffer
-
The
copyBufferToBuffer()method of the GPUCommandEncoder interface encodes a command that copies data from one GPUBuffer to another.Returns void
copyBufferToTexture
-
copyBufferToTexture(
source: GPUTexelCopyBufferInfo,
destination: GPUTexelCopyTextureInfo,
copySize: GPUExtent3D,
): voidThe
copyBufferToTexture()method of the GPUCommandEncoder interface encodes a command that copies data from a GPUBuffer to a GPUTexture.Parameters
- source: GPUTexelCopyBufferInfo
- destination: GPUTexelCopyTextureInfo
- copySize: GPUExtent3D
Returns void
-
copyBufferToTexture(
source: GPUTexelCopyBufferInfo,
destination: GPUTexelCopyTextureInfo,
copySize: Iterable<number>,
): voidThe
copyBufferToTexture()method of the GPUCommandEncoder interface encodes a command that copies data from a GPUBuffer to a GPUTexture.Parameters
- source: GPUTexelCopyBufferInfo
- destination: GPUTexelCopyTextureInfo
- copySize: Iterable<number>
Returns void
copyTextureToBuffer
-
copyTextureToBuffer(
source: GPUTexelCopyTextureInfo,
destination: GPUTexelCopyBufferInfo,
copySize: GPUExtent3D,
): voidThe
copyTextureToBuffer()method of the GPUCommandEncoder interface encodes a command that copies data from a GPUTexture to a GPUBuffer.Parameters
- source: GPUTexelCopyTextureInfo
- destination: GPUTexelCopyBufferInfo
- copySize: GPUExtent3D
Returns void
-
copyTextureToBuffer(
source: GPUTexelCopyTextureInfo,
destination: GPUTexelCopyBufferInfo,
copySize: Iterable<number>,
): voidThe
copyTextureToBuffer()method of the GPUCommandEncoder interface encodes a command that copies data from a GPUTexture to a GPUBuffer.Parameters
- source: GPUTexelCopyTextureInfo
- destination: GPUTexelCopyBufferInfo
- copySize: Iterable<number>
Returns void
copyTextureToTexture
-
copyTextureToTexture(
source: GPUTexelCopyTextureInfo,
destination: GPUTexelCopyTextureInfo,
copySize: GPUExtent3D,
): voidThe
copyTextureToTexture()method of the GPUCommandEncoder interface encodes a command that copies data from one GPUTexture to another.Parameters
- source: GPUTexelCopyTextureInfo
- destination: GPUTexelCopyTextureInfo
- copySize: GPUExtent3D
Returns void
-
copyTextureToTexture(
source: GPUTexelCopyTextureInfo,
destination: GPUTexelCopyTextureInfo,
copySize: Iterable<number>,
): voidThe
copyTextureToTexture()method of the GPUCommandEncoder interface encodes a command that copies data from one GPUTexture to another.Parameters
- source: GPUTexelCopyTextureInfo
- destination: GPUTexelCopyTextureInfo
- copySize: Iterable<number>
Returns void
finish
-
The
finish()method of the GPUCommandEncoder interface completes recording of the command sequence encoded on this GPUCommandEncoder, returning a corresponding GPUCommandBuffer.Parameters
Optionaldescriptor: GPUCommandBufferDescriptor
Returns GPUCommandBuffer
insertDebugMarker
popDebugGroup
-
Returns void
pushDebugGroup
resolveQuerySet
-
resolveQuerySet(
querySet: GPUQuerySet,
firstQuery: number,
queryCount: number,
destination: GPUBuffer,
destinationOffset: number,
): voidThe
resolveQuerySet()method of the GPUCommandEncoder interface encodes a command that resolves a GPUQuerySet, copying the results into a specified GPUBuffer.Parameters
- querySet: GPUQuerySet
- firstQuery: number
- queryCount: number
- destination: GPUBuffer
- destinationOffset: number
Returns void
The
GPUCommandEncoderinterface 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