Web: Remove/rationalize a set of *_EXTENSIONS, using GLSLANG_WEB.

Focus was on the front end (not SPIR-V), minus the grammar.
Reduces #ifdef count by around 320 and makes the web build 270K smaller,
which is about 90% the  target size.

The grammar and scanner will be another step, as will the SPIR-V backend.
This makes heavy use of methods #ifdef'd to return false as a global way
of turning off code, relying on C++ DCE to do the rest.
This commit is contained in:
John Kessenich
2019-08-01 03:28:08 -06:00
parent e66dace97e
commit 7015bd658e
32 changed files with 2661 additions and 2712 deletions

View File

@@ -8703,25 +8703,19 @@ 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;