GPURenderPassEncoder


class GPURenderPassEncoder : AutoCloseable


An object used to record commands for a render pass.

Summary

Public functions

external Unit

Begins an occlusion query.

open external Unit

Decrements the reference count of the object and frees resources when the count reaches zero.

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

Draws non-indexed primitives.

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

Draws indexed primitives.

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

Draws indexed primitives with parameters from a buffer.

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

Draws non-indexed primitives with parameters from a buffer.

external Unit

Ends the render pass.

external Unit

Ends an occlusion query.

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

Executes a list of render bundles.

open Int
external Unit

Inserts a debug marker into the command stream.

external Unit

Pops the current debug group.

external Unit

Pushes a new debug group.

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

Sets a bind group for the pipeline.

external Unit

Sets the blend constant color.

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

Sets the index buffer.

external Unit

Sets a human-readable label for debugging.

external Unit

Sets the current render pipeline.

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

Sets the scissor rectangle.

external Unit

Sets the stencil reference value.

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

Sets a vertex buffer for a specific slot.

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

Sets the viewport rectangle.

Public properties

Long

Public functions

beginOcclusionQuery

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

Begins an occlusion query.

Parameters
queryIndex: Int

The index of the query in the query set.

close

Added in 1.0.0-alpha04
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

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

Draws non-indexed primitives.

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-alpha04
@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

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

Draws indexed primitives with parameters from a buffer.

Parameters
indirectBuffer: GPUBuffer

The buffer containing the draw parameters.

indirectOffset: Long

The offset in the indirect buffer.

drawIndirect

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

Draws non-indexed primitives with parameters from a buffer.

Parameters
indirectBuffer: GPUBuffer

The buffer containing the draw parameters.

indirectOffset: Long

The offset in the indirect buffer.

end

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

Ends the render pass.

endOcclusionQuery

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

Ends an occlusion query.

equals

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

executeBundles

Added in 1.0.0-alpha04
@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.

hashCode

open fun hashCode(): Int

insertDebugMarker

Added in 1.0.0-alpha04
@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

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

Pops the current debug group.

pushDebugGroup

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

Pushes a new debug group.

Parameters
groupLabel: String

The label for the debug group.

setBindGroup

Added in 1.0.0-alpha04
@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

Added in 1.0.0-alpha04
@FastNative
external fun setBlendConstant(color: GPUColor): Unit

Sets the blend constant color.

Parameters
color: GPUColor

The RGBA blend constant.

setIndexBuffer

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

Sets the index buffer.

Parameters
buffer: GPUBuffer

The index buffer.

format: Int = IndexFormat.Undefined

The format of the indices.

offset: Long = 0

The offset in the index buffer.

size: Long = Constants.WHOLE_SIZE

The size of the index data to use.

setLabel

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

Sets a human-readable label for debugging.

Parameters
label: String

The label string.

setPipeline

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

Sets the current render pipeline.

Parameters
pipeline: GPURenderPipeline

The render pipeline to set.

setScissorRect

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

Sets the scissor rectangle.

Parameters
x: Int

The x-coordinate of the scissor rectangle.

y: Int

The y-coordinate 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-alpha04
@FastNative
external fun setStencilReference(reference: Int): Unit

Sets the stencil reference value.

Parameters
reference: Int

The stencil reference value.

setVertexBuffer

Added in 1.0.0-alpha04
@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.

Parameters
slot: Int

The vertex buffer slot.

buffer: GPUBuffer? = null

The vertex buffer.

offset: Long = 0

The offset in the vertex buffer.

size: Long = Constants.WHOLE_SIZE

The size of the vertex data to use.

setViewport

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

Sets the viewport rectangle.

Parameters
x: Float

The x-coordinate of the viewport.

y: Float

The y-coordinate 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-alpha04
val handleLong