GPURenderPassEncoder


class GPURenderPassEncoder : AutoCloseable


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

Summary

Public functions

external Unit

Begins an occlusion query in the current render pass.

open external Unit
external Unit
@FastNative
draw(
    vertexCount: Int,
    instanceCount: Int,
    firstVertex: Int,
    firstInstance: Int
)

Draws primitives without an index buffer.

external Unit
@FastNative
drawIndexed(
    indexCount: Int,
    instanceCount: Int,
    firstIndex: Int,
    baseVertex: Int,
    firstInstance: Int
)

Draws primitives using an index buffer.

external Unit
@FastNative
drawIndexedIndirect(indirectBuffer: GPUBuffer, indirectOffset: Long)

Draws primitives using an index buffer with arguments from a buffer.

external Unit
@FastNative
drawIndirect(indirectBuffer: GPUBuffer, indirectOffset: Long)

Draws primitives without an index buffer using arguments from a buffer.

external Unit

Ends the render pass.

external Unit

Ends the current occlusion query.

open operator Boolean
equals(other: Any?)
external Unit

Executes a set of pre-recorded render bundles.

open Int
external Unit

Inserts a debug marker command into the pass.

external Unit

Ends the most recently pushed debug group.

external Unit

Starts a new named debug group.

external Unit
@FastNative
setBindGroup(
    groupIndex: Int,
    group: GPUBindGroup?,
    dynamicOffsets: IntArray
)

Sets the bind group for a given index.

external Unit

Sets the blend constant color for the render pass.

external Unit
@FastNative
setIndexBuffer(buffer: GPUBuffer, format: Int, offset: Long, size: Long)

Binds an index buffer to be used for indexed drawing.

external Unit

Sets a debug label for the render pass encoder.

external Unit

Sets the active render pipeline.

external Unit
@FastNative
setScissorRect(x: Int, y: Int, width: Int, height: Int)

Sets the scissor rectangle for the render pass.

external Unit

Sets the stencil reference value for the render pass.

external Unit
@FastNative
setVertexBuffer(slot: Int, buffer: GPUBuffer?, offset: Long, size: Long)

Binds a vertex buffer to a specific slot.

external Unit
@FastNative
setViewport(
    x: Float,
    y: Float,
    width: Float,
    height: Float,
    minDepth: Float,
    maxDepth: Float
)

Sets the viewport region for the render pass.

Public properties

Long

Public functions

beginOcclusionQuery

Added in 1.0.0-alpha01
@FastNative
external fun beginOcclusionQuery(queryIndex: Int): Unit

Begins an occlusion query in the current render pass.

Parameters
queryIndex: Int

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

close

Added in 1.0.0-alpha01
open external fun close(): Unit

draw

Added in 1.0.0-alpha01
@FastNative
external fun draw(
    vertexCount: Int,
    instanceCount: Int = 1,
    firstVertex: Int = 0,
    firstInstance: Int = 0
): Unit

Draws primitives without an index buffer.

Parameters
vertexCount: Int

The number of vertices to draw.

instanceCount: Int = 1

The number of instances to draw.

firstVertex: Int = 0

The index of the first vertex to draw.

firstInstance: Int = 0

The index of the first instance to draw.

drawIndexed

Added in 1.0.0-alpha01
@FastNative
external fun drawIndexed(
    indexCount: Int,
    instanceCount: Int = 1,
    firstIndex: Int = 0,
    baseVertex: Int = 0,
    firstInstance: Int = 0
): Unit

Draws primitives using an index buffer.

Parameters
indexCount: Int

The number of indices to use.

instanceCount: Int = 1

The number of instances to draw.

firstIndex: Int = 0

The index of the first element in the index buffer.

baseVertex: Int = 0

A signed integer added to each index value read from the index buffer.

firstInstance: Int = 0

The index of the first instance to draw.

drawIndexedIndirect

Added in 1.0.0-alpha01
@FastNative
external fun drawIndexedIndirect(indirectBuffer: GPUBuffer, indirectOffset: Long): Unit

Draws primitives using an index buffer with arguments from a buffer.

Parameters
indirectBuffer: GPUBuffer

The buffer containing the indexed draw arguments.

indirectOffset: Long

The offset in the buffer where indexed draw arguments start.

drawIndirect

Added in 1.0.0-alpha01
@FastNative
external fun drawIndirect(indirectBuffer: GPUBuffer, indirectOffset: Long): Unit

Draws primitives without an index buffer using arguments from a buffer.

Parameters
indirectBuffer: GPUBuffer

The buffer containing the draw arguments.

indirectOffset: Long

The offset in the buffer where draw arguments start.

end

Added in 1.0.0-alpha01
@FastNative
external fun end(): Unit

