diff options
author | John Kessenich <cepheus@frii.com> | 2013-08-09 17:14:49 +0000 |
---|---|---|
committer | John Kessenich <cepheus@frii.com> | 2013-08-09 17:14:49 +0000 |
commit | c027579631ad0cf71b183d247a7b3102491998c0 (patch) | |
tree | d02b96b87abb288ba37597995665f982daf61470 /glslang/MachineIndependent/SymbolTable.cpp | |
parent | 317f1af21738a8dec8fd057e842412a5a3834c8f (diff) | |
download | glslang-c027579631ad0cf71b183d247a7b3102491998c0.tar.gz |
Put in infrastructure for tessellation, geometry, and compute stages, and partially flesh out with built-in functions.
Added the built-in functions EmitVertex(), EndPrimitive(), barrier(), memoryBarrier(), memoryBarrierAtomicCounter(), memoryBarrierBuffer(), memoryBarrierImage(), memoryBarrierShared(), and groupMemoryBarrier().
Have not added any new built-in variables.
Also changed the linear performance relateToOperator() to a high-performance version.
git-svn-id: https://cvs.khronos.org/svn/repos/ogl/trunk/ecosystem/public/sdk/tools/glslang@22659 e7fa87d3-cd2b-0410-9028-fcbf551c1848
Diffstat (limited to 'glslang/MachineIndependent/SymbolTable.cpp')
-rw-r--r-- | glslang/MachineIndependent/SymbolTable.cpp | 21 |
1 files changed, 11 insertions, 10 deletions
diff --git a/glslang/MachineIndependent/SymbolTable.cpp b/glslang/MachineIndependent/SymbolTable.cpp index 27d6fc71..8fde88d3 100644 --- a/glslang/MachineIndependent/SymbolTable.cpp +++ b/glslang/MachineIndependent/SymbolTable.cpp @@ -188,19 +188,20 @@ TSymbolTableLevel::~TSymbolTableLevel() // // Change all function entries in the table with the non-mangled name -// to be related to the provided built-in operation. This is a low -// performance operation, and only intended for symbol tables that -// live across a large number of compiles. +// to be related to the provided built-in operation. // void TSymbolTableLevel::relateToOperator(const char* name, TOperator op) { - tLevel::iterator it; - for (it = level.begin(); it != level.end(); ++it) { - TFunction* function = (*it).second->getAsFunction(); - if (function) { - if (function->getName() == name) - function->relateToOperator(op); - } + tLevel::const_iterator candidate = level.lower_bound(name); + while (candidate != level.end()) { + const TString& candidateName = (*candidate).first; + TString::size_type parenAt = candidateName.find_first_of('('); + if (parenAt != candidateName.npos && candidateName.substr(0, parenAt) == name) { + TFunction* function = (*candidate).second->getAsFunction(); + function->relateToOperator(op); + } else + break; + ++candidate; } } |