mirror of
https://github.com/baldurk/renderdoc.git
synced 2026-09-22 21:55:52 +00:00
If instance step rate is 0 for instanced properties, don't divide by 0
This commit is contained in:
@@ -359,7 +359,7 @@ void D3D12Replay::RenderMesh(uint32_t eventId, const std::vector<MeshFormat> &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<MeshFormat> &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;
|
||||
|
||||
@@ -550,7 +550,7 @@ void VulkanReplay::RenderMesh(uint32_t eventId, const std::vector<MeshFormat> &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<MeshFormat> &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);
|
||||
|
||||
Reference in New Issue
Block a user