Documentation
    Preparing search index...

    Interface GpuDevice

    The device: everything the backend allocates and submits through.

    interface GpuDevice {
        features?: { has(name: string): boolean };
        limits?: Readonly<Record<string, number>>;
        lost?: Promise<GpuDeviceLostInfo>;
        queue: GpuQueue;
        createBindGroup(
            descriptor: {
                entries: readonly GpuBindGroupEntry[];
                label?: string;
                layout: object;
            },
        ): object;
        createBindGroupLayout(
            descriptor: {
                entries: readonly GpuBindGroupLayoutEntry[];
                label?: string;
            },
        ): object;
        createBuffer(descriptor: GpuBufferDescriptor): GpuBuffer;
        createCommandEncoder(descriptor?: { label?: string }): GpuCommandEncoder;
        createComputePipeline?(descriptor: GpuComputePipelineDescriptor): object;
        createPipelineLayout(
            descriptor: { bindGroupLayouts: readonly object[]; label?: string },
        ): object;
        createQuerySet?(
            descriptor: { count: number; type: "occlusion" | "timestamp" },
        ): GpuQuerySet;
        createRenderPipeline(descriptor: GpuRenderPipelineDescriptor): object;
        createSampler(descriptor: GpuSamplerDescriptor): object;
        createShaderModule(descriptor: { code: string; label?: string }): object;
        createTexture(descriptor: GpuTextureDescriptor): GpuTexture;
        destroy(): void;
    }
    Index
    features?: { has(name: string): boolean }

    The device's optional features; has is the §62 query.

    limits?: Readonly<Record<string, number>>

    The device's limits, by their WebGPU names. Optional because a double need not carry them — an absent limit is reported as "not reported" rather than guessed (renderer.ts's tri-state).

    lost?: Promise<GpuDeviceLostInfo>

    Resolves when the device is lost (§61's first-class loss event). Optional so that a double may omit it; the renderer subscribes only when present.

    queue: GpuQueue

    The submission queue.

    • Binds resources against a layout.

      Parameters

      • descriptor: { entries: readonly GpuBindGroupEntry[]; label?: string; layout: object }

      Returns object

    • Declares a bind-group layout (§7's "layouts as data").

      Parameters

      Returns object

    • Opens a command encoder.

      Parameters

      • Optionaldescriptor: { label?: string }

      Returns GpuCommandEncoder

    • Creates an immutable compute pipeline (§82, WP-R1.8). Optional — presence is the capability, and it is the one member compute() gates on before recording anything (wgpu-compute.ts).

      Parameters

      Returns object

    • Composes bind-group layouts into a pipeline layout.

      Parameters

      • descriptor: { bindGroupLayouts: readonly object[]; label?: string }

      Returns object

    • Allocates a query set (A-1). Optional — presence is the capability, and only the GPU-frame timer calls it. A double written before this packet still satisfies the device.

      Parameters

      • descriptor: { count: number; type: "occlusion" | "timestamp" }

      Returns GpuQuerySet

    • Creates an immutable render pipeline (lazily — see wgpu-pipeline-cache.ts).

      Parameters

      Returns object

    • Creates a sampler — §77's filter and wrap state as an object.

      Parameters

      Returns object

    • Compiles a WGSL module.

      Parameters

      • descriptor: { code: string; label?: string }

      Returns object

    • Releases the device (§83).

      Returns void