GPUCanvasContext: unconfigure() method

Experimental: This is an experimental technology
Check the Browser compatibility table carefully before using this in production.

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.

Syntax

js

unconfigure()

Parameters

None.

Return value

None (undefined).

Examples

js

const canvas = document.querySelector("#gpuCanvas");
const context = canvas.getContext("webgpu");

context.configure({
  device: device,
  format: navigator.gpu.getPreferredCanvasFormat(),
  alphaMode: "premultiplied",
});

// Later on
context.unconfigure();

Specifications

Specification
WebGPU
# dom-gpucanvascontext-unconfigure

Browser compatibility

BCD tables only load in the browser

See also