From c6b1307da50c5717dcf5d9348b7036beacdff4e6 Mon Sep 17 00:00:00 2001 From: baldurk Date: Wed, 11 May 2016 08:54:27 +0200 Subject: [PATCH] handle a vertex buffer stride of 0 --- renderdoc/driver/vulkan/vk_debug.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/renderdoc/driver/vulkan/vk_debug.cpp b/renderdoc/driver/vulkan/vk_debug.cpp index ad804cf48..f042165ca 100644 --- a/renderdoc/driver/vulkan/vk_debug.cpp +++ b/renderdoc/driver/vulkan/vk_debug.cpp @@ -5113,10 +5113,15 @@ void VulkanDebugManager::InitPostVSBuffers(uint32_t eventID) // the end of the buffer. The maximum valid index at all is the one that reads // off the end of ALL buffers (so we max it with any other maxindex value // calculated). - maxIdx = RDCMAX(maxIdx, uint32_t( (bufsize - offs) / input.stride )); + if(input.stride > 0) + maxIdx = RDCMAX(maxIdx, uint32_t( (bufsize - offs) / input.stride )); } } + // in case the vertex buffers were set but had invalid stride (0), max with the number + // of vertices too. This is fine since the max here is just a conservative limit + maxIdx = RDCMAX(maxIdx, drawcall->numIndices); + // do ibuffer rebasing/remapping idx16 = (uint16_t *)&idxdata[0];