MDN self-hosted library · e01.org

GPUCanvasContext: unconfigure() method

WebGPU API

WebGPU API

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

unconfigure()

Parameters

None.

Return value

None (undefined).

Examples

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

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

// Later on
context.unconfigure();

Specifications

Browser compatibility

See also