From 7a09ab08074ad2d542de547792153239ef7feb66 Mon Sep 17 00:00:00 2001 From: baldurk Date: Mon, 11 Jul 2016 18:03:11 +0200 Subject: [PATCH] Make sure not to mix and match dispatchable & non- objects. Refs #290 * On 32-bit, dispatchable objects are 32-bit wide since they're pointer sized, vs 64-bit non-dispatchable objects. Using a dispatchable pointer to write both types of objects leads to incorrect stepping. --- .../driver/vulkan/wrappers/vk_queue_funcs.cpp | 25 ++++++++++--------- 1 file changed, 13 insertions(+), 12 deletions(-) diff --git a/renderdoc/driver/vulkan/wrappers/vk_queue_funcs.cpp b/renderdoc/driver/vulkan/wrappers/vk_queue_funcs.cpp index 5dcfffd55..743a67e67 100644 --- a/renderdoc/driver/vulkan/wrappers/vk_queue_funcs.cpp +++ b/renderdoc/driver/vulkan/wrappers/vk_queue_funcs.cpp @@ -442,7 +442,7 @@ VkResult WrappedVulkan::vkQueueSubmit(VkQueue queue, uint32_t submitCount, byte *memory = GetTempMemory(tempmemSize); VkSubmitInfo *unwrappedSubmits = (VkSubmitInfo *)memory; - VkCommandBuffer *unwrappedObjects = (VkCommandBuffer *)(unwrappedSubmits + submitCount); + VkSemaphore *unwrappedWaitSems = (VkSemaphore *)(unwrappedSubmits + submitCount); for(uint32_t i = 0; i < submitCount; i++) { @@ -450,24 +450,25 @@ VkResult WrappedVulkan::vkQueueSubmit(VkQueue queue, uint32_t submitCount, unwrappedSubmits[i] = pSubmits[i]; unwrappedSubmits[i].pWaitSemaphores = - unwrappedSubmits[i].waitSemaphoreCount ? (VkSemaphore *)unwrappedObjects : NULL; - VkSemaphore *sems = (VkSemaphore *)unwrappedObjects; + unwrappedSubmits[i].waitSemaphoreCount ? unwrappedWaitSems : NULL; for(uint32_t o = 0; o < unwrappedSubmits[i].waitSemaphoreCount; o++) - sems[o] = Unwrap(pSubmits[i].pWaitSemaphores[o]); - unwrappedObjects += unwrappedSubmits[i].waitSemaphoreCount; + unwrappedWaitSems[o] = Unwrap(pSubmits[i].pWaitSemaphores[o]); + unwrappedWaitSems += unwrappedSubmits[i].waitSemaphoreCount; + + VkCommandBuffer *unwrappedCommandBuffers = (VkCommandBuffer *)unwrappedWaitSems; unwrappedSubmits[i].pCommandBuffers = - unwrappedSubmits[i].commandBufferCount ? (VkCommandBuffer *)unwrappedObjects : NULL; + unwrappedSubmits[i].commandBufferCount ? unwrappedCommandBuffers : NULL; for(uint32_t o = 0; o < unwrappedSubmits[i].commandBufferCount; o++) - unwrappedObjects[o] = Unwrap(pSubmits[i].pCommandBuffers[o]); - unwrappedObjects += unwrappedSubmits[i].commandBufferCount; + unwrappedCommandBuffers[o] = Unwrap(pSubmits[i].pCommandBuffers[o]); + unwrappedCommandBuffers += unwrappedSubmits[i].commandBufferCount; + + VkSemaphore *unwrappedSignalSems = (VkSemaphore *)unwrappedCommandBuffers; unwrappedSubmits[i].pSignalSemaphores = - unwrappedSubmits[i].signalSemaphoreCount ? (VkSemaphore *)unwrappedObjects : NULL; - sems = (VkSemaphore *)unwrappedObjects; + unwrappedSubmits[i].signalSemaphoreCount ? unwrappedSignalSems : NULL; for(uint32_t o = 0; o < unwrappedSubmits[i].signalSemaphoreCount; o++) - sems[o] = Unwrap(pSubmits[i].pSignalSemaphores[o]); - unwrappedObjects += unwrappedSubmits[i].signalSemaphoreCount; + unwrappedSignalSems[o] = Unwrap(pSubmits[i].pSignalSemaphores[o]); } VkResult ret =