Commit 1e6a9898 by Alexis Hetu Committed by Alexis Hétu

Dedicated allocation verification

Added the ability to set the VkMemoryDedicatedRequirements structure in vkGetBufferMemoryRequirements2. Note that this cl adds no support for dedicated allocations. Passes all tests in the Tests section below. Change-Id: Ib5bc2775e66e810d1ca2d52672eb2cca71e85f5e Tests: dEQP-VK.api.buffer.dedicated_alloc.* Tests: dEQP-VK.api.buffer_view.create.* Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/27290 Presubmit-Ready: Alexis Hétu <sugoi@google.com> Reviewed-by: 's avatarNicolas Capens <nicolascapens@google.com> Reviewed-by: 's avatarChris Forbes <chrisforbes@google.com> Tested-by: 's avatarAlexis Hétu <sugoi@google.com> Kokoro-Presubmit: kokoro <noreply+kokoro@google.com>
parent f3b57974
...@@ -1787,11 +1787,31 @@ VKAPI_ATTR void VKAPI_CALL vkGetBufferMemoryRequirements2(VkDevice device, const ...@@ -1787,11 +1787,31 @@ VKAPI_ATTR void VKAPI_CALL vkGetBufferMemoryRequirements2(VkDevice device, const
TRACE("(VkDevice device = 0x%X, const VkBufferMemoryRequirementsInfo2* pInfo = 0x%X, VkMemoryRequirements2* pMemoryRequirements = 0x%X)", TRACE("(VkDevice device = 0x%X, const VkBufferMemoryRequirementsInfo2* pInfo = 0x%X, VkMemoryRequirements2* pMemoryRequirements = 0x%X)",
device, pInfo, pMemoryRequirements); device, pInfo, pMemoryRequirements);
if(pInfo->pNext || pMemoryRequirements->pNext) if(pInfo->pNext)
{ {
UNIMPLEMENTED(); UNIMPLEMENTED();
} }
VkBaseOutStructure* extensionRequirements = reinterpret_cast<VkBaseOutStructure*>(pMemoryRequirements->pNext);
while(extensionRequirements)
{
switch(extensionRequirements->sType)
{
case VK_STRUCTURE_TYPE_MEMORY_DEDICATED_REQUIREMENTS:
{
auto& requirements = *reinterpret_cast<VkMemoryDedicatedRequirements*>(extensionRequirements);
requirements.prefersDedicatedAllocation = VK_FALSE;
requirements.requiresDedicatedAllocation = VK_FALSE;
}
break;
default:
UNIMPLEMENTED();
break;
}
extensionRequirements = extensionRequirements->pNext;
}
vkGetBufferMemoryRequirements(device, pInfo->buffer, &(pMemoryRequirements->memoryRequirements)); vkGetBufferMemoryRequirements(device, pInfo->buffer, &(pMemoryRequirements->memoryRequirements));
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment