Bug 1048747 - [WebGL2] Query active uniform blocks. r=jgilbert
authorDan Glastonbury <dglastonbury@mozilla.com>
Mon, 27 Oct 2014 09:43:34 +1000
changeset 217031 9d18e1e60d52266f5ed3a539c058301ca08a2de1
parent 217030 da9f14c58aa56a348cf670aa3932bad120abc644
child 217032 52f3f4a553a59c7c71e1b3acb2b4385091d3ccff
push id52209
push userdglastonbury@mozilla.com
push dateMon, 24 Nov 2014 00:21:06 +0000
treeherdermozilla-inbound@9d18e1e60d52 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjgilbert
bugs1048747
milestone36.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 1048747 - [WebGL2] Query active uniform blocks. r=jgilbert
dom/canvas/WebGLContextGL.cpp
--- a/dom/canvas/WebGLContextGL.cpp
+++ b/dom/canvas/WebGLContextGL.cpp
@@ -1439,46 +1439,51 @@ WebGLContext::GetProgramParameter(WebGLP
 
     if (!ValidateObjectAllowDeleted("getProgramParameter: program", prog))
         return JS::NullValue();
 
     GLuint progname = prog->GLName();
 
     MakeContextCurrent();
 
+    GLint i = 0;
+
+    if (IsWebGL2()) {
+        switch (pname) {
+        case LOCAL_GL_ACTIVE_UNIFORM_BLOCKS:
+        case LOCAL_GL_ACTIVE_UNIFORM_BLOCK_MAX_NAME_LENGTH:
+            gl->fGetProgramiv(progname, pname, &i);
+            return JS::Int32Value(i);
+        }
+    }
+
     switch (pname) {
         case LOCAL_GL_ATTACHED_SHADERS:
         case LOCAL_GL_ACTIVE_UNIFORMS:
         case LOCAL_GL_ACTIVE_ATTRIBUTES:
-        {
-            GLint i = 0;
             gl->fGetProgramiv(progname, pname, &i);
             return JS::Int32Value(i);
-        }
+
         case LOCAL_GL_DELETE_STATUS:
             return JS::BooleanValue(prog->IsDeleteRequested());
+
         case LOCAL_GL_LINK_STATUS:
-        {
             return JS::BooleanValue(prog->LinkStatus());
-        }
+
         case LOCAL_GL_VALIDATE_STATUS:
-        {
-            GLint i = 0;
 #ifdef XP_MACOSX
             // See comment in ValidateProgram below.
             if (gl->WorkAroundDriverBugs())
                 i = 1;
             else
                 gl->fGetProgramiv(progname, pname, &i);
 #else
             gl->fGetProgramiv(progname, pname, &i);
 #endif
             return JS::BooleanValue(bool(i));
-        }
-            break;
 
         default:
             ErrorInvalidEnumInfo("getProgramParameter: parameter", pname);
     }
 
     return JS::NullValue();
 }