Trilium Frontend API
    Preparing search index...

    Interface 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

    interface GPURenderPassEncoder {
        label: string;
        beginOcclusionQuery(queryIndex: number): void;
        draw(
            vertexCount: number,
            instanceCount?: number,
            firstVertex?: number,
            firstInstance?: number,
        ): void;
        drawIndexed(
            indexCount: number,
            instanceCount?: number,
            firstIndex?: number,
            baseVertex?: number,
            firstInstance?: number,
        ): void;
        drawIndexedIndirect(
            indirectBuffer: GPUBuffer,
            indirectOffset: number,
        ): void;
        drawIndirect(indirectBuffer: GPUBuffer, indirectOffset: number): void;
        end(): void;
        endOcclusionQuery(): void;
        executeBundles(bundles: GPURenderBundle[]): void;
        executeBundles(bundles: Iterable<GPURenderBundle>): void;
        insertDebugMarker(markerLabel: string): void;
        popDebugGroup(): void;
        pushDebugGroup(groupLabel: string): void;
        setBindGroup(
            index: number,
            bindGroup: GPUBindGroup,
            dynamicOffsets?: number[],
        ): void;
        setBindGroup(
            index: number,
            bindGroup: GPUBindGroup,
            dynamicOffsetsData: Uint32Array<ArrayBufferLike>,
            dynamicOffsetsDataStart: number,
            dynamicOffsetsDataLength: number,
        ): void;
        setBindGroup(
            index: number,
            bindGroup: GPUBindGroup,
            dynamicOffsets?: Iterable<number>,
        ): void;
        setBlendConstant(color: GPUColor): void;
        setBlendConstant(color: Iterable<number>): void;
        setIndexBuffer(
            buffer: GPUBuffer,
            indexFormat: GPUIndexFormat,
            offset?: number,
            size?: number,
        ): void;
        setPipeline(pipeline: GPURenderPipeline): void;
        setScissorRect(x: number, y: number, width: number, height: number): void;
        setStencilReference(reference: number): void;
        setVertexBuffer(
            slot: number,
            buffer: GPUBuffer,
            offset?: number,
            size?: number,
        ): void;
        setViewport(
            x: number,
            y: number,
            width: number,
            height: number,
            minDepth: number,
            maxDepth: number,
        ): void;
    }

    Hierarchy (View Summary)

    Index

    Properties

    label: string

    Methods

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

      MDN Reference

      Parameters

      • queryIndex: number

      Returns void

    • Parameters

      • vertexCount: number
      • OptionalinstanceCount: number
      • OptionalfirstVertex: number
      • OptionalfirstInstance: number

      Returns void

    • Parameters

      • indexCount: number
      • OptionalinstanceCount: number
      • OptionalfirstIndex: number
      • OptionalbaseVertex: number
      • OptionalfirstInstance: number

      Returns void

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

      MDN Reference

      Returns void

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

      MDN Reference

      Returns void

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

      MDN Reference

      Parameters

      Returns void

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

      MDN Reference

      Parameters

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

      MDN Reference

      Parameters

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

      MDN Reference

      Parameters

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

      MDN Reference

      Parameters

      • x: number
      • y: number
      • width: number
      • height: number

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

      MDN Reference

      Parameters

      • reference: number

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

      MDN Reference

      Parameters

      • x: number
      • y: number
      • width: number
      • height: number
      • minDepth: number
      • maxDepth: number

      Returns void