Interface GPURenderPassEncoder
__brand: "GPURenderPassEncoder";
label: string;
beginOcclusionQuery(queryIndex: number): undefined;
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;
end(): undefined;
endOcclusionQuery(): undefined;
executeBundles(bundles: Iterable<GPURenderBundle, any, any>): undefined;
insertDebugMarker(markerLabel: string): undefined;
popDebugGroup(): undefined;
pushDebugGroup(groupLabel: string): undefined;
setBindGroup(index: number, bindGroup: GPUBindGroup, dynamicOffsets?: Iterable<number, any, any>): undefined;
setBindGroup(index: number, bindGroup: GPUBindGroup, dynamicOffsetsData: Uint32Array, dynamicOffsetsDataStart: number, dynamicOffsetsDataLength: number): undefined;
setBlendConstant(color: GPUColor): undefined;
setIndexBuffer(buffer: GPUBuffer, indexFormat: GPUIndexFormat, offset?: number, size?: number): undefined;
setPipeline(pipeline: GPURenderPipeline): undefined;
setScissorRect(x: number, y: number, width: number, height: number): undefined;
setStencilReference(reference: number): undefined;
setVertexBuffer(slot: number, buffer: GPUBuffer, offset?: number, size?: number): undefined;
setViewport(x: number, y: number, width: number, height: number, minDepth: number, maxDepth: number): undefined;
}
Hierarchy
Index
Properties
Methods
Methods
beginOcclusionQuery
draw
- draw(vertexCount, instanceCount?, firstVertex?, firstInstance?): undefined
Draws primitives. See [[#rendering-operations]] for the detailed specification.
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
- draw
Indexed (indexCount, instanceCount?, firstIndex?, baseVertex?, firstInstance?): 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
- draw
Indexed (indirectBuffer, indirectOffset): undefinedIndirect 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
- draw
Indirect (indirectBuffer, indirectOffset): 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
end
endOcclusionQuery
executeBundles
- execute
Bundles (bundles): undefined Executes the commands previously recorded into the given GPURenderBundles as part of this render pass. When a GPURenderBundle is executed, it does not inherit the render pass's pipeline, bind groups, or vertex and index buffers. After a GPURenderBundle has executed, the render pass's pipeline, bind group, and vertex/index buffer state is cleared (to the initial, empty values). Note: The state is cleared, not restored to the previous state. This occurs even if zero GPURenderBundles are executed.
Parameters
- bundles: Iterable<GPURenderBundle, any, any>
List of render bundles to execute.
Returns undefined
- bundles: Iterable<GPURenderBundle, any, any>
insertDebugMarker
popDebugGroup
- pop
Debug (): undefinedGroup Ends the labeled debug group most recently started by GPUDebugCommandsMixin#pushDebugGroup.
Returns undefined
pushDebugGroup
setBindGroup
- set
Bind (index, bindGroup, dynamicOffsets?): undefinedGroup Sets the current GPUBindGroup for the given index.
Parameters
- index: number
The index to set the bind group at.
- bindGroup: GPUBindGroup
Bind group to use for subsequent render or compute commands. <!--The overload appears to be confusing bikeshed, and it ends up expecting this to define the arguments for the 5-arg variant of the method, despite the "for" explicitly pointing at the 3-arg variant. See
Optional
dynamicOffsets: Iterable<number, any, any>Array containing buffer offsets in bytes for each entry in
bindGroup
marked as GPUBindGroupLayoutEntry#buffer.GPUBufferBindingLayout#hasDynamicOffset.-->
Returns undefined
- index: number
- set
Bind (index, bindGroup, dynamicOffsetsData, dynamicOffsetsDataStart, dynamicOffsetsDataLength): undefinedGroup Sets the current GPUBindGroup for the given index, specifying dynamic offsets as a subset of a Uint32Array.
Parameters
- index: number
The index to set the bind group at.
- bindGroup: GPUBindGroup
Bind group to use for subsequent render or compute commands.
- dynamicOffsetsData: Uint32Array
Array containing buffer offsets in bytes for each entry in
bindGroup
marked as GPUBindGroupLayoutEntry#buffer.GPUBufferBindingLayout#hasDynamicOffset. - dynamicOffsetsDataStart: number
Offset in elements into
dynamicOffsetsData
where the buffer offset data begins. - dynamicOffsetsDataLength: number
Number of buffer offsets to read from
dynamicOffsetsData
.
Returns undefined
- index: number
setBlendConstant
- set
Blend (color): undefinedConstant Sets the constant blend color and alpha values used with GPUBlendFactor#"constant" and GPUBlendFactor#"one-minus-constant" GPUBlendFactors.
Parameters
- color: GPUColor
The color to use when blending.
Returns undefined
- color: GPUColor
setIndexBuffer
- set
Index (buffer, indexFormat, offset?, size?): undefinedBuffer 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
- set
Pipeline (pipeline): undefined Sets the current GPURenderPipeline.
Parameters
- pipeline: GPURenderPipeline
The render pipeline to use for subsequent drawing commands.
Returns undefined
- pipeline: GPURenderPipeline
setScissorRect
- set
Scissor (x, y, width, height): undefinedRect Sets the scissor rectangle used during the rasterization stage. After transformation into viewport coordinates any fragments which fall outside the scissor rectangle will be discarded.
Parameters
- x: number
Minimum X value of the scissor rectangle in pixels.
- y: number
Minimum Y value of the scissor rectangle in pixels.
- width: number
Width of the scissor rectangle in pixels.
- height: number
Height of the scissor rectangle in pixels.
Returns undefined
- x: number
setStencilReference
- set
Stencil (reference): undefinedReference Sets the RenderState#[[stencilReference]] value used during stencil tests with the GPUStencilOperation#"replace" GPUStencilOperation.
Parameters
- reference: number
The new stencil reference value.
Returns undefined
- reference: number
setVertexBuffer
- set
Vertex (slot, buffer, offset?, size?): undefinedBuffer 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
setViewport
- set
Viewport (x, y, width, height, minDepth, maxDepth): undefined Sets the viewport used during the rasterization stage to linearly map from NDC|normalized device coordinates to viewport coordinates.
Parameters
- x: number
Minimum X value of the viewport in pixels.
- y: number
Minimum Y value of the viewport in pixels.
- width: number
Width of the viewport in pixels.
- height: number
Height of the viewport in pixels.
- minDepth: number
Minimum depth value of the viewport.
- maxDepth: number
Maximum depth value of the viewport.
Returns undefined
- x: number
Nominal type branding. https://github.com/microsoft/TypeScript/pull/33038