Back to Content

GPUBuffer: unmap() method

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

latest841 B
Original Source

{{APIRef("WebGPU API")}}{{SecureContext_Header}}{{AvailableInWorkers}}

The unmap() method of the {{domxref("GPUBuffer")}} interface unmaps the mapped range of the GPUBuffer, making its contents available for use by the GPU again after it has previously been mapped with {{domxref("GPUBuffer.mapAsync()")}} (the GPU cannot access a mapped GPUBuffer).

When unmap() is called, any {{jsxref("ArrayBuffer")}}s created via {{domxref("GPUBuffer.getMappedRange()")}} are detached.

Syntax

js-nolint
unmap()

Parameters

None.

Return value

None ({{jsxref("Undefined")}}).

Examples

See the main GPUBuffer page for an example.

Specifications

{{Specifications}}

Browser compatibility

{{Compat}}

See also