HLSL: Non-functional: Move partial flattened access into symbol node.

Lays the groundwork for fixing issue #954.

Partial flattenings were previously tracked through a stack of active subsets
in the parse context, but full functionality needs AST nodes to represent
this across time, removing the need for parsecontext tracking.
This commit is contained in:
John Kessenich
2017-06-29 17:43:31 -06:00
parent 02a14e7c99
commit d1be7545c6
4 changed files with 26 additions and 36 deletions

View File

@@ -204,10 +204,6 @@ public:
// Potentially rename shader entry point function
void renameShaderFunction(const TString*& name) const;
// Reset data for incrementally built referencing of flattened composite structures
void initFlattening() { flattenLevel.push_back(0); flattenOffset.push_back(0); }
void finalizeFlattening() { flattenLevel.pop_back(); flattenOffset.pop_back(); }
// Share struct buffer deep types
void shareStructBufferType(TType&);
@@ -242,7 +238,7 @@ protected:
// Array and struct flattening
TIntermTyped* flattenAccess(TIntermTyped* base, int member);
TIntermTyped* flattenAccess(int uniqueId, int member, const TType&);
TIntermTyped* flattenAccess(int uniqueId, int member, const TType&, int subset = -1);
bool shouldFlatten(const TType&) const;
bool wasFlattened(const TIntermTyped* node) const;
bool wasFlattened(int id) const { return flattenMap.find(id) != flattenMap.end(); }
@@ -368,7 +364,6 @@ protected:
TMap<int, TFlattenData> flattenMap;
TVector<int> flattenLevel; // nested postfix operator level for flattening
TVector<int> flattenOffset; // cumulative offset for flattening
// IO-type map. Maps a pure symbol-table form of a structure-member list into
// each of the (up to) three kinds of IO, as each as different allowed decorations,