GPURenderPassEncoder
class GPURenderPassEncoder : AutoCloseable
An object used to record commands for a render pass.
Summary
Public functions |
|
|---|---|
external Unit |
@FastNativeBegins an occlusion query. |
open external Unit |
close()Decrements the reference count of the object and frees resources when the count reaches zero. |
external Unit |
Draws non-indexed primitives. |
external Unit |
@FastNativeDraws indexed primitives. |
external Unit |
@FastNativeDraws indexed primitives with parameters from a buffer. |
external Unit |
@FastNativeDraws non-indexed primitives with parameters from a buffer. |
external Unit |
Ends the render pass. |
external Unit |
Ends an occlusion query. |
open operator Boolean |
|
external Unit |
@FastNativeExecutes a list of render bundles. |
open Int |
hashCode() |
external Unit |
@FastNativeInserts a debug marker into the command stream. |
external Unit |
Pops the current debug group. |
external Unit |
@FastNativePushes a new debug group. |
external Unit |
@FastNativeSets a bind group for the pipeline. |
external Unit |
@FastNativeSets the blend constant color. |
external Unit |
@FastNativeSets the index buffer. |
external Unit |
@FastNativeSets a human-readable label for debugging. |
external Unit |
@FastNativeSets the current render pipeline. |
external Unit |
@FastNativeSets the scissor rectangle. |
external Unit |
@FastNativeSets the stencil reference value. |
external Unit |
@FastNativeSets a vertex buffer for a specific slot. |
external Unit |
@FastNativeSets the viewport rectangle. |
Public functions
beginOcclusionQuery
@FastNative
external fun beginOcclusionQuery(queryIndex: Int): Unit
Begins an occlusion query.
| Parameters | |
|---|---|
queryIndex: Int |
The index of the query in the query set. |
close
open external fun close(): Unit
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
@FastNative
external fun draw(
vertexCount: Int,
instanceCount: Int = 1,
firstVertex: Int = 0,
firstInstance: Int = 0
): Unit
Draws non-indexed primitives.
drawIndexed
@FastNative
external fun drawIndexed(
indexCount: Int,
instanceCount: Int = 1,
firstIndex: Int = 0,
baseVertex: Int = 0,
firstInstance: Int = 0
): Unit
Draws indexed primitives.
| Parameters | |
|---|---|
indexCount: Int |
The number of indices to draw. |
instanceCount: Int = 1 |
The number of instances to draw. |
firstIndex: Int = 0 |
The index of the first index to draw. |
baseVertex: Int = 0 |
A value added to each index before reading from the vertex buffer. |
firstInstance: Int = 0 |
The index of the first instance to draw. |
drawIndexedIndirect
@FastNative
external fun drawIndexedIndirect(indirectBuffer: GPUBuffer, indirectOffset: Long): Unit
Draws indexed primitives with parameters from a buffer.
drawIndirect
@FastNative
external fun drawIndirect(indirectBuffer: GPUBuffer, indirectOffset: Long): Unit
Draws non-indexed primitives with parameters from a buffer.
endOcclusionQuery
@FastNative
external fun endOcclusionQuery(): Unit
Ends an occlusion query.
executeBundles
@FastNative
external fun executeBundles(bundles: Array<GPURenderBundle> = arrayOf()): Unit
Executes a list of render bundles.
| Parameters | |
|---|---|
bundles: Array<GPURenderBundle> = arrayOf() |
An array of render bundles to execute. |
insertDebugMarker
@FastNative
external fun insertDebugMarker(markerLabel: String): Unit
Inserts a debug marker into the command stream.
| Parameters | |
|---|---|
markerLabel: String |
The label for the debug marker. |
popDebugGroup
@FastNative
external fun popDebugGroup(): Unit
Pops the current debug group.
pushDebugGroup
@FastNative
external fun pushDebugGroup(groupLabel: String): Unit
Pushes a new debug group.
| Parameters | |
|---|---|
groupLabel: String |
The label for the debug group. |
setBindGroup
@FastNative
external fun setBindGroup(
groupIndex: Int,
group: GPUBindGroup? = null,
dynamicOffsets: IntArray = intArrayOf()
): Unit
Sets a bind group for the pipeline.
| Parameters | |
|---|---|
groupIndex: Int |
The index of the bind group. |
group: GPUBindGroup? = null |
The bind group to set. |
dynamicOffsets: IntArray = intArrayOf() |
An array of dynamic offsets. |
setBlendConstant
@FastNative
external fun setBlendConstant(color: GPUColor): Unit
Sets the blend constant color.
| Parameters | |
|---|---|
color: GPUColor |
The RGBA blend constant. |
setIndexBuffer
@FastNative
external fun setIndexBuffer(
buffer: GPUBuffer,
format: Int = IndexFormat.Undefined,
offset: Long = 0,
size: Long = Constants.WHOLE_SIZE
): Unit
Sets the index buffer.
setLabel
@FastNative
external fun setLabel(label: String): Unit
Sets a human-readable label for debugging.
| Parameters | |
|---|---|
label: String |
The label string. |
setPipeline
@FastNative
external fun setPipeline(pipeline: GPURenderPipeline): Unit
Sets the current render pipeline.
| Parameters | |
|---|---|
pipeline: GPURenderPipeline |
The render pipeline to set. |
setScissorRect
@FastNative
external fun setScissorRect(x: Int, y: Int, width: Int, height: Int): Unit
Sets the scissor rectangle.
setStencilReference
@FastNative
external fun setStencilReference(reference: Int): Unit
Sets the stencil reference value.
| Parameters | |
|---|---|
reference: Int |
The stencil reference value. |
setVertexBuffer
@FastNative
external fun setVertexBuffer(
slot: Int,
buffer: GPUBuffer? = null,
offset: Long = 0,
size: Long = Constants.WHOLE_SIZE
): Unit
Sets a vertex buffer for a specific slot.
setViewport
@FastNative
external fun setViewport(
x: Float,
y: Float,
width: Float,
height: Float,
minDepth: Float,
maxDepth: Float
): Unit
Sets the viewport rectangle.