[Refactor] (ShaderTranspiler): bump the vendored glslang for the uniform-location snapshot and the atomic-counter offset check

This commit is contained in:
2026-08-21 13:51:21 -04:00
parent 194c2f189b
commit e5846569ca
3 changed files with 27 additions and 1 deletions
@@ -368,6 +368,8 @@ public:
TIntermTyped* vkRelaxedRemapFunctionCall(const TSourceLoc&, TFunction*, TIntermNode*); TIntermTyped* vkRelaxedRemapFunctionCall(const TSourceLoc&, TFunction*, TIntermNode*);
// returns true if the variable was remapped to something else // returns true if the variable was remapped to something else
void recordUniformInitializer(const TString&, const TType&, const TConstUnionArray&); 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&); bool vkRelaxedRemapUniformVariable(const TSourceLoc&, TString&, const TPublicType&, TArraySizes*, TIntermTyped*, TType&);
void vkRelaxedRemapUniformMembers(const TSourceLoc&, const TPublicType&, const TType&, const TString&); void vkRelaxedRemapUniformMembers(const TSourceLoc&, const TPublicType&, const TType&, const TString&);
void vkRelaxedRemapFunctionParameter(TFunction*, TParameter&, std::vector<int>* newParams = nullptr); void vkRelaxedRemapFunctionParameter(TFunction*, TParameter&, std::vector<int>* newParams = nullptr);
@@ -637,6 +637,29 @@ public:
void addUniformInitializer(TUniformInitializer&& init) { uniformInitializers.push_back(std::move(init)); } void addUniformInitializer(TUniformInitializer&& init) { uniformInitializers.push_back(std::move(init)); }
const std::vector<TUniformInitializer>& getUniformInitializers() const { return uniformInitializers; } 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); } void setAtomicCounterBlockName(const char* name) { atomicCounterBlockName = std::string(name); }
const char* getAtomicCounterBlockName() const { return atomicCounterBlockName.c_str(); } const char* getAtomicCounterBlockName() const { return atomicCounterBlockName.c_str(); }
void setAtomicCounterBlockSet(unsigned int set) { atomicCounterBlockSet = set; } void setAtomicCounterBlockSet(unsigned int set) { atomicCounterBlockSet = set; }
@@ -1250,6 +1273,7 @@ protected:
std::string globalUniformBlockName; std::string globalUniformBlockName;
std::string atomicCounterBlockName; std::string atomicCounterBlockName;
std::vector<TUniformInitializer> uniformInitializers; std::vector<TUniformInitializer> uniformInitializers;
std::vector<TUniformLocation> uniformLocations;
unsigned int globalUniformBlockSet; unsigned int globalUniformBlockSet;
unsigned int globalUniformBlockBinding; unsigned int globalUniformBlockBinding;
unsigned int atomicCounterBlockSet; unsigned int atomicCounterBlockSet;