From 926db88dd1e199980cdafa06d09f5ac83c155b22 Mon Sep 17 00:00:00 2001 From: Yochai Shefi Simchon Date: Mon, 25 Jul 2011 14:59:34 +0300 Subject: [PATCH] 1.1 translator: glGet(GL_MAX_CLIP_PLANES) returns max 6 This is a WAR for an ATI OpenGL driver bug. Change-Id: I0b54317873ed8c60fe835a993c2c8f32321ff8e2 --- .../opengl/host/libs/Translator/GLES_CM/GLEScmImp.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/tools/emulator/opengl/host/libs/Translator/GLES_CM/GLEScmImp.cpp b/tools/emulator/opengl/host/libs/Translator/GLES_CM/GLEScmImp.cpp index f6cf31f51..6fde8a5bf 100644 --- a/tools/emulator/opengl/host/libs/Translator/GLES_CM/GLEScmImp.cpp +++ b/tools/emulator/opengl/host/libs/Translator/GLES_CM/GLEScmImp.cpp @@ -886,6 +886,16 @@ GL_API void GL_APIENTRY glGetIntegerv( GLenum pname, GLint *params) { case GL_COMPRESSED_TEXTURE_FORMATS: getCompressedFormats(params); break; + case GL_MAX_CLIP_PLANES: + ctx->dispatcher().glGetIntegerv(pname,params); + if(*params > 6) + { + // GLES spec requires only 6, and the ATI driver erronously + // returns 8 (although it supports only 6). This WAR is simple, + // compliant and good enough for developers. + *params = 6; + } + break; default: ctx->dispatcher().glGetIntegerv(pname,params); }