-
Notifications
You must be signed in to change notification settings - Fork 45
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Docs: GetMappedRange relative addresses and alignments
- Loading branch information
Showing
4 changed files
with
22 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
# Buffer Mapping {#BufferMapping} | ||
|
||
## GetMappedRange/GetConstMappedRange Behavior {#GetMappedRangeBehavior} | ||
|
||
@ref wgpuGetMappedRange and @ref wgpuGetConstMappedRange: | ||
|
||
- Return `NULL` with @ref ImplementationDefinedLogging if: | ||
- There is any content-timeline error, as defined in the WebGPU specification for `getMappedRange()` (buffer is not mapped, alignment constraints, overlaps, etc.) | ||
- **Except** for overlaps between *const* ranges, which are allowed in C. | ||
(JS does not allow this because const ranges do not exist.) | ||
- @ref wgpuGetMappedRange 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. | ||
- Guarantee that the mapped pointer will be aligned to 16 bytes if the `MapAsync` and `GetMappedRange` offsets are also aligned to 16 bytes. | ||
|
||
More specifically: `GetMappedRange pointer` and `MapAsync offset + GetMappedRange offset` must be _congruent modulo_ `16`. | ||
|
||
- 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). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters