If instance step rate is 0 for instanced properties, don't divide by 0

This commit is contained in:
baldurk
2019-07-22 16:57:20 +01:00
parent 66869e8c69
commit d91683e7c6
2 changed files with 4 additions and 4 deletions
+2 -2
View File
@@ -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;
+2 -2
View File
@@ -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);