Bug 744888 - Work around a NVIDIA driver bug - r=jgilbert
authorBenoit Jacob <bjacob@mozilla.com>
Mon, 16 Apr 2012 15:56:12 -0400
changeset 91756 e74b044c18b8301b489f71b1ec383c0d3f49c7e6
parent 91755 b56db6eab47c0192cfc80b3baf328e494c394354
child 91757 c61e7c3a232aad0d8fb1bc2455487ce61dd9e182
push id22475
push userbjacob@mozilla.com
push dateMon, 16 Apr 2012 19:56:33 +0000
treeherdermozilla-central@e74b044c18b8 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjgilbert
bugs744888
milestone14.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 744888 - Work around a NVIDIA driver bug - r=jgilbert
gfx/gl/GLContext.h
--- a/gfx/gl/GLContext.h
+++ b/gfx/gl/GLContext.h
@@ -67,16 +67,18 @@
 #include "nsRegion.h"
 #include "nsAutoPtr.h"
 #include "nsThreadUtils.h"
 
 typedef char realGLboolean;
 
 #include "GLContextSymbols.h"
 
+#include "mozilla/mozalloc.h"
+
 namespace mozilla {
   namespace layers {
     class LayerManagerOGL;
     class ColorTextureLayerProgram;
   }
 
 namespace gl {
 class GLContext;
@@ -2023,16 +2025,26 @@ public:
         BEFORE_GL_CALL;
         mSymbols.fBlendFuncSeparate(sfactorRGB, dfactorRGB, sfactorAlpha, dfactorAlpha);
         AFTER_GL_CALL;
     }
 
     void fBufferData(GLenum target, GLsizeiptr size, const GLvoid* data, GLenum usage) {
         BEFORE_GL_CALL;
         mSymbols.fBufferData(target, size, data, usage);
+
+        // bug 744888
+        if (WorkAroundDriverBugs() &&
+            !data &&
+            Vendor() == VendorNVIDIA)
+        {
+            char c = 0;
+            mSymbols.fBufferSubData(target, size-1, 1, &c);
+        }
+
         AFTER_GL_CALL;
     }
 
     void fBufferSubData(GLenum target, GLintptr offset, GLsizeiptr size, const GLvoid* data) {
         BEFORE_GL_CALL;
         mSymbols.fBufferSubData(target, offset, size, data);
         AFTER_GL_CALL;
     }