mirror of
https://github.com/RPCS3/glslang.git
synced 2024-12-03 00:28:28 +00:00
Merge pull request #2756 from mbechard/vkRelaxed-AvoidDuplicateUniform
GL_EXT_vulkan_glsl_relaxed - avoid growing the global uniform block with duplicates
This commit is contained in:
commit
cce85320a8
@ -622,6 +622,19 @@ void TParseContextBase::growGlobalUniformBlock(const TSourceLoc& loc, TType& mem
|
||||
globalUniformBlock->getWritableType().getQualifier().layoutBinding = globalUniformBinding;
|
||||
globalUniformBlock->getWritableType().getQualifier().layoutSet = globalUniformSet;
|
||||
|
||||
// Check for declarations of this default uniform that already exist due to other compilation units.
|
||||
TSymbol* symbol = symbolTable.find(memberName);
|
||||
if (symbol) {
|
||||
if (memberType != symbol->getType()) {
|
||||
TString err;
|
||||
err += "\"" + memberType.getCompleteString() + "\"";
|
||||
err += " versus ";
|
||||
err += "\"" + symbol->getType().getCompleteString() + "\"";
|
||||
error(loc, "Types must match:", memberType.getFieldName().c_str(), err.c_str());
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
// Add the requested member as a member to the global block.
|
||||
TType* type = new TType;
|
||||
type->shallowCopy(memberType);
|
||||
|
Loading…
Reference in New Issue
Block a user