sprunk-engine
    Preparing search index...

    Interface for a Renderer component responsible for managing WebGPU resources.

    interface WebGPUResourceDelegate {
        onError: Event<Error>;
        get presentationTextureFormat(): GPUTextureFormat;
        createBindGroup(
            bindGroupLayout: GPUBindGroupLayout,
            entries: GPUBindGroupEntry[],
        ): GPUBindGroup;
        createBindGroupLayout(
            descriptor: GPUBindGroupLayoutDescriptor,
        ): GPUBindGroupLayout;
        createIndexBuffer(data: Uint16Array): GPUBuffer;
        createPipeline(
            vertexWGSLShader: string,
            fragmentWGSLShader: string,
            primitiveState: GPUPrimitiveState,
            bindGroupLayouts: Iterable<null | GPUBindGroupLayout>,
            buffers?: Iterable<null | GPUVertexBufferLayout, any, any>,
            targetBlend?: GPUBlendState,
        ): Promise<GPURenderPipeline>;
        createRenderBundleEncoder(
            descriptor: GPURenderBundleEncoderDescriptor,
        ): GPURenderBundleEncoder;
        createSampler(descriptor: GPUSamplerDescriptor): GPUSampler;
        createStorageBuffer(size: number, label?: string): GPUBuffer;
        createTexture(url: RequestInfo | URL): Promise<GPUTexture>;
        createUniformBuffer(data: Float32Array): GPUBuffer;
        createVertexBuffer(data: Float32Array): GPUBuffer;
        fillUniformBuffer(buffer: GPUBuffer, data: Float32Array): void;
    }

    Hierarchy (View Summary)

    Implemented by

    Index

    Properties

    onError: Event<Error>

    Event that is triggered when an asynchronous error occurs.

    Accessors

    Methods

    • Creates a bind group.

      Parameters

      • bindGroupLayout: GPUBindGroupLayout

        The bind group layout to use.

      • entries: GPUBindGroupEntry[]

        The entries for the bind group.

      Returns GPUBindGroup

      The created bind group.

    • Creates a render pipeline asynchronously.

      Parameters

      • vertexWGSLShader: string

        The vertex shader code in WGSL.

      • fragmentWGSLShader: string

        The fragment shader code in WGSL.

      • primitiveState: GPUPrimitiveState

        The primitive state configuration.

      • bindGroupLayouts: Iterable<null | GPUBindGroupLayout>

        The bind group layouts for the pipeline.

      • Optionalbuffers: Iterable<null | GPUVertexBufferLayout, any, any>

        The vertex buffer layouts (optional).

      • OptionaltargetBlend: GPUBlendState

        The blend state for the pipeline (optional).

      Returns Promise<GPURenderPipeline>

      The created render pipeline.