GPURenderPassEncoder


public final class GPURenderPassEncoder implements AutoCloseable


Used to record rendering commands within a command encoder, operating on render attachments.

Summary

Public methods

final external void

Begins an occlusion query in the current render pass.

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.

final external void

Ends the render pass.

final external void

Ends the current occlusion query.

boolean
equals(Object other)
final external void
@FastNative
executeBundles(@NonNull GPURenderBundle[] bundles)

Executes a set of pre-recorded render bundles.

final long
int
final external void

Inserts a debug marker command into the pass.

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

Sets the blend constant color for the render pass.

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 pass encoder.

final external void

Sets the active render pipeline.

final external void
@FastNative
setScissorRect(int x, int y, int width, int height)

Sets the scissor rectangle for the render pass.

final external void

Sets the stencil reference value for the render pass.

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

Binds a vertex buffer to a specific slot.

final external void
@FastNative
setViewport(
    float x,
    float y,
    float width,
    float height,
    float minDepth,
    float maxDepth
)

Sets the viewport region for the render pass.

Public methods

beginOcclusionQuery

Added in 1.0.0-alpha01
@FastNative
public final external void beginOcclusionQuery(int queryIndex)

Begins an occlusion query in the current render pass.

Parameters
int queryIndex

The index in the occlusion query set to record the starting sample count.

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.

end

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

Ends the render pass.

endOcclusionQuery

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

Ends the current occlusion query.

equals

public boolean equals(Object other)

executeBundles

Added in 1.0.0-alpha01
@FastNative
public final external void executeBundles(@NonNull GPURenderBundle[] bundles)

Executes a set of pre-recorded render bundles.

Parameters
@NonNull GPURenderBundle[] bundles

An array of render bundles to execute.

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 pass.

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.

setBlendConstant

Added in 1.0.0-alpha01
@FastNative
public final external void setBlendConstant(@NonNull Color color)

Sets the blend constant color for the render pass.

Parameters
@NonNull Color color

The constant color value to use as a blend factor.

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 pass encoder.

Parameters
@NonNull String label

The label to assign to the render pass 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.

setScissorRect

Added in 1.0.0-alpha01
@FastNative
public final external void setScissorRect(int x, int y, int width, int height)

Sets the scissor rectangle for the render pass.

Parameters
int x

The x coordinate of the top-left corner of the scissor rectangle.

int y

The y coordinate of the top-left corner of the scissor rectangle.

int width

The width of the scissor rectangle.

int height

The height of the scissor rectangle.

setStencilReference

Added in 1.0.0-alpha01
@FastNative
public final external void setStencilReference(int reference)

Sets the stencil reference value for the render pass.

Parameters
int reference

The stencil reference value to use in stencil testing.

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.

setViewport

Added in 1.0.0-alpha01
@FastNative
public final external void setViewport(
    float x,
    float y,
    float width,
    float height,
    float minDepth,
    float maxDepth
)

Sets the viewport region for the render pass.

Parameters
float x

The x coordinate of the top-left corner of the viewport.

float y

The y coordinate of the top-left corner of the viewport.

float width

The width of the viewport.

float height

The height of the viewport.

float minDepth

The minimum depth of the viewport.

float maxDepth

The maximum depth of the viewport.