Bug 750527 - Rebind program if current program is relinked - r=bjacob
authorJeff Gilbert <jgilbert@mozilla.com>
Wed, 30 May 2012 17:00:38 -0700
changeset 95305 60ac5e1aba1592e5a7adb11929826fa68bc0a700
parent 95304 02e49bc6ead9943d67f0c4bc14be35bbd4f37235
child 95306 feec545f5f9831ba50a27748afa0b9705517a8aa
push id10056
push userjgilbert@mozilla.com
push dateThu, 31 May 2012 00:01:02 +0000
treeherdermozilla-inbound@60ac5e1aba15 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbjacob
bugs750527
milestone15.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 750527 - Rebind program if current program is relinked - r=bjacob
content/canvas/src/WebGLContextGL.cpp
--- a/content/canvas/src/WebGLContextGL.cpp
+++ b/content/canvas/src/WebGLContextGL.cpp
@@ -3703,16 +3703,25 @@ WebGLContext::LinkProgram(WebGLProgram *
     MakeContextCurrent();
     gl->fLinkProgram(progname);
 
     GLint ok;
     gl->fGetProgramiv(progname, LOCAL_GL_LINK_STATUS, &ok);
     if (ok) {
         bool updateInfoSucceeded = program->UpdateInfo();
         program->SetLinkStatus(updateInfoSucceeded);
+
+        // Bug 750527
+        if (gl->WorkAroundDriverBugs() &&
+            updateInfoSucceeded &&
+            gl->Vendor() == gl::GLContext::VendorNVIDIA)
+        {
+            if (program == mCurrentProgram)
+                gl->fUseProgram(progname);
+        }
     } else {
         program->SetLinkStatus(false);
 
         if (ShouldGenerateWarnings()) {
 
             // report shader/program infoLogs as warnings.
             // note that shader compilation errors can be deferred to linkProgram,
             // which is why we can't do anything in compileShader. In practice we could