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 6c63762af..b0ef13182 100644 --- a/tools/emulator/opengl/host/libs/Translator/GLES_CM/GLEScmImp.cpp +++ b/tools/emulator/opengl/host/libs/Translator/GLES_CM/GLEScmImp.cpp @@ -902,6 +902,16 @@ GL_API void GL_APIENTRY glGetIntegerv( GLenum pname, GLint *params) { ctx->dispatcher().glGetFloatv(pname,&f); *params = (int)(f * (float)0x7fffffff); break; + case GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS: + ctx->dispatcher().glGetIntegerv(pname,params); + if(*params > 16) + { + // GLES spec requires only 2, and the ATI driver erronously + // returns 32 (although it supports only 16). This WAR is simple, + // compliant and good enough for developers. + *params = 16; + } + break; default: ctx->dispatcher().glGetIntegerv(pname,params); diff --git a/tools/emulator/opengl/host/libs/Translator/GLES_V2/GLESv2Imp.cpp b/tools/emulator/opengl/host/libs/Translator/GLES_V2/GLESv2Imp.cpp index fd918f484..69781f1f0 100644 --- a/tools/emulator/opengl/host/libs/Translator/GLES_V2/GLESv2Imp.cpp +++ b/tools/emulator/opengl/host/libs/Translator/GLES_V2/GLESv2Imp.cpp @@ -899,6 +899,16 @@ GL_APICALL void GL_APIENTRY glGetIntegerv(GLenum pname, GLint* params){ *params = 16; break; + case GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS: + ctx->dispatcher().glGetIntegerv(pname,params); + if(*params > 16) + { + // GLES spec requires only 2, and the ATI driver erronously + // returns 32 (although it supports only 16). This WAR is simple, + // compliant and good enough for developers. + *params = 16; + } + break; default: ctx->dispatcher().glGetIntegerv(pname,params); }