wesl
    Preparing search index...

    Interface WeslDevice

    A GPUDevice with extensions for WESL. Created with makeWeslDevice. Used to make error reporting point at the orignal WESL sources.

    interface WeslDevice {
        __brand: "GPUDevice";
        adapterInfo: GPUAdapterInfo;
        features: GPUSupportedFeatures;
        label: string;
        limits: GPUSupportedLimits;
        lost: Promise<GPUDeviceLostInfo>;
        onuncapturederror:
            | null
            | ((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?: GPUObjectDescriptorBase,
        ): 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(): undefined;
        dispatchEvent(event: Event): boolean;
        importExternalTexture(
            descriptor: GPUExternalTextureDescriptor,
        ): GPUExternalTexture;
        injectError(type: GPUErrorFilter, error: Promise<null | GPUError>): void;
        popErrorScope(): Promise<null | GPUError>;
        pushErrorScope(filter: GPUErrorFilter): undefined;
        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

    • GPUDevice
      • WeslDevice
    Index

    Properties

    __brand: "GPUDevice"
    adapterInfo: GPUAdapterInfo

    Information about the physical adapter which created the device that this GPUDevice refers to. For a given GPUDevice, the GPUAdapterInfo values exposed are constant over time.

    features: GPUSupportedFeatures

    A set containing the GPUFeatureName values of the features supported by the device (i.e. the ones with which it was created).

    label: string
    limits: GPUSupportedLimits

    Exposes the limits supported by the device (which are exactly the ones with which it was created).

    lost: Promise<GPUDeviceLostInfo>

    A slot-backed attribute holding a promise which is created with the device, remains pending for the lifetime of the device, then resolves when the device is lost. Upon initialization, it is set to a new promise.

    onuncapturederror:
        | null
        | ((this: GPUDevice, ev: GPUUncapturedErrorEvent) => any)

    An event handler IDL attribute for the GPUDevice#uncapturederror event type.

    queue: GPUQueue

    The primary GPUQueue for this device.

    Methods

    • Appends an event listener for events whose type attribute value is type. The callback argument sets the callback that will be invoked when the event is dispatched.

      The options argument sets listener-specific options. For compatibility this can be a boolean, in which case the method behaves exactly as if the value was specified as options's capture.

      When set to true, options's capture prevents callback from being invoked when the event's eventPhase attribute value is BUBBLING_PHASE. When false (or not present), callback will not be invoked when event's eventPhase attribute value is CAPTURING_PHASE. Either way, callback will be invoked if event's eventPhase attribute value is AT_TARGET.

      When set to true, options's passive indicates that the callback will not cancel the event by invoking preventDefault(). This is used to enable performance optimizations described in § 2.8 Observing event listeners.

      When set to true, options's once indicates that the callback will only be invoked once after which the event listener will be removed.

      If an AbortSignal is passed for options's signal, then the event listener will be removed when signal is aborted.

      The event listener is appended to target's event listener list and is not appended if it has the same type, callback, and capture.

      MDN Reference

      Type Parameters

      • K extends "uncapturederror"

      Parameters

      • type: K
      • listener: (this: GPUDevice, ev: __GPUDeviceEventMap[K]) => any
      • Optionaloptions: boolean | AddEventListenerOptions

      Returns void

    • Appends an event listener for events whose type attribute value is type. The callback argument sets the callback that will be invoked when the event is dispatched.

      The options argument sets listener-specific options. For compatibility this can be a boolean, in which case the method behaves exactly as if the value was specified as options's capture.

      When set to true, options's capture prevents callback from being invoked when the event's eventPhase attribute value is BUBBLING_PHASE. When false (or not present), callback will not be invoked when event's eventPhase attribute value is CAPTURING_PHASE. Either way, callback will be invoked if event's eventPhase attribute value is AT_TARGET.

      When set to true, options's passive indicates that the callback will not cancel the event by invoking preventDefault(). This is used to enable performance optimizations described in § 2.8 Observing event listeners.

      When set to true, options's once indicates that the callback will only be invoked once after which the event listener will be removed.

      If an AbortSignal is passed for options's signal, then the event listener will be removed when signal is aborted.

      The event listener is appended to target's event listener list and is not appended if it has the same type, callback, and capture.

      MDN Reference

      Parameters

      • type: string
      • listener: EventListenerOrEventListenerObject
      • Optionaloptions: boolean | AddEventListenerOptions

      Returns void

    • Creates a GPUBindGroup.

      Parameters

      • descriptor: GPUBindGroupDescriptor

        Description of the GPUBindGroup to create.

      Returns GPUBindGroup

    • Creates a GPUBindGroupLayout.

      Parameters

      • descriptor: GPUBindGroupLayoutDescriptor

        Description of the GPUBindGroupLayout to create.

      Returns GPUBindGroupLayout

    • Creates a GPUBuffer.

      Parameters

      • descriptor: GPUBufferDescriptor

        Description of the GPUBuffer to create.

      Returns GPUBuffer

    • Creates a GPUCommandEncoder.

      Parameters

      • Optionaldescriptor: GPUObjectDescriptorBase

        Description of the GPUCommandEncoder to create.

      Returns GPUCommandEncoder

    • Creates a GPUComputePipeline using immediate pipeline creation.

      Parameters

      • descriptor: GPUComputePipelineDescriptor

        Description of the GPUComputePipeline to create.

      Returns GPUComputePipeline

    • Creates a GPUComputePipeline using async pipeline creation. The returned Promise resolves when the created pipeline is ready to be used without additional delay. If pipeline creation fails, the returned Promise rejects with an GPUPipelineError. (A GPUError is not dispatched to the device.) Note: Use of this method is preferred whenever possible, as it prevents blocking the queue timeline work on pipeline compilation.

      Parameters

      • descriptor: GPUComputePipelineDescriptor

        Description of the GPUComputePipeline to create.

      Returns Promise<GPUComputePipeline>

    • Creates a GPUPipelineLayout.

      Parameters

      • descriptor: GPUPipelineLayoutDescriptor

        Description of the GPUPipelineLayout to create.

      Returns GPUPipelineLayout

    • Creates a GPUQuerySet.

      Parameters

      • descriptor: GPUQuerySetDescriptor

        Description of the GPUQuerySet to create.

      Returns GPUQuerySet

    • Creates a GPURenderBundleEncoder.

      Parameters

      • descriptor: GPURenderBundleEncoderDescriptor

        Description of the GPURenderBundleEncoder to create.

      Returns GPURenderBundleEncoder

    • Creates a GPURenderPipeline using immediate pipeline creation.

      Parameters

      • descriptor: GPURenderPipelineDescriptor

        Description of the GPURenderPipeline to create.

      Returns GPURenderPipeline

    • Creates a GPURenderPipeline using async pipeline creation. The returned Promise resolves when the created pipeline is ready to be used without additional delay. If pipeline creation fails, the returned Promise rejects with an GPUPipelineError. (A GPUError is not dispatched to the device.) Note: Use of this method is preferred whenever possible, as it prevents blocking the queue timeline work on pipeline compilation.

      Parameters

      • descriptor: GPURenderPipelineDescriptor

        Description of the GPURenderPipeline to create.

      Returns Promise<GPURenderPipeline>

    • Creates a GPUSampler.

      Parameters

      • Optionaldescriptor: GPUSamplerDescriptor

        Description of the GPUSampler to create.

      Returns GPUSampler

    • Creates a GPUShaderModule.

      Parameters

      • descriptor: GPUShaderModuleDescriptor

        Description of the GPUShaderModule to create.

      Returns GPUShaderModule

    • Creates a GPUTexture.

      Parameters

      • descriptor: GPUTextureDescriptor

        Description of the GPUTexture to create.

      Returns GPUTexture

    • Destroys the device, preventing further operations on it. Outstanding asynchronous operations will fail. Note: It is valid to destroy a device multiple times. Note: Since no further operations can be enqueued on this device, implementations can abort outstanding asynchronous operations immediately and free resource allocations, including mapped memory that was just unmapped.

      Returns undefined

    • Dispatches a synthetic event event to target and returns true if either event's cancelable attribute value is false or its preventDefault() method was not invoked, and false otherwise.

      MDN Reference

      Parameters

      • event: Event

      Returns boolean

    • Creates a GPUExternalTexture wrapping the provided image source.

      Parameters

      • descriptor: GPUExternalTextureDescriptor

        Provides the external image source object (and any creation options).

      Returns GPUExternalTexture

    • Attaches an error to the current error scope (created by GPUDevice.pushErrorScope). If there is no error scope, it reports the error as a 'uncapturederror'

      Parameters

      • type: GPUErrorFilter
      • error: Promise<null | GPUError>

      Returns void

    • Pops a GPU error scope off the GPUDevice#[[errorScopeStack]] for this and resolves to any GPUError observed by the error scope, or null if none. There is no guarantee of the ordering of promise resolution.

      Returns Promise<null | GPUError>

    • Pushes a new GPU error scope onto the GPUDevice#[[errorScopeStack]] for this.

      Parameters

      • filter: GPUErrorFilter

        Which class of errors this error scope observes.

      Returns undefined

    • Removes the event listener in target's event listener list with the same type, callback, and options.

      MDN Reference

      Type Parameters

      • K extends "uncapturederror"

      Parameters

      • type: K
      • listener: (this: GPUDevice, ev: __GPUDeviceEventMap[K]) => any
      • Optionaloptions: boolean | EventListenerOptions

      Returns void

    • Removes the event listener in target's event listener list with the same type, callback, and options.

      MDN Reference

      Parameters

      • type: string
      • listener: EventListenerOrEventListenerObject
      • Optionaloptions: boolean | EventListenerOptions

      Returns void