Commit 7ae353d9 by Nicolas Capens

Work around non-compliant behavior for Google Maps.

Bug 18703920 Change-Id: Ifde19f323e4025e2fd2ce24056e38073e373feb3 Reviewed-on: https://swiftshader-review.googlesource.com/2300Reviewed-by: 's avatarNicolas Capens <capn@google.com> Tested-by: 's avatarNicolas Capens <capn@google.com>
parent a6fb2e0d
......@@ -2580,6 +2580,26 @@ void GL_APIENTRY glGetIntegerv(GLenum pname, GLint* params)
es2::Context *context = es2::getContext();
if(!context)
{
ERR("glGetIntegerv() called without current context."); // Not strictly an error, but probably unintended or attempting to rely on non-compliant behavior
// This is not spec compliant! When there is no current GL context, functions should
// have no side effects. Google Maps queries these values before creating a context,
// so we need this as a bug-compatible workaround.
switch(pname)
{
case GL_MAX_TEXTURE_SIZE: *params = es2::IMPLEMENTATION_MAX_TEXTURE_SIZE; return;
case GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS: *params = es2::MAX_VERTEX_TEXTURE_IMAGE_UNITS; return;
case GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS: *params = es2::MAX_COMBINED_TEXTURE_IMAGE_UNITS; return;
case GL_STENCIL_BITS: *params = 8; return;
case GL_ALIASED_LINE_WIDTH_RANGE:
params[0] = (GLint)es2::ALIASED_LINE_WIDTH_RANGE_MIN;
params[1] = (GLint)es2::ALIASED_LINE_WIDTH_RANGE_MAX;
return;
}
}
if(context)
{
if(!(context->getIntegerv(pname, params)))
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment