Device memory chapter fixes

1) Make explicit there is a <=> relationship between `DEVICE_LOCAL` heap
and `DEVICE_LOCAL`  memory type
2) Make >4GB runtime error report mandatory. Otherwise it basically says
"do not pass >= 4GB, because possible undefined behavior".
3) Removed `VUID-vkAllocateMemory-device-00636`. Behavior is
deterministic returning `VK_ERROR_TOO_MANY_OBJECTS`
4) Moved `allocationSize` VU (depends on non-local state).
5) Changed `allocationSize`. Not sure what the original means, so
improvized a new one saying alloc size must be <=  the whole size of the
heap.
6) Added VU restricting `memoryTypeIndex` to only the memory types of
the device.
This commit is contained in:
Petr Kraus 2017-08-23 18:05:23 +02:00
parent 2608657344
commit cb5abc90f2
1 changed files with 11 additions and 11 deletions

View File

@ -708,8 +708,8 @@ include::../api/enums/VkMemoryPropertyFlagBits.txt[]
* ename:VK_MEMORY_PROPERTY_DEVICE_LOCAL_BIT bit indicates that memory * ename:VK_MEMORY_PROPERTY_DEVICE_LOCAL_BIT bit indicates that memory
allocated with this type is the most efficient for device access. allocated with this type is the most efficient for device access.
This property will only be set for memory types belonging to heaps with This property will be set if and only if the memory type belongs to a
the ename:VK_MEMORY_HEAP_DEVICE_LOCAL_BIT set. heap with the ename:VK_MEMORY_HEAP_DEVICE_LOCAL_BIT set.
* ename:VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT bit indicates that memory * ename:VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT bit indicates that memory
allocated with this type can: be mapped for host access using allocated with this type can: be mapped for host access using
flink:vkMapMemory. flink:vkMapMemory.
@ -783,14 +783,18 @@ Some platforms may: have a limit on the maximum size of a single allocation.
For example, certain systems may: fail to create allocations with a size For example, certain systems may: fail to create allocations with a size
greater than or equal to 4GB. greater than or equal to 4GB.
Such a limit is implementation-dependent, and if such a failure occurs then Such a limit is implementation-dependent, and if such a failure occurs then
the error ename:VK_ERROR_OUT_OF_DEVICE_MEMORY should: be returned. the error ename:VK_ERROR_OUT_OF_DEVICE_MEMORY must: be returned.
.Valid Usage .Valid Usage
**** ****
* [[VUID-vkAllocateMemory-device-00636]] * pname:pAllocateInfo::pname:allocationSize must: be less than or equal to
The number of currently valid memory objects, allocated from sname:VkPhysicalDeviceMemoryProperties::pname:memoryHeaps[pname:pAllocateInfo::pname:memoryTypeIndex].pname:size
pname:device, must: be less than as returned by flink:vkGetPhysicalDeviceMemoryProperties for physical
sname:VkPhysicalDeviceLimits::pname:maxMemoryAllocationCount device parent of pname:device
* pname:pAllocateInfo::pname:memoryTypeIndex must: be less than
sname:VkPhysicalDeviceMemoryProperties::pname:memoryTypeCount
as returned by flink:vkGetPhysicalDeviceMemoryProperties for physical
device parent of pname:device
**** ****
include::../validity/protos/vkAllocateMemory.txt[] include::../validity/protos/vkAllocateMemory.txt[]
@ -859,10 +863,6 @@ endif::VK_KHR_external_memory_win32,VK_KHR_external_memory_fd[]
.Valid Usage .Valid Usage
**** ****
* [[VUID-VkMemoryAllocateInfo-allocationSize-00637]]
pname:allocationSize must: be less than or equal to the amount of memory
available to the sname:VkMemoryHeap specified by pname:memoryTypeIndex
and the calling command's sname:VkDevice
* [[VUID-VkMemoryAllocateInfo-allocationSize-00638]] * [[VUID-VkMemoryAllocateInfo-allocationSize-00638]]
pname:allocationSize must: be greater than `0` pname:allocationSize must: be greater than `0`
ifdef::VK_KHR_external_memory[] ifdef::VK_KHR_external_memory[]