mirror of
https://github.com/baldurk/renderdoc.git
synced 2026-05-06 01:50:38 +00:00
Handle post-vs data being padded/aligned instead of tightly packed
This commit is contained in:
@@ -75,6 +75,11 @@ namespace renderdocui.Code
|
||||
else return val;
|
||||
}
|
||||
|
||||
public static uint AlignUp(this uint x, uint a)
|
||||
{
|
||||
return (x + (a - 1)) & (~(a - 1));
|
||||
}
|
||||
|
||||
public static bool IsElevated
|
||||
{
|
||||
get
|
||||
|
||||
@@ -806,8 +806,20 @@ namespace renderdocui.Windows
|
||||
uint offset = 0;
|
||||
for (int i = 0; i < details.OutputSig.Length; i++)
|
||||
{
|
||||
uint numComps = f[i].format.compCount;
|
||||
uint elemSize = f[i].format.compType == FormatComponentType.Double ? 8U : 4U;
|
||||
|
||||
if (m_Core.CurPipelineState.HasAlignedPostVSData)
|
||||
{
|
||||
if (numComps == 2)
|
||||
offset = offset.AlignUp(2U * elemSize);
|
||||
else if (numComps > 2)
|
||||
offset = offset.AlignUp(4U * elemSize);
|
||||
}
|
||||
|
||||
f[i].offset = offset;
|
||||
offset += f[i].format.compCount * sizeof(float);
|
||||
|
||||
offset += numComps * elemSize;
|
||||
}
|
||||
|
||||
ret.BufferFormats = f.ToArray();
|
||||
|
||||
Reference in New Issue
Block a user