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.

MDN Reference

Properties

Link copied to clipboard

Functions

Link copied to clipboard

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).

Link copied to clipboard
open fun draw(vertexCount: GPUSize32, instanceCount: GPUSize32 = definedExternally, firstVertex: GPUSize32 = definedExternally, firstInstance: GPUSize32 = definedExternally)
Link copied to clipboard
open fun drawIndexed(indexCount: GPUSize32, instanceCount: GPUSize32 = definedExternally, firstIndex: GPUSize32 = definedExternally, baseVertex: GPUSignedOffset32 = definedExternally, firstInstance: GPUSize32 = definedExternally)
Link copied to clipboard
open fun drawIndexedIndirect(indirectBuffer: GPUBuffer, indirectOffset: GPUSize64)
Link copied to clipboard
open fun drawIndirect(indirectBuffer: GPUBuffer, indirectOffset: GPUSize64)
Link copied to clipboard
fun end()

The end() method of the GPURenderPassEncoder interface completes recording of the current render pass command sequence.

Link copied to clipboard

The endOcclusionQuery() method of the GPURenderPassEncoder interface ends an active occlusion query previously started with beginOcclusionQuery().

Link copied to clipboard

The executeBundles() method of the GPURenderPassEncoder interface executes commands previously recorded into the referenced GPURenderBundles, as part of this render pass.

Link copied to clipboard
open fun insertDebugMarker(markerLabel: String)
Link copied to clipboard
Link copied to clipboard
open fun pushDebugGroup(groupLabel: String)
Link copied to clipboard
open fun setBindGroup(index: GPUIndex32, bindGroup: GPUBindGroup?, dynamicOffsets: ReadonlyArray<GPUBufferDynamicOffset> = definedExternally)
open fun setBindGroup(index: GPUIndex32, bindGroup: GPUBindGroup?, dynamicOffsetsData: Uint32Array<ArrayBufferLike>, dynamicOffsetsDataStart: GPUSize64, dynamicOffsetsDataLength: GPUSize32)
Link copied to clipboard

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).

Link copied to clipboard
open fun setIndexBuffer(buffer: GPUBuffer, indexFormat: GPUIndexFormat, offset: GPUSize64 = definedExternally, size: GPUSize64 = definedExternally)
Link copied to clipboard
Link copied to clipboard

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.

Link copied to clipboard

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).

Link copied to clipboard
open fun setVertexBuffer(slot: GPUIndex32, buffer: GPUBuffer?, offset: GPUSize64 = definedExternally, size: GPUSize64 = definedExternally)
Link copied to clipboard

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.