Lines Matching full:variable
21 * \brief Variable manager.
95 ValueEntry::ValueEntry (const Variable* variable) in ValueEntry() argument
96 : m_variable (variable) in ValueEntry()
97 , m_valueRange (variable->getType()) in ValueEntry()
107 …for (vector<Variable*>::iterator i = m_declaredVariables.begin(); i != m_declaredVariables.end(); … in ~VariableScope()
110 for (vector<Variable*>::iterator i = m_liveVariables.begin(); i != m_liveVariables.end(); i++) in ~VariableScope()
114 Variable* VariableScope::allocate (const VariableType& type, Variable::Storage storage, const char*… in allocate()
116 Variable* variable = new Variable(type, storage, name); in allocate() local
119 m_liveVariables.push_back(variable); in allocate()
120 return variable; in allocate()
124 delete variable; in allocate()
129 void VariableScope::declare (Variable* variable) in declare() argument
131 m_declaredVariables.push_back(variable); in declare()
132 removeLive(variable); in declare()
135 void VariableScope::removeLive (const Variable* variable) in removeLive() argument
137 …vector<Variable*>::iterator pos = std::find(m_liveVariables.begin(), m_liveVariables.end(), variab… in removeLive()
160 ValueEntry* ValueScope::allocate (const Variable* variable) in allocate() argument
162 ValueEntry* entry = new ValueEntry(variable); in allocate()
178 CompareEntryVariable (const Variable* variable) in CompareEntryVariable() argument
179 : m_variable(variable) in CompareEntryVariable()
189 const Variable* m_variable;
197 ValueEntry* ValueScope::findEntry (const Variable* variable) const in findEntry()
199 …const_iterator pos = std::find(m_entries.begin(), m_entries.end(), CompareEntryVariable(variable)); in findEntry()
203 void ValueScope::setValue (const Variable* variable, ConstValueRangeAccess value) in setValue() argument
205 ValueEntry* entry = findEntry(variable); in setValue()
213 void ValueScope::removeValue (const Variable* variable) in removeValue() argument
215 …ry*>::iterator pos = std::find(m_entries.begin(), m_entries.end(), CompareEntryVariable(variable)); in removeValue()
237 Variable* VariableManager::allocate (const VariableType& type) in allocate()
239 return allocate(type, Variable::STORAGE_LOCAL, m_nameAllocator.allocate().c_str()); in allocate()
242 Variable* VariableManager::allocate (const VariableType& type, Variable::Storage storage, const cha… in allocate()
249 Variable* variable = varScope.allocate(type, Variable::STORAGE_LOCAL, name); in allocate() local
252 ValueEntry* valueEntry = valueScope.allocate(variable); in allocate()
260 setStorage(variable, storage); in allocate()
262 return variable; in allocate()
265 void VariableManager::setStorage (Variable* variable, Variable::Storage storage) in setStorage() argument
267 int numScalars = variable->getType().getScalarSize(); in setStorage()
270 if (variable->getStorage() == Variable::STORAGE_SHADER_IN) in setStorage()
275 else if (variable->getStorage() == Variable::STORAGE_UNIFORM) in setStorage()
279 if (storage == Variable::STORAGE_SHADER_IN) in setStorage()
284 else if (storage == Variable::STORAGE_UNIFORM) in setStorage()
287 variable->setStorage(storage); in setStorage()
290 bool VariableManager::canDeclareInCurrentScope (const Variable* variable) const in canDeclareInCurrentScope()
292 const vector<Variable*>& curLiveVars = getCurVariableScope().getLiveVariables(); in canDeclareInCurrentScope()
293 return std::find(curLiveVars.begin(), curLiveVars.end(), variable) != curLiveVars.end(); in canDeclareInCurrentScope()
296 const vector<Variable*>& VariableManager::getLiveVariables (void) const in getLiveVariables()
301 void VariableManager::declareVariable (Variable* variable) in declareVariable() argument
304 …iterator pos = std::find(m_entryCache.begin(), m_entryCache.end(), CompareEntryVariable(variable)); in declareVariable()
308 …DE_ASSERT(std::find(m_entryCache.begin(), m_entryCache.end(), CompareEntryVariable(variable)) == m… in declareVariable()
314 scope->removeValue(variable); in declareVariable()
318 getCurVariableScope().declare(variable); in declareVariable()
321 const ValueEntry* VariableManager::getValue (const Variable* variable) const in getValue()
323 …iterator pos = std::find(m_entryCache.begin(), m_entryCache.end(), CompareEntryVariable(variable)); in getValue()
327 void VariableManager::removeValueFromCurrentScope (const Variable* variable) in removeValueFromCurrentScope() argument
330 …iterator pos = std::find(m_entryCache.begin(), m_entryCache.end(), CompareEntryVariable(variable)); in removeValueFromCurrentScope()
335 getCurValueScope().removeValue(variable); in removeValueFromCurrentScope()
338 const ValueEntry* VariableManager::getParentValue (const Variable* variable) const in getParentValue()
346 ValueEntry* entry = scope->findEntry(variable); in getParentValue()
355 void VariableManager::setValue (const Variable* variable, ConstValueRangeAccess value) in setValue() argument
359 if (!curScope.findEntry(variable)) in setValue()
362 ValueEntry* newEntry = curScope.allocate(variable); in setValue()
363 …tor cachePos = std::find(m_entryCache.begin(), m_entryCache.end(), CompareEntryVariable(variable)); in setValue()
371 curScope.setValue(variable, value); in setValue()
405 vector<Variable*>& curLiveVars = curScope.getLiveVariables(); in popVariableScope()
406 vector<Variable*>& parenLiveVars = parentScope.getLiveVariables(); in popVariableScope()
410 Variable* liveVar = curLiveVars.back(); in popVariableScope()
444 map<const Variable*, const ValueEntry*> oldValues; in popValueScope()
450 set<const Variable*> addedVars; in popValueScope()
461 const Variable* var = entry->getVariable(); in popValueScope()
488 addedVars.insert(var); // Record as cached variable. in popValueScope()
496 const Variable* var = oldEntry->getVariable(); in popValueScope()