Table of Contents

Class GPUCommandEncoder

Namespace
CSharpToJavaScript.APIs.JS
Assembly
CSharpToJavaScript.dll

The GPUCommandEncoder interface of the {{domxref("WebGPU API", "WebGPU API", "", "nocode")}} represents an encoder that collects a sequence of GPU commands to be issued to the GPU.

[Value("GPUCommandEncoder")]
public class GPUCommandEncoder
Inheritance
GPUCommandEncoder
Inherited Members

Remarks

A GPUCommandEncoder object instance is created via the CreateCommandEncoder(GPUCommandEncoderDescriptor) property.

-The WebGPU API

See also on MDN

Constructors

GPUCommandEncoder()

public GPUCommandEncoder()

Methods

BeginComputePass(GPUComputePassDescriptor)

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

[Value("beginComputePass")]
public GPUComputePassEncoder BeginComputePass(GPUComputePassDescriptor descriptor = null)

Parameters

descriptor GPUComputePassDescriptor

Returns

GPUComputePassEncoder

A GPUComputePassEncoder object instance.

Remarks

BeginRenderPass(GPURenderPassDescriptor)

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

[Value("beginRenderPass")]
public GPURenderPassEncoder BeginRenderPass(GPURenderPassDescriptor descriptor)

Parameters

descriptor GPURenderPassDescriptor

Returns

GPURenderPassEncoder

A GPURenderPassEncoder object instance.

Remarks

ClearBuffer(GPUBuffer, ulong, ulong)

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

[Value("clearBuffer")]
public GlobalObject.Undefined ClearBuffer(GPUBuffer buffer, ulong offset = 0, ulong size = 0)

Parameters

buffer GPUBuffer
offset ulong
size ulong

Returns

GlobalObject.Undefined

None (GlobalObject.Undefined).

Remarks

CopyBufferToBuffer(GPUBuffer, ulong, GPUBuffer, ulong, ulong)

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

[Value("copyBufferToBuffer")]
public GlobalObject.Undefined CopyBufferToBuffer(GPUBuffer source, ulong sourceOffset, GPUBuffer destination, ulong destinationOffset, ulong size)

Parameters

source GPUBuffer
sourceOffset ulong
destination GPUBuffer
destinationOffset ulong
size ulong

Returns

GlobalObject.Undefined

None (GlobalObject.Undefined).

Remarks

CopyBufferToTexture(GPUTexelCopyBufferInfo, GPUTexelCopyTextureInfo, Union222)

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

[Value("copyBufferToTexture")]
public GlobalObject.Undefined CopyBufferToTexture(GPUTexelCopyBufferInfo source, GPUTexelCopyTextureInfo destination, Union222 copySize)

Parameters

source GPUTexelCopyBufferInfo
destination GPUTexelCopyTextureInfo
copySize Union222

Returns

GlobalObject.Undefined

None (GlobalObject.Undefined).

Remarks

CopyTextureToBuffer(GPUTexelCopyTextureInfo, GPUTexelCopyBufferInfo, Union222)

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

[Value("copyTextureToBuffer")]
public GlobalObject.Undefined CopyTextureToBuffer(GPUTexelCopyTextureInfo source, GPUTexelCopyBufferInfo destination, Union222 copySize)

Parameters

source GPUTexelCopyTextureInfo
destination GPUTexelCopyBufferInfo
copySize Union222

Returns

GlobalObject.Undefined

None (GlobalObject.Undefined).

Remarks

CopyTextureToTexture(GPUTexelCopyTextureInfo, GPUTexelCopyTextureInfo, Union222)

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

[Value("copyTextureToTexture")]
public GlobalObject.Undefined CopyTextureToTexture(GPUTexelCopyTextureInfo source, GPUTexelCopyTextureInfo destination, Union222 copySize)

Parameters

source GPUTexelCopyTextureInfo
destination GPUTexelCopyTextureInfo
copySize Union222

Returns

GlobalObject.Undefined

None (GlobalObject.Undefined).

Remarks

Finish(GPUCommandBufferDescriptor)

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

[Value("finish")]
public GPUCommandBuffer Finish(GPUCommandBufferDescriptor descriptor = null)

Parameters

descriptor GPUCommandBufferDescriptor

Returns

GPUCommandBuffer

A GPUCommandBuffer object instance.

Remarks

ResolveQuerySet(GPUQuerySet, ulong, ulong, GPUBuffer, ulong)

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

[Value("resolveQuerySet")]
public GlobalObject.Undefined ResolveQuerySet(GPUQuerySet querySet, ulong firstQuery, ulong queryCount, GPUBuffer destination, ulong destinationOffset)

Parameters

querySet GPUQuerySet
firstQuery ulong
queryCount ulong
destination GPUBuffer
destinationOffset ulong

Returns

GlobalObject.Undefined

None (GlobalObject.Undefined).

Remarks