Disable CHROMIUM_bind_uniform_location due to a spec bug

Bound uniforms that are optimized away causes GL errors
when they are used.

The bound location becomes unused if its bound uniform is
optimized away. Updating the inactive uniform using the
bound location causes a GL error from the command buffer.

Alternatively, command buffer may bind another free, unbound
uniform to the bound location. This causes the uniform update to
update the wrong uniform.

Disable the extension until the spec can be clarified and the
implementation fixed, if possible and needed.

BUG=skia:4454

Review URL: https://codereview.chromium.org/1417633008
This commit is contained in:
kkinnunen 2015-10-28 06:18:35 -07:00 committed by Commit bot
parent 963037c121
commit 177519e5be
2 changed files with 5 additions and 2 deletions

View File

@ -269,7 +269,11 @@ void GrGLCaps::init(const GrContextOptions& contextOptions,
} }
} }
#if 0 // Disabled due to http://skbug.com/4454
fBindUniformLocationSupport = ctxInfo.hasExtension("GL_CHROMIUM_bind_uniform_location"); fBindUniformLocationSupport = ctxInfo.hasExtension("GL_CHROMIUM_bind_uniform_location");
#else
fBindUniformLocationSupport = false;
#endif
#ifdef SK_BUILD_FOR_WIN #ifdef SK_BUILD_FOR_WIN
// We're assuming that on Windows Chromium we're using ANGLE. // We're assuming that on Windows Chromium we're using ANGLE.

View File

@ -474,8 +474,7 @@ bool GrGLProgramBuilder::checkLinkStatus(GrGLuint programID) {
} }
void GrGLProgramBuilder::resolveProgramResourceLocations(GrGLuint programID) { void GrGLProgramBuilder::resolveProgramResourceLocations(GrGLuint programID) {
bool usingBindUniform = fGpu->glInterface()->fFunctions.fBindUniformLocation != nullptr; if (!fGpu->glCaps().bindUniformLocationSupport()) {
if (!usingBindUniform) {
int count = fUniforms.count(); int count = fUniforms.count();
for (int i = 0; i < count; ++i) { for (int i = 0; i < count; ++i) {
GrGLint location; GrGLint location;