GPUBuffer: unmap() method
MDN Web Docs · نسخهٔ df622a2a1c1e · CC BY-SA 2.5 و مجوز جداگانهٔ ناشر برای نمونهکد
{{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](/en-US/docs/Web/API/GPUBuffer#examples) for an example.
Specifications
{{Specifications}}
Browser compatibility
{{Compat}}
See also
- The WebGPU API