HLSL: Flatten a return struct from an entry point and assign locations after flattening.

Locations now get assigned in order, but skipping built-ins, which can be
done post flattening.
This commit is contained in:
John Kessenich
2016-09-16 01:44:43 -06:00
parent 7f702124ec
commit 7dc630f3da
93 changed files with 951 additions and 495 deletions

View File

@@ -86,6 +86,7 @@ public:
bool shouldFlatten(const TType&);
void flattenStruct(const TVariable& variable);
TIntermTyped* flattenAccess(TIntermTyped* base, int member);
void assignLocations(TVariable& variable);
TFunction& handleFunctionDeclarator(const TSourceLoc&, TFunction& function, bool prototype);
TIntermAggregate* handleFunctionDefinition(const TSourceLoc&, TFunction&);
void handleFunctionBody(const TSourceLoc&, TFunction&, TIntermNode* functionBody, TIntermNode*& node);
@@ -237,7 +238,9 @@ protected:
//
TVector<TSymbol*> ioArraySymbolResizeList;
TMap<int, TVector<TVariable*>> flattenMap;
TUnorderedMap<int, TVector<TVariable*>> flattenMap;
unsigned int nextInLocation;
unsigned int nextOutLocation;
};
} // end namespace glslang