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