Add redeclarations of built-in blocks.

Note: lots of test results changed due to listing the members of a block when printing types.

git-svn-id: https://cvs.khronos.org/svn/repos/ogl/trunk/ecosystem/public/sdk/tools/glslang@23682 e7fa87d3-cd2b-0410-9028-fcbf551c1848
This commit is contained in:
John Kessenich 2013-10-24 01:25:40 +00:00
parent 94fdd1117b
commit ab41fe5df6
44 changed files with 528 additions and 324 deletions

View file

@ -463,13 +463,11 @@ public:
// to the current level, so it can be modified without impacting other users
// of the shared table.
//
TSymbol* copyUp(TSymbol* shared)
TSymbol* copyUpDeferredInsert(TSymbol* shared)
{
TSymbol* copy;
if (shared->getAsVariable()) {
copy = shared->clone();
TSymbol* copy = shared->clone();
copy->setUniqueId(shared->getUniqueId());
table[currentLevel()]->insert(*copy);
return copy;
} else {
const TAnonMember* anon = shared->getAsAnonMember();
@ -477,7 +475,20 @@ public:
TVariable* container = anon->getAnonContainer().clone();
container->changeName(NewPoolTString(""));
container->setUniqueId(anon->getAnonContainer().getUniqueId());
table[currentLevel()]->insert(*container);
return container;
}
}
TSymbol* copyUp(TSymbol* shared)
{
TSymbol* copy = copyUpDeferredInsert(shared);
table[currentLevel()]->insert(*copy);
if (shared->getAsVariable())
return copy;
else {
// get copy of an anonymous member's container
table[currentLevel()]->insert(*copy);
// return the copy of the anonymous member
return table[currentLevel()]->find(shared->getName());
}
}