Add 8-bit/16-bit transform feedback support for future use
This commit is contained in:
parent
dc2d5673a1
commit
eaf31ab98c
8 changed files with 288 additions and 9 deletions
|
|
@ -8695,12 +8695,25 @@ void HlslParseContext::fixXfbOffsets(TQualifier& qualifier, TTypeList& typeList)
|
|||
for (unsigned int member = 0; member < typeList.size(); ++member) {
|
||||
TQualifier& memberQualifier = typeList[member].type->getQualifier();
|
||||
bool contains64BitType = false;
|
||||
#ifdef AMD_EXTENSIONS
|
||||
bool contains32BitType = false;
|
||||
bool contains16BitType = false;
|
||||
int memberSize = intermediate.computeTypeXfbSize(*typeList[member].type, contains64BitType, contains32BitType, contains16BitType);
|
||||
#else
|
||||
int memberSize = intermediate.computeTypeXfbSize(*typeList[member].type, contains64BitType);
|
||||
#endif
|
||||
// see if we need to auto-assign an offset to this member
|
||||
if (! memberQualifier.hasXfbOffset()) {
|
||||
// "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);
|
||||
#ifdef AMD_EXTENSIONS
|
||||
else if (contains32BitType)
|
||||
RoundToPow2(nextOffset, 4);
|
||||
// "if applied to an aggregate containing a half float or 16-bit integer, the offset must also be a multiple of 2"
|
||||
else if (contains16BitType)
|
||||
RoundToPow2(nextOffset, 2);
|
||||
#endif
|
||||
memberQualifier.layoutXfbOffset = nextOffset;
|
||||
} else
|
||||
nextOffset = memberQualifier.layoutXfbOffset;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue