GPURenderPassEncoder


public final class GPURenderPassEncoder implements AutoCloseable


An object used to record commands for a render pass.

Summary

Public methods

final external void

Begins an occlusion query.

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.

final external void

Ends the render pass.

final external void

Ends an occlusion query.

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

Executes a list of render bundles.

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

Sets the blend constant color.

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
setScissorRect(int x, int y, int width, int height)

Sets the scissor rectangle.

final external void

Sets the stencil reference value.

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

Sets a vertex buffer for a specific slot.

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

Sets the viewport rectangle.

Public methods

beginOcclusionQuery

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

Begins an occlusion query.

Parameters
int queryIndex

The index of the query in the query set.

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.

end

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

Ends the render pass.

endOcclusionQuery

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

Ends an occlusion query.

equals

public boolean equals(Object other)

executeBundles

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

Executes a list of render bundles.

Parameters
@NonNull GPURenderBundle[] bundles

An array of render bundles to execute.

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.

setBlendConstant

Added in 1.0.0-alpha04
@FastNative
public final external void setBlendConstant(@NonNull GPUColor color)

Sets the blend constant color.

Parameters
@NonNull GPUColor color

The RGBA blend constant.

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.

setScissorRect

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

Sets the scissor rectangle.

Parameters
int x

The x-coordinate of the scissor rectangle.

int y

The y-coordinate 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-alpha04
@FastNative
public final external void setStencilReference(int reference)

Sets the stencil reference value.

Parameters
int reference

The stencil reference value.

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.

setViewport

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

Sets the viewport rectangle.

Parameters
float x

The x-coordinate of the viewport.

float y

The y-coordinate 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.