Ends the render pass.

endOcclusionQuery

Added in 1.0.0-alpha01
@FastNative
external fun endOcclusionQuery(): Unit

Ends the current occlusion query.

equals

open operator fun equals(other: Any?): Boolean

executeBundles

Added in 1.0.0-alpha01
@FastNative
external fun executeBundles(bundles: Array<GPURenderBundle> = arrayOf()): Unit

Executes a set of pre-recorded render bundles.

Parameters
bundles: Array<GPURenderBundle> = arrayOf()

An array of render bundles to execute.

hashCode

open fun hashCode(): Int

insertDebugMarker

Added in 1.0.0-alpha01
@FastNative
external fun insertDebugMarker(markerLabel: String): Unit

Inserts a debug marker command into the pass.

Parameters
markerLabel: String

The label for the debug marker.

popDebugGroup

Added in 1.0.0-alpha01
@FastNative
external fun popDebugGroup(): Unit

Ends the most recently pushed debug group.

pushDebugGroup

Added in 1.0.0-alpha01
@FastNative
external fun pushDebugGroup(groupLabel: String): Unit

Starts a new named debug group.

Parameters
groupLabel: String

The label for the debug group.

setBindGroup

Added in 1.0.0-alpha01
@FastNative
external fun setBindGroup(
    groupIndex: Int,
    group: GPUBindGroup? = null,
    dynamicOffsets: IntArray = intArrayOf()
): Unit

Sets the bind group for a given index.

Parameters
groupIndex: Int

The index of the bind group to set.

group: GPUBindGroup? = null

The bind group object to set.

dynamicOffsets: IntArray = intArrayOf()

An array of dynamic offsets for uniform/storage buffers.

setBlendConstant

Added in 1.0.0-alpha01
@FastNative
external fun setBlendConstant(color: Color): Unit

Sets the blend constant color for the render pass.

Parameters
color: Color

The constant color value to use as a blend factor.

setIndexBuffer

Added in 1.0.0-alpha01
@FastNative
external fun setIndexBuffer(
    buffer: GPUBuffer,
    format: Int = IndexFormat.Undefined,
    offset: Long = 0,
    size: Long = Constants.WHOLE_SIZE
): Unit

Binds an index buffer to be used for indexed drawing.

Parameters
buffer: GPUBuffer

The index buffer.

format: Int = IndexFormat.Undefined

The format of the indices in the buffer.

offset: Long = 0

The offset in the buffer to start reading index data.

size: Long = Constants.WHOLE_SIZE

The size of the index buffer range to use.

setLabel

Added in 1.0.0-alpha01
@FastNative
external fun setLabel(label: String): Unit

Sets a debug label for the render pass encoder.

Parameters
label: String

The label to assign to the render pass encoder.

setPipeline

Added in 1.0.0-alpha01
@FastNative
external fun setPipeline(pipeline: GPURenderPipeline): Unit

Sets the active render pipeline.

Parameters
pipeline: GPURenderPipeline

The render pipeline to use for subsequent drawing calls.

setScissorRect

Added in 1.0.0-alpha01
@FastNative
external fun setScissorRect(x: Int, y: Int, width: Int, height: Int): Unit

Sets the scissor rectangle for the render pass.

Parameters
x: Int

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

y: Int

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

width: Int

The width of the scissor rectangle.

height: Int

The height of the scissor rectangle.

setStencilReference

Added in 1.0.0-alpha01
@FastNative
external fun setStencilReference(reference: Int): Unit

Sets the stencil reference value for the render pass.

Parameters
reference: Int

The stencil reference value to use in stencil testing.

setVertexBuffer

Added in 1.0.0-alpha01
@FastNative
external fun setVertexBuffer(
    slot: Int,
    buffer: GPUBuffer? = null,
    offset: Long = 0,
    size: Long = Constants.WHOLE_SIZE
): Unit

Binds a vertex buffer to a specific slot.

Parameters
slot: Int

The vertex buffer slot index.

buffer: GPUBuffer? = null

The buffer to bind to the slot.

offset: Long = 0

The offset in the buffer to start reading vertex data.

size: Long = Constants.WHOLE_SIZE

The size of the vertex buffer range to use.

setViewport

Added in 1.0.0-alpha01
@FastNative
external fun setViewport(
    x: Float,
    y: Float,
    width: Float,
    height: Float,
    minDepth: Float,
    maxDepth: Float
): Unit

Sets the viewport region for the render pass.

Parameters
x: Float

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

y: Float

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

width: Float

The width of the viewport.

height: Float

The height of the viewport.

minDepth: Float

The minimum depth of the viewport.

maxDepth: Float

The maximum depth of the viewport.

Public properties

handle

Added in 1.0.0-alpha01
val handleLong