mirror of
https://github.com/love2d/love.git
synced 2026-08-16 08:11:02 +02:00
Add uniform cache in pixel effect. Remove a compiler warning and debug output.
This commit is contained in:
@@ -241,12 +241,18 @@ namespace opengl
|
||||
|
||||
GLint PixelEffect::getUniformLocation(const std::string& name)
|
||||
{
|
||||
std::map<std::string, GLint>::const_iterator it = _uniforms.find(name);
|
||||
if (it != _uniforms.end())
|
||||
return it->second;
|
||||
|
||||
GLint location = glGetUniformLocation(_program, name.c_str());
|
||||
if (location == -1) {
|
||||
throw love::Exception(
|
||||
"Cannot get location of shader variable `%s'.\n"
|
||||
"A common error is to define but not use the variable.", name.c_str());
|
||||
}
|
||||
|
||||
_uniforms[name] = location;
|
||||
return location;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user