GPUBuffer: destroy() method
MDN Web Docs · نسخهٔ df622a2a1c1e · CC BY-SA 2.5 و مجوز جداگانهٔ ناشر برای نمونهکد
{{APIRef("WebGPU API")}}{{SecureContext_Header}}{{AvailableInWorkers}}
The **destroy()** method of the {{domxref("GPUBuffer")}} interface destroys the GPUBuffer.
Syntax
js-nolint
destroy()Parameters
None.
Return value
None ({{jsxref("undefined")}}).
Examples
js
const output = device.createBuffer({
size: 1000,
usage: GPUBufferUsage.STORAGE | GPUBufferUsage.COPY_SRC,
});
// some time later
output.destroy();Specifications
{{Specifications}}
Browser compatibility
{{Compat}}
See also
- The WebGPU API