Add reflection queries for thread local size and ssbo auto-binding

New command line option --shift-ssbo-binding mirrors --shift-ubo-binding, etc.

New reflection query getLocalSize(int dim) queries local size, e.g, CS threads.
This commit is contained in:
steve-lunarg 2017-02-21 17:19:08 -07:00
parent 5da1f038d8
commit 932bb5cc4e
11 changed files with 265 additions and 15 deletions

View file

@ -89,7 +89,12 @@ protected:
// The full reflection database
class TReflection {
public:
TReflection() : badReflection(TObjectReflection::badReflection()) { }
TReflection() : badReflection(TObjectReflection::badReflection())
{
for (int dim=0; dim<3; ++dim)
localSize[dim] = 0;
}
virtual ~TReflection() {}
// grow the reflection stage by stage
@ -135,11 +140,16 @@ public:
return it->second;
}
// Thread local size
unsigned getLocalSize(int dim) const { return dim <= 2 ? localSize[dim] : 0; }
void dump();
protected:
friend class glslang::TReflectionTraverser;
void buildAttributeReflection(EShLanguage, const TIntermediate&);
// Need a TString hash: typedef std::unordered_map<TString, int> TNameToIndex;
typedef std::map<TString, int> TNameToIndex;
typedef std::vector<TObjectReflection> TMapIndexToReflection;
@ -149,6 +159,8 @@ protected:
TMapIndexToReflection indexToUniform;
TMapIndexToReflection indexToUniformBlock;
TMapIndexToReflection indexToAttribute;
unsigned int localSize[3];
};
} // end namespace glslang