Bug 1024064 - webgl-1.0.3 Initialize all vertex attributes to default values. r=jgilbert
authorWalter Litwinczyk <wlitwinczyk@mozilla.com>
Thu, 12 Jun 2014 13:27:19 -0700
changeset 188823 2ab8afeb4b2d3b95c5dacd35b687206eb047b6e4
parent 188822 d591d9ed638b51eed04e1719b6479df9fe1db150
child 188824 9603399b9ee1a95a7e2359d3c878e41cc6012ed2
push id44920
push usercbook@mozilla.com
push dateMon, 16 Jun 2014 07:29:24 +0000
treeherdermozilla-inbound@fc765663d8f8 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjgilbert
bugs1024064
milestone33.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 1024064 - webgl-1.0.3 Initialize all vertex attributes to default values. r=jgilbert
content/canvas/src/WebGLContextValidate.cpp
--- a/content/canvas/src/WebGLContextValidate.cpp
+++ b/content/canvas/src/WebGLContextValidate.cpp
@@ -1768,16 +1768,21 @@ WebGLContext::InitAndValidateGL()
 
     if (IsWebGL2() &&
         !InitWebGL2())
     {
         // Todo: Bug 898404: Only allow WebGL2 on GL>=3.0 on desktop GL.
         return false;
     }
 
+    // Default value for all disabled vertex attributes is [0, 0, 0, 1]
+    for (int32_t index = 0; index < mGLMaxVertexAttribs; ++index) {
+        VertexAttrib4f(index, 0, 0, 0, 1);
+    }
+
     mMemoryPressureObserver
         = new WebGLMemoryPressureObserver(this);
     nsCOMPtr<nsIObserverService> observerService
         = mozilla::services::GetObserverService();
     if (observerService) {
         observerService->AddObserver(mMemoryPressureObserver,
                                      "memory-pressure",
                                      false);