mirror of
https://github.com/baldurk/renderdoc.git
synced 2026-05-06 01:50:38 +00:00
Only fetch the PostVS data needed for this draw, not the whole buffer
* For instanced draws where there are many instance and each instance is a lot, this saves fetching a *ton* of redundant data.
This commit is contained in:
@@ -967,8 +967,6 @@ namespace renderdocui.Windows
|
||||
}
|
||||
else
|
||||
{
|
||||
ret.Buffers[0] = r.GetBufferData(ret.PostVS.buf, ret.PostVS.offset, 0);
|
||||
|
||||
ret.Topology = ret.PostVS.topo;
|
||||
|
||||
ret.IndexCount = ret.PostVS.numVerts;
|
||||
@@ -982,6 +980,8 @@ namespace renderdocui.Windows
|
||||
ret.Indices = null;
|
||||
ret.DataIndices = null;
|
||||
|
||||
uint maxIndex = Math.Max(ret.IndexCount, 1) - 1;
|
||||
|
||||
if (ret.PostVS.buf != ResourceId.Null && type == MeshDataStage.VSOut &&
|
||||
(input.Drawcall.flags & DrawcallFlags.UseIBuffer) > 0 && input.IndexBuffer != ResourceId.Null)
|
||||
{
|
||||
@@ -1052,8 +1052,20 @@ namespace renderdocui.Windows
|
||||
Buffer.BlockCopy(rawidxs, 0, ret.DataIndices, 0, ret.DataIndices.Length * sizeof(uint));
|
||||
}
|
||||
}
|
||||
|
||||
maxIndex = 0;
|
||||
foreach (var i in ret.DataIndices)
|
||||
{
|
||||
if (i == input.IndexRestartValue && input.IndexRestart)
|
||||
continue;
|
||||
|
||||
maxIndex = Math.Max(maxIndex, i);
|
||||
}
|
||||
}
|
||||
|
||||
if (ret.PostVS.buf != ResourceId.Null)
|
||||
ret.Buffers[0] = r.GetBufferData(ret.PostVS.buf, ret.PostVS.offset, (maxIndex + 1) * ret.PostVS.stride);
|
||||
|
||||
return ret;
|
||||
}
|
||||
else if (input.Buffers != null && m_Output != null)
|
||||
|
||||
Reference in New Issue
Block a user