Re-add uniform location checks even though they aren't needed

Spec says that setting uniform -1 does nothing.
This commit is contained in:
Henrik Rydgard 2013-12-02 23:35:49 +01:00
parent 7c7c4aaadc
commit 198e230cdc

View File

@ -236,11 +236,14 @@ void FramebufferManager::CompileDraw2DProgram() {
} }
int deltaLoc = glsl_uniform_loc(postShaderProgram_, "u_texelDelta"); int deltaLoc = glsl_uniform_loc(postShaderProgram_, "u_texelDelta");
glUniform2f(deltaLoc, u_delta, v_delta); if (deltaLoc != -1)
glUniform2f(deltaLoc, u_delta, v_delta);
int pixelDeltaLoc = glsl_uniform_loc(postShaderProgram_, "u_pixelDelta"); int pixelDeltaLoc = glsl_uniform_loc(postShaderProgram_, "u_pixelDelta");
glUniform2f(pixelDeltaLoc, u_pixel_delta, v_pixel_delta); if (pixelDeltaLoc != -1)
glUniform2f(pixelDeltaLoc, u_pixel_delta, v_pixel_delta);
timeLoc_ = glsl_uniform_loc(postShaderProgram_, "u_time"); timeLoc_ = glsl_uniform_loc(postShaderProgram_, "u_time");
glUniform4f(timeLoc_, 0.0f, 0.0f, 0.0f, 0.0f); if (timeLoc_ != -1)
glUniform4f(timeLoc_, 0.0f, 0.0f, 0.0f, 0.0f);
usePostShader_ = true; usePostShader_ = true;
} }