Index: src/gpu/gl/GrGLUniformHandler.cpp |
diff --git a/src/gpu/gl/GrGLUniformHandler.cpp b/src/gpu/gl/GrGLUniformHandler.cpp |
index c4189267f10a144fb02c50df6ef9c9c94998a985..926d72973d3b4464a375962ce5d3bbb855d421b8 100644 |
--- a/src/gpu/gl/GrGLUniformHandler.cpp |
+++ b/src/gpu/gl/GrGLUniformHandler.cpp |
@@ -85,14 +85,15 @@ void GrGLUniformHandler::appendUniformDecls(GrShaderFlags visibility, SkString* |
void GrGLUniformHandler::bindUniformLocations(GrGLuint programID, const GrGLCaps& caps) { |
if (caps.bindUniformLocationSupport()) { |
- int count = fUniforms.count(); |
- for (int i = 0; i < count; ++i) { |
+ int uniformCount = fUniforms.count(); |
+ for (int i = 0; i < uniformCount; ++i) { |
GL_CALL(BindUniformLocation(programID, i, fUniforms[i].fVariable.c_str())); |
fUniforms[i].fLocation = i; |
} |
for (int i = 0; i < fSamplers.count(); ++i) { |
- GL_CALL(BindUniformLocation(programID, i, fSamplers[i].fShaderVar.c_str())); |
- fSamplers[i].fLocation = i; |
+ GrGLint location = i + uniformCount; |
+ GL_CALL(BindUniformLocation(programID, location, fSamplers[i].fShaderVar.c_str())); |
+ fSamplers[i].fLocation = location; |
} |
} |
} |