GPURenderBundleEncoder


public final class GPURenderBundleEncoder implements AutoCloseable


Used to record rendering commands into a render bundle.

Summary

Public methods

external void
final external void
@FastNative
draw(
    int vertexCount,
    int instanceCount,
    int firstVertex,
    int firstInstance
)

Draws primitives without an index buffer.

final external void
@FastNative
drawIndexed(
    int indexCount,
    int instanceCount,
    int firstIndex,
    int baseVertex,
    int firstInstance
)

Draws primitives using an index buffer.

final external void
@FastNative
drawIndexedIndirect(
    @NonNull GPUBuffer indirectBuffer,
    long indirectOffset
)

Draws primitives using an index buffer with arguments from a buffer.

final external void
@FastNative
drawIndirect(@NonNull GPUBuffer indirectBuffer, long indirectOffset)

Draws primitives without an index buffer using arguments from a buffer.

boolean
equals(Object other)
final external @NonNull GPURenderBundle

Finalizes the recorded commands and creates an immutable render bundle.

final long
int
final external void

Inserts a debug marker command into the bundle.

final external void

Ends the most recently pushed debug group.

final external void

Starts a new named debug group.

final external void
@FastNative
setBindGroup(
    int groupIndex,
    GPUBindGroup group,
    @NonNull int[] dynamicOffsets
)

Sets the bind group for a given index.

final external void
@FastNative
setIndexBuffer(
    @NonNull GPUBuffer buffer,
    int format,
    long offset,
    long size
)

Binds an index buffer to be used for indexed drawing.

final external void

Sets a debug label for the render bundle encoder.

final external void

Sets the active render pipeline.

final external void
@FastNative
setVertexBuffer(int slot, GPUBuffer buffer, long offset, long size)

Binds a vertex buffer to a specific slot.

Public methods

close

Added in 1.0.0-alpha01
public external void close()

draw

Added in 1.0.0-alpha01
@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

Added in 1.0.0-alpha01
@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

Added in 1.0.0-alpha01
@FastNative
public final external void drawIndexedIndirect(
    @NonNull GPUBuffer indirectBuffer,
    long indirectOffset
)

Draws primitives using an index buffer with arguments from a buffer.

Parameters
@NonNull GPUBuffer indirectBuffer

The buffer containing the indexed draw arguments.

long indirectOffset

The offset in the buffer where indexed draw arguments start.

drawIndirect

Added in 1.0.0-alpha01
@FastNative
public final external void drawIndirect(@NonNull GPUBuffer indirectBuffer, long indirectOffset)

Draws primitives without an index buffer using arguments from a buffer.

Parameters
@NonNull GPUBuffer indirectBuffer

The buffer containing the draw arguments.

long indirectOffset

The offset in the buffer where draw arguments start.

equals

public boolean equals(Object other)

finish

Added in 1.0.0-alpha01
@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.

getHandle

Added in 1.0.0-alpha01
public final long getHandle()

hashCode

public int hashCode()

insertDebugMarker

Added in 1.0.0-alpha01
@FastNative
public final external void insertDebugMarker(@NonNull String markerLabel)

Inserts a debug marker command into the bundle.

Parameters
@NonNull String markerLabel

The label for the debug marker.

popDebugGroup

Added in 1.0.0-alpha01
@FastNative
public final external void popDebugGroup()

Ends the most recently pushed debug group.

pushDebugGroup

Added in 1.0.0-alpha01
@FastNative
public final external void pushDebugGroup(@NonNull String groupLabel)

Starts a new named debug group.

Parameters
@NonNull String groupLabel

The label for the debug group.

setBindGroup

Added in 1.0.0-alpha01
@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

Added in 1.0.0-alpha01
@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.

Parameters
@NonNull GPUBuffer buffer

The index buffer.

int format

The format of the indices in the buffer.

long offset

The offset in the buffer to start reading index data.

long size

The size of the index buffer range to use.

setLabel

Added in 1.0.0-alpha01
@FastNative
public final external void setLabel(@NonNull String label)

Sets a debug label for the render bundle encoder.

Parameters
@NonNull String label

The label to assign to the render bundle encoder.

setPipeline

Added in 1.0.0-alpha01
@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

Added in 1.0.0-alpha01
@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.