GPUCommandEncoder
public final class GPUCommandEncoder implements AutoCloseable
An object used to record GPU commands.
Summary
Public methods |
|
|---|---|
final external @NonNull GPUComputePassEncoder |
@FastNativeBegins recording a compute pass. |
final external @NonNull GPURenderPassEncoder |
@FastNativeBegins recording a render pass. |
final external void |
@FastNativeFills a buffer with zeros. |
external void |
close()Decrements the reference count of the object and frees resources when the count reaches zero. |
final external void |
@FastNativeCopies data from one buffer to another. |
final external void |
@FastNativeCopies data from a buffer to a texture. |
final external void |
@FastNativeCopies data from a texture to a buffer. |
final external void |
@FastNativeCopies data from one texture to another. |
boolean |
|
final external @NonNull GPUCommandBuffer |
@FastNativeFinishes recording commands and creates a command buffer. |
final long |
|
int |
hashCode() |
final external void |
@FastNativeInserts a debug marker into the command stream. |
final external void |
Pops the current debug group. |
final external void |
@FastNativePushes a new debug group. |
final external void |
@FastNativeResolves the results of a query set into a buffer. |
final external void |
@FastNativeSets a human-readable label for debugging. |
final external void |
@FastNativeWrites a timestamp value into a query set. |
Public methods
beginComputePass
@FastNative
public final external @NonNull GPUComputePassEncoder beginComputePass(GPUComputePassDescriptor descriptor)
Begins recording a compute pass.
| Parameters | |
|---|---|
GPUComputePassDescriptor descriptor |
The descriptor for the compute pass. |
| Returns | |
|---|---|
@NonNull GPUComputePassEncoder |
A compute pass encoder. |
beginRenderPass
@FastNative
public final external @NonNull GPURenderPassEncoder beginRenderPass(@NonNull GPURenderPassDescriptor descriptor)
Begins recording a render pass.
| Parameters | |
|---|---|
@NonNull GPURenderPassDescriptor descriptor |
The descriptor for the render pass. |
| Returns | |
|---|---|
@NonNull GPURenderPassEncoder |
A render pass encoder. |
clearBuffer
@FastNative
public final external void clearBuffer(@NonNull GPUBuffer buffer, long offset, long size)
Fills a buffer with zeros.
close
public external void close()
Decrements the reference count of the object and frees resources when the count reaches zero.
This is the standard way to manage object lifetimes and should be used in use blocks. After calling this, the object is no longer usable.
copyBufferToBuffer
@FastNative
public final external void copyBufferToBuffer(
@NonNull GPUBuffer source,
long sourceOffset,
@NonNull GPUBuffer destination,
long destinationOffset,
long size
)
Copies data from one buffer to another.
copyBufferToTexture
@FastNative
public final external void copyBufferToTexture(
@NonNull GPUTexelCopyBufferInfo source,
@NonNull GPUTexelCopyTextureInfo destination,
@NonNull GPUExtent3D copySize
)
Copies data from a buffer to a texture.
| Parameters | |
|---|---|
@NonNull GPUTexelCopyBufferInfo source |
The source buffer information. |
@NonNull GPUTexelCopyTextureInfo destination |
The destination texture information. |
@NonNull GPUExtent3D copySize |
The size of the region to copy. |
copyTextureToBuffer
@FastNative
public final external void copyTextureToBuffer(
@NonNull GPUTexelCopyTextureInfo source,
@NonNull GPUTexelCopyBufferInfo destination,
@NonNull GPUExtent3D copySize
)
Copies data from a texture to a buffer.
| Parameters | |
|---|---|
@NonNull GPUTexelCopyTextureInfo source |
The source texture information. |
@NonNull GPUTexelCopyBufferInfo destination |
The destination buffer information. |
@NonNull GPUExtent3D copySize |
The size of the region to copy. |
copyTextureToTexture
@FastNative
public final external void copyTextureToTexture(
@NonNull GPUTexelCopyTextureInfo source,
@NonNull GPUTexelCopyTextureInfo destination,
@NonNull GPUExtent3D copySize
)
Copies data from one texture to another.
| Parameters | |
|---|---|
@NonNull GPUTexelCopyTextureInfo source |
The source texture information. |
@NonNull GPUTexelCopyTextureInfo destination |
The destination texture information. |
@NonNull GPUExtent3D copySize |
The size of the region to copy. |
finish
@FastNative
public final external @NonNull GPUCommandBuffer finish(GPUCommandBufferDescriptor descriptor)
Finishes recording commands and creates a command buffer.
| Parameters | |
|---|---|
GPUCommandBufferDescriptor descriptor |
The descriptor for the command buffer. |
| Returns | |
|---|---|
@NonNull GPUCommandBuffer |
The created command buffer. |
insertDebugMarker
@FastNative
public final external void insertDebugMarker(@NonNull String markerLabel)
Inserts a debug marker into the command stream.
popDebugGroup
@FastNative
public final external void popDebugGroup()
Pops the current debug group.
pushDebugGroup
@FastNative
public final external void pushDebugGroup(@NonNull String groupLabel)
Pushes a new debug group.
resolveQuerySet
@FastNative
public final external void resolveQuerySet(
@NonNull GPUQuerySet querySet,
int firstQuery,
int queryCount,
@NonNull GPUBuffer destination,
long destinationOffset
)
Resolves the results of a query set into a buffer.
| Parameters | |
|---|---|
@NonNull GPUQuerySet querySet |
The query set to resolve. |
int firstQuery |
The index of the first query to resolve. |
int queryCount |
The number of queries to resolve. |
@NonNull GPUBuffer destination |
The destination buffer. |
long destinationOffset |
The offset in the destination buffer. |
setLabel
@FastNative
public final external void setLabel(@NonNull String label)
Sets a human-readable label for debugging.
writeTimestamp
@FastNative
public final external void writeTimestamp(@NonNull GPUQuerySet querySet, int queryIndex)
Writes a timestamp value into a query set.
| Parameters | |
|---|---|
@NonNull GPUQuerySet querySet |
The query set to write to. |
int queryIndex |
The index in the query set. |