Interface GPURenderCommandsMixin
draw(
vertexCount: number,
instanceCount?: number,
firstVertex?: number,
firstInstance?: number,
): undefined;
drawIndexed(
indexCount: number,
instanceCount?: number,
firstIndex?: number,
baseVertex?: number,
firstInstance?: number,
): undefined;
drawIndexedIndirect(
indirectBuffer: GPUBuffer,
indirectOffset: number,
): undefined;
drawIndirect(indirectBuffer: GPUBuffer, indirectOffset: number): undefined;
setIndexBuffer(
buffer: GPUBuffer,
indexFormat: GPUIndexFormat,
offset?: number,
size?: number,
): undefined;
setPipeline(pipeline: GPURenderPipeline): undefined;
setVertexBuffer(
slot: number,
buffer: GPUBuffer,
offset?: number,
size?: number,
): undefined;
}
Hierarchy
- GPURenderCommandsMixin (View Summary)
Methods
draw
- draw(
vertexCount: number,
instanceCount?: number,
firstVertex?: number,
firstInstance?: number,
): undefined Parameters
- vertexCount: number
The number of vertices to draw.
Optional
instanceCount: numberThe number of instances to draw.
Optional
firstVertex: numberOffset into the vertex buffers, in vertices, to begin drawing from.
Optional
firstInstance: numberFirst instance to draw.
Returns undefined
- vertexCount: number
drawIndexed
- drawIndexed(
indexCount: number,
instanceCount?: number,
firstIndex?: number,
baseVertex?: number,
firstInstance?: number,
): undefined Draws indexed primitives. See [[#rendering-operations]] for the detailed specification.
Parameters
- indexCount: number
The number of indices to draw.
Optional
instanceCount: numberThe number of instances to draw.
Optional
firstIndex: numberOffset into the index buffer, in indices, begin drawing from.
Optional
baseVertex: numberAdded to each index value before indexing into the vertex buffers.
Optional
firstInstance: numberFirst instance to draw.
Returns undefined
- indexCount: number
drawIndexedIndirect
- drawIndexedIndirect(
indirectBuffer: GPUBuffer,
indirectOffset: number,
): undefined Draws indexed primitives using parameters read from a GPUBuffer. See [[#rendering-operations]] for the detailed specification. tightly packed block of five 32-bit unsigned integer values (20 bytes total), given in the same order as the arguments for GPURenderEncoderBase#drawIndexed. For example:
Parameters
- indirectBuffer: GPUBuffer
Buffer containing the indirect drawIndexed parameters.
- indirectOffset: number
Offset in bytes into
indirectBuffer
where the drawing data begins.
Returns undefined
- indirectBuffer: GPUBuffer
drawIndirect
- drawIndirect(indirectBuffer: GPUBuffer, indirectOffset: number): undefined
Draws primitives using parameters read from a GPUBuffer. See [[#rendering-operations]] for the detailed specification. packed block of four 32-bit unsigned integer values (16 bytes total), given in the same order as the arguments for GPURenderEncoderBase#draw. For example:
Parameters
- indirectBuffer: GPUBuffer
Buffer containing the indirect draw parameters.
- indirectOffset: number
Offset in bytes into
indirectBuffer
where the drawing data begins.
Returns undefined
- indirectBuffer: GPUBuffer
setIndexBuffer
- setIndexBuffer(
buffer: GPUBuffer,
indexFormat: GPUIndexFormat,
offset?: number,
size?: number,
): undefined Sets the current index buffer.
Parameters
- buffer: GPUBuffer
Buffer containing index data to use for subsequent drawing commands.
- indexFormat: GPUIndexFormat
Format of the index data contained in
buffer
. Optional
offset: numberOffset in bytes into
buffer
where the index data begins. Defaults to0
.Optional
size: numberSize in bytes of the index data in
buffer
. Defaults to the size of the buffer minus the offset.
Returns undefined
- buffer: GPUBuffer
setPipeline
- setPipeline(pipeline: GPURenderPipeline): undefined
Sets the current GPURenderPipeline.
Parameters
- pipeline: GPURenderPipeline
The render pipeline to use for subsequent drawing commands.
Returns undefined
- pipeline: GPURenderPipeline
setVertexBuffer
- setVertexBuffer(
slot: number,
buffer: GPUBuffer,
offset?: number,
size?: number,
): undefined Sets the current vertex buffer for the given slot.
Parameters
- slot: number
The vertex buffer slot to set the vertex buffer for.
- buffer: GPUBuffer
Buffer containing vertex data to use for subsequent drawing commands.
Optional
offset: numberOffset in bytes into
buffer
where the vertex data begins. Defaults to0
.Optional
size: numberSize in bytes of the vertex data in
buffer
. Defaults to the size of the buffer minus the offset.
Returns undefined
- slot: number
Draws primitives. See [[#rendering-operations]] for the detailed specification.