From 92aaf0d5473fc3f15f6939cf0c8120fc381b931c Mon Sep 17 00:00:00 2001 From: baldurk Date: Thu, 14 Dec 2017 18:51:05 +0000 Subject: [PATCH] Fix memory alignment checks and error message format strings. Refs #821 --- .../driver/vulkan/wrappers/vk_resource_funcs.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/renderdoc/driver/vulkan/wrappers/vk_resource_funcs.cpp b/renderdoc/driver/vulkan/wrappers/vk_resource_funcs.cpp index d199de187..bbb4f2911 100644 --- a/renderdoc/driver/vulkan/wrappers/vk_resource_funcs.cpp +++ b/renderdoc/driver/vulkan/wrappers/vk_resource_funcs.cpp @@ -889,14 +889,14 @@ bool WrappedVulkan::Serialise_vkBindBufferMemory(SerialiserType &ser, VkDevice d } // verify offset alignment - if((memoryOffset & mrq.alignment) != 0) + if((memoryOffset % mrq.alignment) != 0) { RDCERR( "Trying to bind buffer %llu to memory %llu which is type %u, " "but offset 0x%llx doesn't satisfy alignment 0x%llx.\n" "This is most likely caused by incompatible hardware or drivers between capture and " "replay, causing a change in memory requirements.", - resOrigId, memOrigId, memoryOffset, mrq.alignment); + resOrigId, memOrigId, memInfo.memoryTypeIndex, memoryOffset, mrq.alignment); m_FailedReplayStatus = ReplayStatus::APIHardwareUnsupported; return false; } @@ -909,7 +909,7 @@ bool WrappedVulkan::Serialise_vkBindBufferMemory(SerialiserType &ser, VkDevice d "but at offset 0x%llx the reported size of 0x%llx won't fit the 0x%llx bytes of memory.\n" "This is most likely caused by incompatible hardware or drivers between capture and " "replay, causing a change in memory requirements.", - resOrigId, memOrigId, memoryOffset, mrq.size, memInfo.size); + resOrigId, memOrigId, memInfo.memoryTypeIndex, memoryOffset, mrq.size, memInfo.size); m_FailedReplayStatus = ReplayStatus::APIHardwareUnsupported; return false; } @@ -1000,14 +1000,14 @@ bool WrappedVulkan::Serialise_vkBindImageMemory(SerialiserType &ser, VkDevice de } // verify offset alignment - if((memoryOffset & mrq.alignment) != 0) + if((memoryOffset % mrq.alignment) != 0) { RDCERR( "Trying to bind image %llu to memory %llu which is type %u, " "but offset 0x%llx doesn't satisfy alignment 0x%llx.\n" "This is most likely caused by incompatible hardware or drivers between capture and " "replay, causing a change in memory requirements.", - resOrigId, memOrigId, memoryOffset, mrq.alignment); + resOrigId, memOrigId, memInfo.memoryTypeIndex, memoryOffset, mrq.alignment); m_FailedReplayStatus = ReplayStatus::APIHardwareUnsupported; return false; } @@ -1020,7 +1020,7 @@ bool WrappedVulkan::Serialise_vkBindImageMemory(SerialiserType &ser, VkDevice de "but at offset 0x%llx the reported size of 0x%llx won't fit the 0x%llx bytes of memory.\n" "This is most likely caused by incompatible hardware or drivers between capture and " "replay, causing a change in memory requirements.", - resOrigId, memOrigId, memoryOffset, mrq.size, memInfo.size); + resOrigId, memOrigId, memInfo.memoryTypeIndex, memoryOffset, mrq.size, memInfo.size); m_FailedReplayStatus = ReplayStatus::APIHardwareUnsupported; return false; }