mirror of
https://github.com/MobileGL-Dev/MobileGL
synced 2026-09-07 19:58:32 +09:00
[Refactor] (ShaderTranspiler): bump the vendored glslang for the uniform-location snapshot and the atomic-counter offset check
This commit is contained in:
Vendored
+1
-1
Submodule 3rdparty/glslang updated: 6f12598784...fa562bb911
@@ -368,6 +368,8 @@ public:
|
||||
TIntermTyped* vkRelaxedRemapFunctionCall(const TSourceLoc&, TFunction*, TIntermNode*);
|
||||
// returns true if the variable was remapped to something else
|
||||
void recordUniformInitializer(const TString&, const TType&, const TConstUnionArray&);
|
||||
void recordUniformLocation(const TString&, const TType&);
|
||||
void atomicCounterOffsetCheck(const TSourceLoc&, const TString&, const TType&);
|
||||
bool vkRelaxedRemapUniformVariable(const TSourceLoc&, TString&, const TPublicType&, TArraySizes*, TIntermTyped*, TType&);
|
||||
void vkRelaxedRemapUniformMembers(const TSourceLoc&, const TPublicType&, const TType&, const TString&);
|
||||
void vkRelaxedRemapFunctionParameter(TFunction*, TParameter&, std::vector<int>* newParams = nullptr);
|
||||
|
||||
@@ -637,6 +637,29 @@ public:
|
||||
void addUniformInitializer(TUniformInitializer&& init) { uniformInitializers.push_back(std::move(init)); }
|
||||
const std::vector<TUniformInitializer>& getUniformInitializers() const { return uniformInitializers; }
|
||||
|
||||
// A default-block uniform's explicit layout(location = N), recorded where Vulkan-relaxed
|
||||
// rules DROP it.
|
||||
//
|
||||
// Desktop GLSL 4.3 / ARB_explicit_uniform_location lets a default-block uniform name the
|
||||
// number glGetUniformLocation will answer for it. Vulkan-relaxed parsing sweeps such
|
||||
// uniforms into a uniform BLOCK, where a location qualifier means nothing, so the
|
||||
// qualifier is dropped with a warning - and once it is gone no later stage can tell the
|
||||
// uniform ever carried one: mapIO sees layoutLocationEnd and reflection reports whatever
|
||||
// the client's own assigner chose. The CLIENT is the only party that can still honor it,
|
||||
// so the declared number is handed out here instead of discarded.
|
||||
//
|
||||
// arraySizes is the declared array shape, outer dimension first, and empty when the
|
||||
// uniform is not an array. A client that keys these by REFLECTION name has to spell the
|
||||
// same elements glslang's reflection will ("u[1][0]" for a float u[2][3]), and only the
|
||||
// declaration knows the shape; a dimension glslang could not size appears as 0.
|
||||
struct TUniformLocation {
|
||||
std::string name;
|
||||
int location = -1;
|
||||
std::vector<int> arraySizes;
|
||||
};
|
||||
void addUniformLocation(TUniformLocation&& location) { uniformLocations.push_back(std::move(location)); }
|
||||
const std::vector<TUniformLocation>& getUniformLocations() const { return uniformLocations; }
|
||||
|
||||
void setAtomicCounterBlockName(const char* name) { atomicCounterBlockName = std::string(name); }
|
||||
const char* getAtomicCounterBlockName() const { return atomicCounterBlockName.c_str(); }
|
||||
void setAtomicCounterBlockSet(unsigned int set) { atomicCounterBlockSet = set; }
|
||||
@@ -1250,6 +1273,7 @@ protected:
|
||||
std::string globalUniformBlockName;
|
||||
std::string atomicCounterBlockName;
|
||||
std::vector<TUniformInitializer> uniformInitializers;
|
||||
std::vector<TUniformLocation> uniformLocations;
|
||||
unsigned int globalUniformBlockSet;
|
||||
unsigned int globalUniformBlockBinding;
|
||||
unsigned int atomicCounterBlockSet;
|
||||
|
||||
Reference in New Issue
Block a user