HLSL: Flatten vertex input and fragment output structures.

Vulkan can't handle structures into the vertex stage or out
of the fragment stage.
This commit is contained in:
John Kessenich 2016-09-09 16:32:09 -06:00
parent 6295c27900
commit cd0a78a0d9
7 changed files with 255 additions and 67 deletions

View file

@ -83,6 +83,9 @@ public:
TIntermTyped* handleBinaryMath(const TSourceLoc&, const char* str, TOperator op, TIntermTyped* left, TIntermTyped* right);
TIntermTyped* handleUnaryMath(const TSourceLoc&, const char* str, TOperator op, TIntermTyped* childNode);
TIntermTyped* handleDotDereference(const TSourceLoc&, TIntermTyped* base, const TString& field);
bool shouldFlatten(const TType&);
void flattenStruct(const TVariable& variable);
TIntermTyped* flattenAccess(TIntermTyped* base, int member);
TFunction& handleFunctionDeclarator(const TSourceLoc&, TFunction& function, bool prototype);
TIntermAggregate* handleFunctionDefinition(const TSourceLoc&, TFunction&);
void handleFunctionBody(const TSourceLoc&, TFunction&, TIntermNode* functionBody, TIntermNode*& node);
@ -233,6 +236,8 @@ protected:
// array-sizing declarations
//
TVector<TSymbol*> ioArraySymbolResizeList;
TMap<int, TVector<TVariable*>> flattenMap;
};
} // end namespace glslang