You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* Add Read/WriteMappedRange, and disallow ALL map overlaps
* performance docs
* Partial revert so that overlaps are unvalidated in native
* WriteMappedRange const pointer
* clarify that WGPU_WHOLE_MAP_SIZE is not used here
* fix lint
The @ref wgpuBufferGetMappedRange, @ref wgpuBufferGetConstMappedRange, @ref wgpuBufferReadMappedRange, and @refwgpuBufferWriteMappedRange methods:
6
6
7
-
-Return `NULL` with @ref ImplementationDefinedLogging if:
8
-
- There is any content-timeline error, as defined in the WebGPU specification for `getMappedRange()` (buffer is not mapped, alignment constraints, overlaps, etc.)
7
+
-Fail (return `NULL` or `WGPUStatus_Error`) with @ref ImplementationDefinedLogging if:
8
+
- There is any content-timeline error, as defined in the WebGPU specification for `getMappedRange()`, given the same buffer, offset, and size (buffer is not mapped, alignment constraints, overlaps, etc.)
9
9
- **Except** for overlaps between *const* ranges, which are allowed in C *in non-Wasm targets only*.
10
-
(Wasm does not allow this because const ranges do not exist in JS.)
11
-
-@ref wgpuBufferGetMappedRange is called, but the buffer is not mapped with @ref WGPUMapMode_Write.
10
+
(Wasm does not allow this because const ranges do not exist in JS.
11
+
All of these calls are implemented on top of `getMappedRange()`.)
12
+
-@ref wgpuBufferGetMappedRange or @ref wgpuBufferWriteMappedRange is called, but the buffer is not mapped with @ref WGPUMapMode_Write.
- Do not guarantee they will return any particular address value relative to another GetMappedRange call.
13
17
- Guarantee that the mapped pointer will be aligned to 16 bytes if the `MapAsync` and `GetMappedRange` offsets are also aligned to 16 bytes.
14
18
15
19
More specifically: `GetMappedRange pointer` and `MapAsync offset + GetMappedRange offset` must be _congruent modulo_`16`.
16
20
17
-
- Implementations **should** try to guarantee better alignments (as large as 256 bytes) if possible without significant runtime overhead (e.g. allocating new memory and copying data).
21
+
- Implementations **should** try to guarantee better alignments (as large as 256 bytes), if they can do so without significant runtime overhead (i.e. without allocating new memory and copying data).
0 commit comments