GPURenderPassEncoder
The GPURenderPassEncoder interface of the WebGPU API encodes commands related to controlling the vertex and fragment shader stages, as issued by a GPURenderPipeline. It forms part of the overall encoding activity of a GPUCommandEncoder.
Available only in secure contexts.
Extends
Methods
beginOcclusionQuery()
beginOcclusionQuery(queryIndex): void;
The beginOcclusionQuery() method of the GPURenderPassEncoder interface begins an occlusion query at the specified index of the relevant GPUQuerySet (provided as the value of the occlusionQuerySet descriptor property when invoking GPUCommandEncoder.beginRenderPass() to run the render pass).
Parameters
| Parameter | Type |
|---|---|
queryIndex | number |
Returns
void
draw()
draw(
vertexCount,
instanceCount?,
firstVertex?,
firstInstance?
): void;
Parameters
| Parameter | Type |
|---|---|
vertexCount | number |
instanceCount? | number |
firstVertex? | number |
firstInstance? | number |
Returns
void
Inherited from
drawIndexed()
drawIndexed(
indexCount,
instanceCount?,
firstIndex?,
baseVertex?,
firstInstance?
): void;
Parameters
| Parameter | Type |
|---|---|
indexCount | number |
instanceCount? | number |
firstIndex? | number |
baseVertex? | number |
firstInstance? | number |
Returns
void
Inherited from
GPURenderCommandsMixin.drawIndexed
drawIndexedIndirect()
drawIndexedIndirect(indirectBuffer, indirectOffset): void;
Parameters
| Parameter | Type |
|---|---|
indirectBuffer | GPUBuffer |
indirectOffset | number |
Returns
void
Inherited from
GPURenderCommandsMixin.drawIndexedIndirect
drawIndirect()
drawIndirect(indirectBuffer, indirectOffset): void;
Parameters
| Parameter | Type |
|---|---|
indirectBuffer | GPUBuffer |
indirectOffset | number |
Returns
void
Inherited from
GPURenderCommandsMixin.drawIndirect
end()
end(): void;
The end() method of the GPURenderPassEncoder interface completes recording of the current render pass command sequence.
Returns
void
endOcclusionQuery()
endOcclusionQuery(): void;
The endOcclusionQuery() method of the GPURenderPassEncoder interface ends an active occlusion query previously started with beginOcclusionQuery().
Returns
void
executeBundles()
Call Signature
executeBundles(bundles): void;
The executeBundles() method of the GPURenderPassEncoder interface executes commands previously recorded into the referenced GPURenderBundles, as part of this render pass.
Parameters
| Parameter | Type |
|---|---|
bundles | GPURenderBundle[] |
Returns
void
Call Signature
executeBundles(bundles): void;
The executeBundles() method of the GPURenderPassEncoder interface executes commands previously recorded into the referenced GPURenderBundles, as part of this render pass.
Parameters
| Parameter | Type |
|---|---|
bundles | Iterable<GPURenderBundle> |
Returns
void
insertDebugMarker()
insertDebugMarker(markerLabel): void;
Parameters
| Parameter | Type |
|---|---|
markerLabel | string |
Returns
void
Inherited from
GPUDebugCommandsMixin.insertDebugMarker
popDebugGroup()
popDebugGroup(): void;
Returns
void
Inherited from
GPUDebugCommandsMixin.popDebugGroup
pushDebugGroup()
pushDebugGroup(groupLabel): void;
Parameters
| Parameter | Type |
|---|---|
groupLabel | string |
Returns
void
Inherited from
GPUDebugCommandsMixin.pushDebugGroup
setBindGroup()
Call Signature
setBindGroup(
index,
bindGroup,
dynamicOffsets?
): void;
Parameters
| Parameter | Type |
|---|---|
index | number |
bindGroup | GPUBindGroup | null |
dynamicOffsets? | number[] |
Returns
void
Inherited from
GPUBindingCommandsMixin.setBindGroup
Call Signature
setBindGroup(
index,
bindGroup,
dynamicOffsetsData,
dynamicOffsetsDataStart,
dynamicOffsetsDataLength
): void;
Parameters
| Parameter | Type |
|---|---|
index | number |
bindGroup | GPUBindGroup | null |
dynamicOffsetsData | Uint32Array<ArrayBufferLike> |
dynamicOffsetsDataStart | number |
dynamicOffsetsDataLength | number |
Returns
void
Inherited from
GPUBindingCommandsMixin.setBindGroup
Call Signature
setBindGroup(
index,
bindGroup,
dynamicOffsets?
): void;
Parameters
| Parameter | Type |
|---|---|
index | number |
bindGroup | GPUBindGroup | null |
dynamicOffsets? | Iterable<number, any, any> |
Returns
void
Inherited from
GPUBindingCommandsMixin.setBindGroup
setBlendConstant()
Call Signature
setBlendConstant(color): void;
The setBlendConstant() method of the GPURenderPassEncoder interface sets the constant blend color and alpha values used with "constant" and "one-minus-constant" blend factors (as set in the descriptor of the GPUDevice.createRenderPipeline() method, in the blend property).
Parameters
| Parameter | Type |
|---|---|
color | GPUColor |
Returns
void
Call Signature
setBlendConstant(color): void;
The setBlendConstant() method of the GPURenderPassEncoder interface sets the constant blend color and alpha values used with "constant" and "one-minus-constant" blend factors (as set in the descriptor of the GPUDevice.createRenderPipeline() method, in the blend property).
Parameters
| Parameter | Type |
|---|---|
color | Iterable<number> |
Returns
void
setIndexBuffer()
setIndexBuffer(
buffer,
indexFormat,
offset?,
size?
): void;
Parameters
| Parameter | Type |
|---|---|
buffer | GPUBuffer |
indexFormat | GPUIndexFormat |
offset? | number |
size? | number |
Returns
void
Inherited from
GPURenderCommandsMixin.setIndexBuffer
setPipeline()
setPipeline(pipeline): void;
Parameters
| Parameter | Type |
|---|---|
pipeline | GPURenderPipeline |
Returns
void
Inherited from
GPURenderCommandsMixin.setPipeline
setScissorRect()
setScissorRect(
x,
y,
width,
height
): void;
The setScissorRect() method of the GPURenderPassEncoder interface sets the scissor rectangle used during the rasterization stage. After transformation into viewport coordinates any fragments that fall outside the scissor rectangle will be discarded.
Parameters
| Parameter | Type |
|---|---|
x | number |
y | number |
width | number |
height | number |
Returns
void
setStencilReference()
setStencilReference(reference): void;
The setStencilReference() method of the GPURenderPassEncoder interface sets the stencil reference value using during stencil tests with the "replace" stencil operation (as set in the descriptor of the GPUDevice.createRenderPipeline() method, in the properties defining the various stencil operations).
Parameters
| Parameter | Type |
|---|---|
reference | number |
Returns
void
setVertexBuffer()
setVertexBuffer(
slot,
buffer,
offset?,
size?
): void;
Parameters
| Parameter | Type |
|---|---|
slot | number |
buffer | GPUBuffer | null |
offset? | number |
size? | number |
Returns
void
Inherited from
GPURenderCommandsMixin.setVertexBuffer
setViewport()
setViewport(
x,
y,
width,
height,
minDepth,
maxDepth
): void;
The setViewport() method of the GPURenderPassEncoder interface sets the viewport used during the rasterization stage to linearly map from normalized device coordinates to viewport coordinates.
Parameters
| Parameter | Type |
|---|---|
x | number |
y | number |
width | number |
height | number |
minDepth | number |
maxDepth | number |
Returns
void
Properties
label
label: string;