Commit 52660ffc by Jamie Madill Committed by Shannon Woods

Fix alignment of HLSL packed structs in interface blocks.

TRAC #22856 Signed-off-by: Geoff Lang Signed-off-by: Shannon Woods Authored-by: Jamie Madill
parent a295edfc
......@@ -92,17 +92,15 @@ bool InterfaceBlock::getBlockLayoutInfo(const sh::Uniform &uniform, unsigned int
{
if (!uniform.fields.empty())
{
if (uniform.arraySize > 0)
{
for (unsigned int arrayElement = 0; arrayElement < uniform.arraySize; arrayElement++)
{
getBlockLayoutInfo(uniform.fields, currentOffset);
}
}
else
const unsigned int elementCount = std::max(1u, uniform.arraySize);
for (unsigned int elementIndex = 0; elementIndex < elementCount; elementIndex++)
{
// align struct to register size
*currentOffset = rx::roundUp(*currentOffset, 4u);
getBlockLayoutInfo(uniform.fields, currentOffset);
}
return false;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment