Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(337)

Unified Diff: src/gpu/gl/GrGLUniformHandler.cpp

Issue 2023783002: Fix incorrect sampler locations when using CHROMIUM_bind_uniform_location (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/gl/GrGLUniformHandler.cpp
diff --git a/src/gpu/gl/GrGLUniformHandler.cpp b/src/gpu/gl/GrGLUniformHandler.cpp
index c4189267f10a144fb02c50df6ef9c9c94998a985..c388e4621be2bf45a79e123e159473ebddd9d827 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 uniformCnt = fUniforms.count();
+ for (int i = 0; i < uniformCnt; ++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 + uniformCnt;
+ GL_CALL(BindUniformLocation(programID, location, fSamplers[i].fShaderVar.c_str()));
+ fSamplers[i].fLocation = location;
}
}
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698