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.
This commit is contained in:
Dan Glastonbury 2015-06-09 10:35:20 +10:00
parent 0d36dd1d7d
commit 3c78a389e6

View File

@ -58,7 +58,6 @@ WebGL2Context::GetParameter(JSContext* cx, GLenum pname, ErrorResult& rv)
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:
@ -74,6 +73,14 @@ WebGL2Context::GetParameter(JSContext* cx, GLenum pname, ErrorResult& rv)
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
@ -88,7 +95,7 @@ WebGL2Context::GetParameter(JSContext* cx, GLenum pname, ErrorResult& rv)
}
// GLuint64
/* GLuint64 */
case LOCAL_GL_MAX_SERVER_WAIT_TIMEOUT: {
GLuint64 val;
gl->fGetInteger64v(pname, (GLint64*) &val);