Chartbreaker
    Preparing search index...

    Interface GPUCanvasContext

    The GPUCanvasContext interface of the WebGPU API represents the WebGPU rendering context of a element, returned via an HTMLCanvasElement.getContext() call with a contextType of "webgpu". Available only in secure contexts.

    MDN Reference

    interface GPUCanvasContext {
        canvas: HTMLCanvasElement | OffscreenCanvas;
        configure(configuration: GPUCanvasConfiguration): void;
        getConfiguration(): GPUCanvasConfiguration | null;
        getCurrentTexture(): GPUTexture;
        unconfigure(): void;
    }
    Index

    Properties

    The canvas read-only property of the GPUCanvasContext interface returns a reference to the canvas that the context was created from.

    MDN Reference

    Methods

    • The configure() method of the GPUCanvasContext interface configures the context to use for rendering with a given GPUDevice. When called the canvas will initially be cleared to transparent black.

      MDN Reference

      Parameters

      Returns void

    • The getCurrentTexture() method of the GPUCanvasContext interface returns the next GPUTexture to be composited to the document by the canvas context.

      MDN Reference

      Returns GPUTexture

    • The unconfigure() method of the GPUCanvasContext interface removes any previously-set context configuration, and destroys any textures returned via getCurrentTexture() while the canvas context was configured.

      MDN Reference

      Returns void