diff --git a/renderdoc/driver/d3d12/d3d12_rendermesh.cpp b/renderdoc/driver/d3d12/d3d12_rendermesh.cpp index 906f594ab..9ce580598 100644 --- a/renderdoc/driver/d3d12/d3d12_rendermesh.cpp +++ b/renderdoc/driver/d3d12/d3d12_rendermesh.cpp @@ -359,7 +359,7 @@ void D3D12Replay::RenderMesh(uint32_t eventId, const std::vector &se // we source all data from the first instanced value in the instanced case, so make sure we // offset correctly here. - if(cfg.position.instanced) + if(cfg.position.instanced && cfg.position.instStepRate) offs += cfg.position.vertexByteStride * (cfg.curInstance / cfg.position.instStepRate); D3D12_VERTEX_BUFFER_VIEW view; @@ -392,7 +392,7 @@ void D3D12Replay::RenderMesh(uint32_t eventId, const std::vector &se // we source all data from the first instanced value in the instanced case, so make sure we // offset correctly here. - if(cfg.second.instanced) + if(cfg.second.instanced && cfg.second.instStepRate) offs += cfg.second.vertexByteStride * (cfg.curInstance / cfg.second.instStepRate); D3D12_VERTEX_BUFFER_VIEW view; diff --git a/renderdoc/driver/vulkan/vk_rendermesh.cpp b/renderdoc/driver/vulkan/vk_rendermesh.cpp index 9cba52fee..9da7d4d78 100644 --- a/renderdoc/driver/vulkan/vk_rendermesh.cpp +++ b/renderdoc/driver/vulkan/vk_rendermesh.cpp @@ -550,7 +550,7 @@ void VulkanReplay::RenderMesh(uint32_t eventId, const std::vector &s // we source all data from the first instanced value in the instanced case, so make sure we // offset correctly here. - if(cfg.position.instanced) + if(cfg.position.instanced && cfg.position.instStepRate) offs += cfg.position.vertexByteStride * (cfg.curInstance / cfg.position.instStepRate); vt->CmdBindVertexBuffers(Unwrap(cmd), 0, 1, UnwrapPtr(vb), &offs); @@ -571,7 +571,7 @@ void VulkanReplay::RenderMesh(uint32_t eventId, const std::vector &s // we source all data from the first instanced value in the instanced case, so make sure we // offset correctly here. - if(cfg.second.instanced) + if(cfg.second.instanced && cfg.second.instStepRate) offs += cfg.second.vertexByteStride * (cfg.curInstance / cfg.second.instStepRate); vt->CmdBindVertexBuffers(Unwrap(cmd), 1, 1, UnwrapPtr(vb), &offs);