Fix broken capture when app uses dedicated allocation weirdly

Both handles in VkMemoryDedicatedAllocateInfo can be VK_NULL_HANDLE,
specification allows this. Should be safe to ignore struct in this case.
This commit is contained in:
Pavel Asyutchenko
2021-07-31 17:09:14 +03:00
committed by Baldur Karlsson
parent 93f8a59a8f
commit c31c04712d
@@ -315,9 +315,18 @@ bool WrappedVulkan::Serialise_vkAllocateMemory(SerialiserType &ser, VkDevice dev
VkMemoryDedicatedAllocateInfo *dedicated = (VkMemoryDedicatedAllocateInfo *)FindNextStruct(
&AllocateInfo, VK_STRUCTURE_TYPE_MEMORY_DEDICATED_ALLOCATE_INFO);
if(dedicated && dedicated->buffer == VK_NULL_HANDLE && dedicated->image == VK_NULL_HANDLE)
{
dedicated = NULL;
}
VkDedicatedAllocationMemoryAllocateInfoNV *dedicatedNV =
(VkDedicatedAllocationMemoryAllocateInfoNV *)FindNextStruct(
&AllocateInfo, VK_STRUCTURE_TYPE_DEDICATED_ALLOCATION_MEMORY_ALLOCATE_INFO_NV);
if(dedicatedNV && dedicatedNV->buffer == VK_NULL_HANDLE && dedicatedNV->image == VK_NULL_HANDLE)
{
dedicatedNV = NULL;
}
if(dedicated)
{
@@ -480,9 +489,18 @@ VkResult WrappedVulkan::vkAllocateMemory(VkDevice device, const VkMemoryAllocate
VkMemoryDedicatedAllocateInfo *dedicated = (VkMemoryDedicatedAllocateInfo *)FindNextStruct(
pAllocateInfo, VK_STRUCTURE_TYPE_MEMORY_DEDICATED_ALLOCATE_INFO);
if(dedicated && dedicated->buffer == VK_NULL_HANDLE && dedicated->image == VK_NULL_HANDLE)
{
dedicated = NULL;
}
VkDedicatedAllocationMemoryAllocateInfoNV *dedicatedNV =
(VkDedicatedAllocationMemoryAllocateInfoNV *)FindNextStruct(
pAllocateInfo, VK_STRUCTURE_TYPE_DEDICATED_ALLOCATION_MEMORY_ALLOCATE_INFO_NV);
if(dedicatedNV && dedicatedNV->buffer == VK_NULL_HANDLE && dedicatedNV->image == VK_NULL_HANDLE)
{
dedicatedNV = NULL;
}
// create a buffer with the whole memory range bound, for copying to and from
// conveniently (for initial state data)