Avoid calling expensive GLShader::setUniform overload

REVIEW: 111196
This commit is contained in:
Casian Andrei 2013-06-02 16:02:58 +03:00
parent 40acb1da14
commit 8f92e2ab91
3 changed files with 4 additions and 1 deletions

View file

@ -352,7 +352,7 @@ void ColorCorrection::setupForOutput(int screen)
d->m_ccTextureUnit = maxUnits - 1;
}
if (!shader->setUniform("u_ccLookupTexture", d->m_ccTextureUnit)) {
if (!shader->setUniform(GLShader::ColorCorrectionLookupTextureUnit, d->m_ccTextureUnit)) {
kError(1212) << "unable to set uniform for the color correction lookup texture";
d->m_hasError = true;
emit errorOccured();

View file

@ -494,6 +494,8 @@ void GLShader::resolveLocations()
mFloatLocation[Saturation] = uniformLocation("saturation");
mIntLocation[ColorCorrectionLookupTextureUnit] = uniformLocation("u_ccLookupTexture");
mColorLocation[Color] = uniformLocation("geometryColor");
mLocationsResolved = true;

View file

@ -196,6 +196,7 @@ public:
enum IntUniform {
AlphaToOne, ///< @deprecated no longer used
ColorCorrectionLookupTextureUnit,
IntUniformCount
};