Bug 1170855 - Part 9: MAX_VARYING_COMPONENTS workaround. r=jgilbert
☠☠ backed out by 862dd46b819f ☠ ☠
authorDan Glastonbury <dglastonbury@mozilla.com>
Tue, 09 Jun 2015 10:35:20 +1000
changeset 248216 ae7c769cb78d15224abc36775ccdfd2e9b09ed20
parent 248215 1fbb0ef29363d45916a02eee014b41d8b3990a98
child 248217 49284df5294ef92938030317b66b2b18de245cca
push id28893
push userkwierso@gmail.com
push dateFri, 12 Jun 2015 00:02:58 +0000
treeherderautoland@8cf9d3e497f9 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjgilbert
bugs1170855
milestone41.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 1170855 - Part 9: MAX_VARYING_COMPONENTS workaround. r=jgilbert Turns of querying MAX_VARYING_COMPONENTS on OS X 10.10 is buggy. Always returns 1. The spec says that the value is 4 times MAX_VARYING_VECTORS so work around using that method.
dom/canvas/WebGL2ContextState.cpp
--- a/dom/canvas/WebGL2ContextState.cpp
+++ b/dom/canvas/WebGL2ContextState.cpp
@@ -53,47 +53,54 @@ WebGL2Context::GetParameter(JSContext* c
     case LOCAL_GL_MAX_FRAGMENT_UNIFORM_COMPONENTS:
     case LOCAL_GL_MAX_PROGRAM_TEXEL_OFFSET:
     case LOCAL_GL_MAX_SAMPLES:
     case LOCAL_GL_MAX_TEXTURE_LOD_BIAS:
     case LOCAL_GL_MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS:
     case LOCAL_GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS:
     case LOCAL_GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS:
     case LOCAL_GL_MAX_UNIFORM_BUFFER_BINDINGS:
-    case LOCAL_GL_MAX_VARYING_COMPONENTS:
     case LOCAL_GL_MAX_VERTEX_OUTPUT_COMPONENTS:
     case LOCAL_GL_MAX_VERTEX_UNIFORM_BLOCKS:
     case LOCAL_GL_MAX_VERTEX_UNIFORM_COMPONENTS:
     case LOCAL_GL_MIN_PROGRAM_TEXEL_OFFSET:
     case LOCAL_GL_PACK_ROW_LENGTH:
     case LOCAL_GL_PACK_SKIP_PIXELS:
     case LOCAL_GL_PACK_SKIP_ROWS:
     case LOCAL_GL_UNIFORM_BUFFER_OFFSET_ALIGNMENT:
     case LOCAL_GL_UNPACK_IMAGE_HEIGHT:
     case LOCAL_GL_UNPACK_ROW_LENGTH: {
       GLint val;
       gl->fGetIntegerv(pname, &val);
       return JS::Int32Value(val);
     }
 
+    case LOCAL_GL_MAX_VARYING_COMPONENTS: {
+      // On OS X Core Profile this is buggy.  The spec says that the
+      // value is 4 * GL_MAX_VARYING_VECTORS
+      GLint val;
+      gl->fGetIntegerv(LOCAL_GL_MAX_VARYING_VECTORS, &val);
+      return JS::Int32Value(4*val);
+    }
+
     /* GLint64 */
     case LOCAL_GL_MAX_CLIENT_WAIT_TIMEOUT_WEBGL:
       return JS::NumberValue(0); // TODO
 
     case LOCAL_GL_MAX_ELEMENT_INDEX:
     case LOCAL_GL_MAX_COMBINED_FRAGMENT_UNIFORM_COMPONENTS:
     case LOCAL_GL_MAX_COMBINED_VERTEX_UNIFORM_COMPONENTS:
     case LOCAL_GL_MAX_UNIFORM_BLOCK_SIZE: {
       GLint64 val;
       gl->fGetInteger64v(pname, &val);
       return JS::DoubleValue(static_cast<double>(val));
     }
 
 
-      // GLuint64
+    /* GLuint64 */
     case LOCAL_GL_MAX_SERVER_WAIT_TIMEOUT: {
       GLuint64 val;
       gl->fGetInteger64v(pname, (GLint64*) &val);
       return JS::DoubleValue(static_cast<double>(val));
     }
 
     case LOCAL_GL_COPY_READ_BUFFER_BINDING:
       return WebGLObjectAsJSValue(cx, mBoundCopyReadBuffer.get(), rv);