Trilium Frontend API
    Preparing search index...

    Interface GPUDevice

    The GPUDevice interface of the WebGPU API represents a logical GPU device. This is the main interface through which the majority of WebGPU functionality is accessed. Available only in secure contexts.

    MDN Reference

    interface GPUDevice {
        adapterInfo: GPUAdapterInfo;
        features: GPUSupportedFeatures;
        label: string;
        limits: GPUSupportedLimits;
        lost: Promise<GPUDeviceLostInfo>;
        onuncapturederror: (this: GPUDevice, ev: GPUUncapturedErrorEvent) => any;
        queue: GPUQueue;
        addEventListener<K extends "uncapturederror">(
            type: K,
            listener: (this: GPUDevice, ev: GPUDeviceEventMap[K]) => any,
            options?: boolean | AddEventListenerOptions,
        ): void;
        addEventListener(
            type: string,
            listener: EventListenerOrEventListenerObject,
            options?: boolean | AddEventListenerOptions,
        ): void;
        createBindGroup(descriptor: GPUBindGroupDescriptor): GPUBindGroup;
        createBindGroupLayout(
            descriptor: GPUBindGroupLayoutDescriptor,
        ): GPUBindGroupLayout;
        createBuffer(descriptor: GPUBufferDescriptor): GPUBuffer;
        createCommandEncoder(
            descriptor?: GPUCommandEncoderDescriptor,
        ): GPUCommandEncoder;
        createComputePipeline(
            descriptor: GPUComputePipelineDescriptor,
        ): GPUComputePipeline;
        createComputePipelineAsync(
            descriptor: GPUComputePipelineDescriptor,
        ): Promise<GPUComputePipeline>;
        createPipelineLayout(
            descriptor: GPUPipelineLayoutDescriptor,
        ): GPUPipelineLayout;
        createQuerySet(descriptor: GPUQuerySetDescriptor): GPUQuerySet;
        createRenderBundleEncoder(
            descriptor: GPURenderBundleEncoderDescriptor,
        ): GPURenderBundleEncoder;
        createRenderPipeline(
            descriptor: GPURenderPipelineDescriptor,
        ): GPURenderPipeline;
        createRenderPipelineAsync(
            descriptor: GPURenderPipelineDescriptor,
        ): Promise<GPURenderPipeline>;
        createSampler(descriptor?: GPUSamplerDescriptor): GPUSampler;
        createShaderModule(descriptor: GPUShaderModuleDescriptor): GPUShaderModule;
        createTexture(descriptor: GPUTextureDescriptor): GPUTexture;
        destroy(): void;
        dispatchEvent(event: Event): boolean;
        importExternalTexture(
            descriptor: GPUExternalTextureDescriptor,
        ): GPUExternalTexture;
        popErrorScope(): Promise<GPUError>;
        pushErrorScope(filter: GPUErrorFilter): void;
        removeEventListener<K extends "uncapturederror">(
            type: K,
            listener: (this: GPUDevice, ev: GPUDeviceEventMap[K]) => any,
            options?: boolean | EventListenerOptions,
        ): void;
        removeEventListener(
            type: string,
            listener: EventListenerOrEventListenerObject,
            options?: boolean | EventListenerOptions,
        ): void;
    }

    Hierarchy (View Summary)

    Index

    Properties

    adapterInfo: GPUAdapterInfo

    The adapterInfo read-only property of the GPUDevice interface returns a GPUAdapterInfo object containing identifying information about the device's originating adapter.

    MDN Reference

    The features read-only property of the GPUDevice interface returns a GPUSupportedFeatures object that describes additional functionality supported by the device. Only features requested during the creation of the device (i.e., when GPUAdapter.requestDevice() is called) are included.

    MDN Reference

    label: string

    The limits read-only property of the GPUDevice interface returns a GPUSupportedLimits object that describes the limits supported by the device. All limit values will be included, and the limits requested during the creation of the device (i.e., when GPUAdapter.requestDevice() is called) will be reflected in those values.

    MDN Reference

    lost: Promise<GPUDeviceLostInfo>

    The lost read-only property of the GPUDevice interface contains a Promise that remains pending throughout the device's lifetime and resolves with a GPUDeviceLostInfo object when the device is lost.

    MDN Reference

    onuncapturederror: (this: GPUDevice, ev: GPUUncapturedErrorEvent) => any
    queue: GPUQueue

    The queue read-only property of the GPUDevice interface returns the primary GPUQueue for the device.

    MDN Reference

    Methods

    • The createBindGroup() method of the GPUDevice interface creates a GPUBindGroup based on a GPUBindGroupLayout that defines a set of resources to be bound together in a group and how those resources are used in shader stages.

      MDN Reference

      Parameters

      Returns GPUBindGroup

    • The createRenderPipelineAsync() method of the GPUDevice interface returns a Promise that fulfills with a GPURenderPipeline, which can control the vertex and fragment shader stages and be used in a GPURenderPassEncoder or GPURenderBundleEncoder, once the pipeline can be used without any stalling.

      MDN Reference

      Parameters

      Returns Promise<GPURenderPipeline>

    • The createTexture() method of the GPUDevice interface creates a GPUTexture in which to store 1D, 2D, or 3D arrays of data, such as images, to use in GPU rendering operations.

      MDN Reference

      Parameters

      Returns GPUTexture

    • The destroy() method of the GPUDevice interface destroys the device, preventing further operations on it.

      MDN Reference

      Returns void

    • The dispatchEvent() method of the EventTarget sends an Event to the object, (synchronously) invoking the affected event listeners in the appropriate order. The normal event processing rules (including the capturing and optional bubbling phase) also apply to events dispatched manually with dispatchEvent().

      MDN Reference

      Parameters

      • event: Event

      Returns boolean

    • The popErrorScope() method of the GPUDevice interface pops an existing GPU error scope from the error scope stack (originally pushed using GPUDevice.pushErrorScope()) and returns a Promise that resolves to an object describing the first error captured in the scope, or null if no error occurred.

      MDN Reference

      Returns Promise<GPUError>

    • The pushErrorScope() method of the GPUDevice interface pushes a new GPU error scope onto the device's error scope stack, allowing you to capture errors of a particular type.

      MDN Reference

      Parameters

      Returns void

    • The removeEventListener() method of the EventTarget interface removes an event listener previously registered with EventTarget.addEventListener() from the target. The event listener to be removed is identified using a combination of the event type, the event listener function itself, and various optional options that may affect the matching process; see Matching event listeners for removal.

      MDN Reference

      Type Parameters

      • K extends "uncapturederror"

      Parameters

      Returns void

    • The removeEventListener() method of the EventTarget interface removes an event listener previously registered with EventTarget.addEventListener() from the target. The event listener to be removed is identified using a combination of the event type, the event listener function itself, and various optional options that may affect the matching process; see Matching event listeners for removal.

      MDN Reference

      Parameters

      Returns void