GPUCanvasContext: unconfigure() Methode
Limited availability
This feature is not Baseline because it does not work in some of the most widely-used browsers.
Sicherer Kontext: Diese Funktion ist nur in sicheren Kontexten (HTTPS) in einigen oder allen unterstützenden Browsern verfügbar.
Hinweis: Diese Funktion ist in Web Workers verfügbar.
Die unconfigure()
-Methode der GPUCanvasContext
-Schnittstelle entfernt jede zuvor festgelegte Kontextkonfiguration und zerstört alle Texturen, die über getCurrentTexture()
zurückgegeben wurden, während der Canvas-Kontext konfiguriert war.
Syntax
js
unconfigure()
Parameter
Keine.
Rückgabewert
Keiner (undefined
).
Beispiele
js
const canvas = document.querySelector("#gpuCanvas");
const context = canvas.getContext("webgpu");
context.configure({
device,
format: navigator.gpu.getPreferredCanvasFormat(),
alphaMode: "premultiplied",
});
// Later on
context.unconfigure();
Spezifikationen
Specification |
---|
WebGPU # dom-gpucanvascontext-unconfigure |
Browser-Kompatibilität
Siehe auch
- Die WebGPU API