GPURenderBundleEncoder


public final class GPURenderBundleEncoder implements AutoCloseable


An object used to record commands for a render bundle.

Summary

Public methods

external void

Decrements the reference count of the object and frees resources when the count reaches zero.

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

Draws non-indexed primitives.

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

Draws indexed primitives.

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

Draws indexed primitives with parameters from a buffer.

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

Draws non-indexed primitives with parameters from a buffer.

boolean
equals(Object other)
final external @NonNull GPURenderBundle

Finishes recording commands and creates a render bundle.

final long
int
final external void

Inserts a debug marker into the command stream.

final external void

Pops the current debug group.

final external void

Pushes a new debug group.

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

Sets a bind group for the pipeline.

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

Sets the index buffer.

final external void

Sets a human-readable label for debugging.

final external void

Sets the current render pipeline.

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

Sets a vertex buffer for a specific slot.

Public methods

close

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

draw

Added in 1.0.0-alpha04
@FastNative
public final external void draw(
    int vertexCount,
    int instanceCount,
    int firstVertex,
    int firstInstance
)

Draws non-indexed primitives.

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-alpha04
@FastNative
public final external void drawIndexed(
    int indexCount,
    int instanceCount,
    int firstIndex,
    int baseVertex,
    int firstInstance
)

Draws indexed primitives.

Parameters
int indexCount

The number of indices to draw.

int instanceCount

The number of instances to draw.

int firstIndex

The index of the first index to draw.

int baseVertex

A value added to each index before reading from the vertex buffer.

int firstInstance

The index of the first instance to draw.

drawIndexedIndirect

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

Draws indexed primitives with parameters from a buffer.

Parameters
@NonNull GPUBuffer indirectBuffer

The buffer containing the draw parameters.

long indirectOffset

The offset in the indirect buffer.

drawIndirect

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

Draws non-indexed primitives with parameters from a buffer.

Parameters
@NonNull GPUBuffer indirectBuffer

The buffer containing the draw parameters.

long indirectOffset

The offset in the indirect buffer.

equals

public boolean equals(Object other)

finish

Added in 1.0.0-alpha04
@FastNative
public final external @NonNull GPURenderBundle finish(GPURenderBundleDescriptor descriptor)

Finishes recording commands and creates a render bundle.

Parameters
GPURenderBundleDescriptor descriptor

The descriptor for the render bundle.

Returns
@NonNull GPURenderBundle

The created render bundle.

getHandle

Added in 1.0.0-alpha04
public final long getHandle()

hashCode

public int hashCode()

insertDebugMarker

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

Inserts a debug marker into the command stream.

Parameters
@NonNull String markerLabel

The label for the debug marker.

popDebugGroup

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

Pops the current debug group.

pushDebugGroup

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

Pushes a new debug group.

Parameters
@NonNull String groupLabel

The label for the debug group.

setBindGroup

Added in 1.0.0-alpha04
@FastNative
public final external void setBindGroup(
    int groupIndex,
    GPUBindGroup group,
    @NonNull int[] dynamicOffsets
)

Sets a bind group for the pipeline.

Parameters
int groupIndex

The index of the bind group.

GPUBindGroup group

The bind group to set.

@NonNull int[] dynamicOffsets

An array of dynamic offsets.

setIndexBuffer

Added in 1.0.0-alpha04
@FastNative
public final external void setIndexBuffer(
    @NonNull GPUBuffer buffer,
    int format,
    long offset,
    long size
)

Sets the index buffer.

Parameters
@NonNull GPUBuffer buffer

The index buffer.

int format

The format of the indices.

long offset

The offset in the index buffer.

long size

The size of the index data to use.

setLabel

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

Sets a human-readable label for debugging.

Parameters
@NonNull String label

The label string.

setPipeline

Added in 1.0.0-alpha04
@FastNative
public final external void setPipeline(@NonNull GPURenderPipeline pipeline)

Sets the current render pipeline.

Parameters
@NonNull GPURenderPipeline pipeline

The render pipeline to set.

setVertexBuffer

Added in 1.0.0-alpha04
@FastNative
public final external void setVertexBuffer(int slot, GPUBuffer buffer, long offset, long size)

Sets a vertex buffer for a specific slot.

Parameters
int slot

The vertex buffer slot.

GPUBuffer buffer

The vertex buffer.

long offset

The offset in the vertex buffer.

long size

The size of the vertex data to use.