GPUTexture: destroy() method
MDN Web Docs · نسخهٔ df622a2a1c1e · CC BY-SA 2.5 و مجوز جداگانهٔ ناشر برای نمونهکد
{{APIRef("WebGPU API")}}{{SecureContext_Header}}{{AvailableInWorkers}}
The **destroy()** method of the {{domxref("GPUTexture")}} interface destroys the GPUTexture.
Syntax
js-nolint
destroy()Parameters
None.
Return value
None ({{jsxref("undefined")}}).
Examples
js
// …
const depthTexture = device.createTexture({
size: [canvas.width, canvas.height],
format: "depth24plus",
usage: GPUTextureUsage.RENDER_ATTACHMENT,
});
// some time later
depthTexture.destroy();Specifications
{{Specifications}}
Browser compatibility
{{Compat}}
See also
- The WebGPU API