-
Notifications
You must be signed in to change notification settings - Fork 476
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add a new extension: VK_EXT_map_memory_placed
- Loading branch information
Showing
6 changed files
with
486 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,61 @@ | ||
// Copyright 2022-2023 The Khronos Group Inc. | ||
// | ||
// SPDX-License-Identifier: CC-BY-4.0 | ||
|
||
include::{generated}/meta/{refprefix}VK_EXT_map_memory_placed.adoc[] | ||
|
||
=== Other Extension Metadata | ||
|
||
*Last Modified Date*:: | ||
2023-03-21 | ||
*IP Status*:: | ||
No known IP claims. | ||
*Interactions and External Dependencies*:: | ||
- Depends on apitext:VK_KHR_map_memory2 | ||
- Interacts with apitext:VK_EXT_external_memory_host | ||
*Contributors*:: | ||
- Faith Ekstrand, Collabora | ||
- Tobias Hector, AMD | ||
- James Jones, NVIDIA | ||
- Georg Lehmann, Valve | ||
- Derek Lesho, Codeweavers | ||
|
||
=== Description | ||
|
||
This extension allows a client to request that flink:vkMapMemory2KHR | ||
attempt to place the memory map at a particular virtual address. | ||
|
||
include::{generated}/interfaces/VK_EXT_map_memory_placed.adoc[] | ||
|
||
=== Issues | ||
|
||
1) What should happen if the implementation cannot place the memory map at | ||
the requested address? | ||
|
||
*RESOLVED*: The memory object should be left unmapped and | ||
flink:vkMapMemory2KHR should return ename:VK_ERROR_MEMORY_MAP_FAILED. | ||
|
||
2) How can a client atomically re-reserve the address range on unmap? | ||
|
||
*RESOLVED*: When `VK_MEMORY_UNMAP_RESERVE_BIT_EXT` is passed to | ||
`vkUnmapMemory2KHR()`, the implementation unmaps the memory range in such a | ||
way that the range is automatically re-reserved. With `mmap()`, this is | ||
accomplished by simply mapping over the range with another anonymous | ||
mapping. However, allowing this with `vkMapMemory()` would break Vulkan's | ||
concept of when a memory object is or is not mapped. | ||
|
||
3) Should a placed memory map replace existing maps in the specified | ||
range or fail if a map exists? | ||
|
||
*RESOLVED*: It should replace existing maps. The client can get try | ||
behavior by using mmap with `MAP_ANONYMOUS` and an address and only call | ||
`vkMapMemory2KHR()` to do a placed map if that succeeds. Without | ||
replacement, there is no way for the application to atomically exchange | ||
maps and prevent races between reservation and the final map. Also, any | ||
attempt at a middle ground in which it might replace would make the spec | ||
less well-defined. | ||
|
||
=== Version History | ||
|
||
* Revision 0, 2022-07-27 (Faith Ekstrand) | ||
** Internal revisions |
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
Oops, something went wrong.