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 |
@FastNativeBegins an occlusion query in the current render pass. |
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. |
final external void |
Ends the render pass. |
final external void |
Ends the current occlusion query. |
boolean |
|
final external void |
@FastNativeExecutes a set of pre-recorded render bundles. |
final long |
|
int |
hashCode() |
final external void |
@FastNativeInserts a debug marker command into the pass. |
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 |
@FastNativeSets the blend constant color for the render pass. |
final external void |
@FastNativeBinds an index buffer to be used for indexed drawing. |
final external void |
@FastNativeSets a debug label for the render pass encoder. |
final external void |
@FastNativeSets the active render pipeline. |
final external void |
@FastNativeSets the scissor rectangle for the render pass. |
final external void |
@FastNativeSets the stencil reference value for the render pass. |
final external void |
@FastNativeBinds a vertex buffer to a specific slot. |
final external void |
@FastNativeSets the viewport region for the render pass. |
Public methods
beginOcclusionQuery
@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. |
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.
endOcclusionQuery
@FastNative
public final external void endOcclusionQuery()
Ends the current occlusion query.
executeBundles
@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. |
insertDebugMarker
@FastNative
public final external void insertDebugMarker(@NonNull String markerLabel)
Inserts a debug marker command into the pass.
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. |
setBlendConstant
@FastNative
public final external void setBlendConstant(@NonNull Color color)
Sets the blend constant color for the render pass.
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 pass 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. |
setScissorRect
@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
@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
@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
@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. |