am 42d5bd12: am ad3f4df3: Merge "opengles emulator: limit GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS"

* commit '42d5bd124b94dbcc684c8c3840891bbb54278071':
  opengles emulator: limit GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS
This commit is contained in:
David Turner
2011-08-09 10:06:32 -07:00
committed by Android Git Automerger
2 changed files with 20 additions and 0 deletions

View File

@@ -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);

View File

@@ -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);
}