Back to Content

GPUBuffer: destroy() method

files/en-us/web/api/gpubuffer/destroy/index.md

latest598 B
Original Source

{{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