Merge pull request #1656 from amdrexu/bugfix

Fix xfb_stride incorrectness(#1654)
This commit is contained in:
John Kessenich
2019-01-17 21:53:34 -07:00
committed by GitHub
5 changed files with 34 additions and 34 deletions

View File

@@ -8698,12 +8698,12 @@ void HlslParseContext::fixXfbOffsets(TQualifier& qualifier, TTypeList& typeList)
int nextOffset = qualifier.layoutXfbOffset;
for (unsigned int member = 0; member < typeList.size(); ++member) {
TQualifier& memberQualifier = typeList[member].type->getQualifier();
bool containsDouble = false;
int memberSize = intermediate.computeTypeXfbSize(*typeList[member].type, containsDouble);
bool contains64BitType = false;
int memberSize = intermediate.computeTypeXfbSize(*typeList[member].type, contains64BitType);
// see if we need to auto-assign an offset to this member
if (! memberQualifier.hasXfbOffset()) {
// "if applied to an aggregate containing a double, the offset must also be a multiple of 8"
if (containsDouble)
// "if applied to an aggregate containing a double or 64-bit integer, the offset must also be a multiple of 8"
if (contains64BitType)
RoundToPow2(nextOffset, 8);
memberQualifier.layoutXfbOffset = nextOffset;
} else