Disallow active attrib aliasing at shader program link time.
BUG=415688
TEST=gpu_unittests, webgl_conformance_tests
[email protected],[email protected]
Review URL: https://codereview.chromium.org/651543003
Cr-Commit-Position: refs/heads/master@{#299387}
diff --git a/gpu/command_buffer/service/gles2_cmd_decoder.cc b/gpu/command_buffer/service/gles2_cmd_decoder.cc
index 95061a688..96121755 100644
--- a/gpu/command_buffer/service/gles2_cmd_decoder.cc
+++ b/gpu/command_buffer/service/gles2_cmd_decoder.cc
@@ -4864,7 +4864,13 @@
if (!program) {
return;
}
+ // At this point, the program's shaders may not be translated yet,
+ // therefore, we may not find the hashed attribute name.
+ // glBindAttribLocation call with original name is useless.
+ // So instead, we should simply cache the binding, and then call
+ // Program::ExecuteBindAttribLocationCalls() right before link.
program->SetAttribLocationBinding(name, static_cast<GLint>(index));
+ // TODO(zmo): Get rid of the following glBindAttribLocation call.
glBindAttribLocation(program->service_id(), index, name);
}