added CPU uniform location lookup optimization
This commit is contained in:
parent
4101006b5e
commit
a7ebf0ddc3
5 changed files with 48 additions and 28490 deletions
|
|
@ -0,0 +1,13 @@
|
|||
#include "Shader.hpp"
|
||||
|
||||
GLint CShader::getUniformLocation(const std::string& unif) {
|
||||
const auto itpos = m_muUniforms.find(unif);
|
||||
|
||||
if (itpos == m_muUniforms.end()) {
|
||||
const auto unifLoc = glGetUniformLocation(program, unif.c_str());
|
||||
m_muUniforms[unif] = unifLoc;
|
||||
return unifLoc;
|
||||
}
|
||||
|
||||
return itpos->second;
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue