mirror of
https://github.com/hyprwm/Hyprland.git
synced 2025-08-09 16:41:53 -07:00
added CPU uniform location lookup optimization
This commit is contained in:
@@ -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;
|
||||
}
|
Reference in New Issue
Block a user