Interface GPURenderBundleEncoder

    interface GPURenderBundleEncoder {
        __brand: "GPURenderBundleEncoder";
        label: string;
        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;
        finish(descriptor?: GPUObjectDescriptorBase): GPURenderBundle;
        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;
        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

    Properties

    __brand: "GPURenderBundleEncoder"
    label: string

    Methods

    • Draws primitives. See [[#rendering-operations]] for the detailed specification.

      Parameters

      • vertexCount: number

        The number of vertices to draw.

      • OptionalinstanceCount: number

        The number of instances to draw.

      • OptionalfirstVertex: number

        Offset into the vertex buffers, in vertices, to begin drawing from.

      • OptionalfirstInstance: number

        First instance to draw.

      Returns undefined

    • Draws indexed primitives. See [[#rendering-operations]] for the detailed specification.

      Parameters

      • indexCount: number

        The number of indices to draw.

      • OptionalinstanceCount: number

        The number of instances to draw.

      • OptionalfirstIndex: number

        Offset into the index buffer, in indices, begin drawing from.

      • OptionalbaseVertex: number

        Added to each index value before indexing into the vertex buffers.

      • OptionalfirstInstance: number

        First instance to draw.

      Returns 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

    • 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

    • Marks a point in a stream of commands with a label.

      Parameters

      • markerLabel: string

        The label to insert.

      Returns undefined

    • Begins a labeled debug group containing subsequent commands.

      Parameters

      • groupLabel: string

        The label for the command group.

      Returns undefined

    • 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

      • OptionaldynamicOffsets: Iterable<number, any, any>

        Array containing buffer offsets in bytes for each entry in bindGroup marked as GPUBindGroupLayoutEntry#buffer.GPUBufferBindingLayout#hasDynamicOffset.-->

      Returns undefined

    • 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

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

      • Optionaloffset: number

        Offset in bytes into buffer where the index data begins. Defaults to 0.

      • Optionalsize: number

        Size in bytes of the index data in buffer. Defaults to the size of the buffer minus the offset.

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

      • Optionaloffset: number

        Offset in bytes into buffer where the vertex data begins. Defaults to 0.

      • Optionalsize: number

        Size in bytes of the vertex data in buffer. Defaults to the size of the buffer minus the offset.

      Returns undefined