Don't return an index byte stride if postvs data doesn't use indices

* Since we use the index byte stride to indicate whether a draw is indexed or
  not, returning a valid value here is misleading.
This commit is contained in:
baldurk
2020-01-20 15:04:14 +00:00
parent 2ecee8fc54
commit a4961df6f0
2 changed files with 17 additions and 6 deletions
+11 -5
View File
@@ -114,14 +114,20 @@ MeshFormat D3D11Replay::GetPostVSBuffers(uint32_t eventId, uint32_t instID, uint
MeshFormat ret;
if(s.useIndices && s.idxBuf)
ret.indexResourceId = ((WrappedID3D11Buffer *)s.idxBuf)->GetResourceID();
else
ret.indexResourceId = ResourceId();
ret.indexByteOffset = 0;
ret.indexByteStride = s.idxFmt == DXGI_FORMAT_R16_UINT ? 2 : 4;
ret.baseVertex = 0;
if(s.useIndices && s.idxBuf)
{
ret.indexResourceId = ((WrappedID3D11Buffer *)s.idxBuf)->GetResourceID();
ret.indexByteStride = s.idxFmt == DXGI_FORMAT_R16_UINT ? 2 : 4;
}
else
{
ret.indexResourceId = ResourceId();
ret.indexByteStride = 0;
}
if(s.buf)
ret.vertexResourceId = ((WrappedID3D11Buffer *)s.buf)->GetResourceID();
else
+6 -1
View File
@@ -1862,11 +1862,16 @@ MeshFormat GLReplay::GetPostVSBuffers(uint32_t eventId, uint32_t instID, uint32_
MeshFormat ret;
if(s.useIndices && s.idxBuf)
{
ret.indexResourceId = m_pDriver->GetResourceManager()->GetID(BufferRes(ctx, s.idxBuf));
ret.indexByteStride = s.idxByteWidth;
}
else
{
ret.indexResourceId = ResourceId();
ret.indexByteStride = 0;
}
ret.indexByteOffset = 0;
ret.indexByteStride = s.idxByteWidth;
ret.baseVertex = 0;
if(s.buf)