Skip to content

Commit

Permalink
libgui|GLProgram: Ignore uniforms not present in the linked program
Browse files Browse the repository at this point in the history
This facilitates use of common uniforms like uMapTime that are declared
in the generic shaders but may not end up being used, and thus are
removed at link time.
  • Loading branch information
skyjake committed Dec 18, 2015
1 parent 1235616 commit 331d854
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion doomsday/sdk/libgui/src/graphics/glprogram.cpp
Expand Up @@ -429,7 +429,12 @@ GLProgram &GLProgram::bind(GLUniform const &uniform)
{
if(!d->allBound.contains(&uniform))
{
d->addBinding(&uniform);
// If the program is already linked, we can check which uniforms it
// actually has.
if(!isReady() || glHasUniform(uniform.name()))
{
d->addBinding(&uniform);
}
}
return *this;
}
Expand Down

0 comments on commit 331d854

Please sign in to comment.