GPURenderBundleEncoder
public final class GPURenderBundleEncoder implements AutoCloseable
Used to record rendering commands into a render bundle.
Summary
Public methods |
|
|---|---|
external void |
close() |
final external void |
@FastNativeDraws primitives without an index buffer. |
final external void |
@FastNativeDraws primitives using an index buffer. |
final external void |
@FastNativeDraws primitives using an index buffer with arguments from a buffer. |
final external void |
@FastNativeDraws primitives without an index buffer using arguments from a buffer. |
boolean |
|
final external @NonNull GPURenderBundle |
@FastNativeFinalizes the recorded commands and creates an immutable render bundle. |
final long |
|
int |
hashCode() |
final external void |
@FastNativeInserts a debug marker command into the bundle. |
final external void |
Ends the most recently pushed debug group. |
final external void |
@FastNativeStarts a new named debug group. |
final external void |
@FastNativeSets the bind group for a given index. |
final external void |
@FastNativeBinds an index buffer to be used for indexed drawing. |
final external void |
@FastNativeSets a debug label for the render bundle encoder. |
final external void |
@FastNativeSets the active render pipeline. |
final external void |
@FastNativeBinds a vertex buffer to a specific slot. |
Public methods
draw
@FastNative
public final external void draw(
int vertexCount,
int instanceCount,
int firstVertex,
int firstInstance
)
Draws primitives without an index buffer.
| Parameters | |
|---|---|
int vertexCount |
The number of vertices to draw. |
int instanceCount |
The number of instances to draw. |
int firstVertex |
The index of the first vertex to draw. |
int firstInstance |
The index of the first instance to draw. |
drawIndexed
@FastNative
public final external void drawIndexed(
int indexCount,
int instanceCount,
int firstIndex,
int baseVertex,
int firstInstance
)
Draws primitives using an index buffer.
| Parameters | |
|---|---|
int indexCount |
The number of indices to use. |
int instanceCount |
The number of instances to draw. |
int firstIndex |
The index of the first element in the index buffer. |
int baseVertex |
A signed integer added to each index value read from the index buffer. |
int firstInstance |
The index of the first instance to draw. |
drawIndexedIndirect
@FastNative
public final external void drawIndexedIndirect(
@NonNull GPUBuffer indirectBuffer,
long indirectOffset
)
Draws primitives using an index buffer with arguments from a buffer.
drawIndirect
@FastNative
public final external void drawIndirect(@NonNull GPUBuffer indirectBuffer, long indirectOffset)
Draws primitives without an index buffer using arguments from a buffer.
finish
@FastNative
public final external @NonNull GPURenderBundle finish(RenderBundleDescriptor descriptor)
Finalizes the recorded commands and creates an immutable render bundle.
| Parameters | |
|---|---|
RenderBundleDescriptor descriptor |
The descriptor for the resulting render bundle. |
| Returns | |
|---|---|
@NonNull GPURenderBundle |
The generated render bundle. |
insertDebugMarker
@FastNative
public final external void insertDebugMarker(@NonNull String markerLabel)
Inserts a debug marker command into the bundle.
popDebugGroup
@FastNative
public final external void popDebugGroup()
Ends the most recently pushed debug group.
pushDebugGroup
@FastNative
public final external void pushDebugGroup(@NonNull String groupLabel)
Starts a new named debug group.
setBindGroup
@FastNative
public final external void setBindGroup(
int groupIndex,
GPUBindGroup group,
@NonNull int[] dynamicOffsets
)
Sets the bind group for a given index.
| Parameters | |
|---|---|
int groupIndex |
The index of the bind group to set. |
GPUBindGroup group |
The bind group object to set. |
@NonNull int[] dynamicOffsets |
An array of dynamic offsets for uniform/storage buffers. |
setIndexBuffer
@FastNative
public final external void setIndexBuffer(
@NonNull GPUBuffer buffer,
int format,
long offset,
long size
)
Binds an index buffer to be used for indexed drawing.
setLabel
@FastNative
public final external void setLabel(@NonNull String label)
Sets a debug label for the render bundle encoder.
setPipeline
@FastNative
public final external void setPipeline(@NonNull GPURenderPipeline pipeline)
Sets the active render pipeline.
| Parameters | |
|---|---|
@NonNull GPURenderPipeline pipeline |
The render pipeline to use for subsequent drawing calls. |
setVertexBuffer
@FastNative
public final external void setVertexBuffer(int slot, GPUBuffer buffer, long offset, long size)
Binds a vertex buffer to a specific slot.
| Parameters | |
|---|---|
int slot |
The vertex buffer slot index. |
GPUBuffer buffer |
The buffer to bind to the slot. |
long offset |
The offset in the buffer to start reading vertex data. |
long size |
The size of the vertex buffer range to use. |