From: Brian Paul Date: Thu, 13 Jan 2011 01:12:46 +0000 (-0700) Subject: mesa: don't assert in GetIntegerIndexed, etc X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=67722ae403526d8b267e29ed2ac962b806001ce5;p=mesa.git mesa: don't assert in GetIntegerIndexed, etc We were getting an assertion upon invalid pname. NOTE: This is a candidate for the 7.9 and 7.10 branches. --- diff --git a/src/mesa/main/get.c b/src/mesa/main/get.c index 5d26f74bbc2..196ac5d1201 100644 --- a/src/mesa/main/get.c +++ b/src/mesa/main/get.c @@ -2311,8 +2311,10 @@ void GLAPIENTRY _mesa_GetBooleanIndexedv( GLenum pname, GLuint index, GLboolean *params ) { union value v; + enum value_type type = + find_value_indexed("glGetBooleanIndexedv", pname, index, &v); - switch (find_value_indexed("glGetBooleanIndexedv", pname, index, &v)) { + switch (type) { case TYPE_INT: params[0] = INT_TO_BOOLEAN(v.value_int); break; @@ -2326,7 +2328,7 @@ _mesa_GetBooleanIndexedv( GLenum pname, GLuint index, GLboolean *params ) params[0] = INT64_TO_BOOLEAN(v.value_int); break; default: - assert(0); + ; /* nothing - GL error was recorded */ } } @@ -2334,8 +2336,10 @@ void GLAPIENTRY _mesa_GetIntegerIndexedv( GLenum pname, GLuint index, GLint *params ) { union value v; + enum value_type type = + find_value_indexed("glGetIntegerIndexedv", pname, index, &v); - switch (find_value_indexed("glGetIntegerIndexedv", pname, index, &v)) { + switch (type) { case TYPE_INT: params[0] = v.value_int; break; @@ -2349,7 +2353,7 @@ _mesa_GetIntegerIndexedv( GLenum pname, GLuint index, GLint *params ) params[0] = INT64_TO_INT(v.value_int); break; default: - assert(0); + ; /* nothing - GL error was recorded */ } } @@ -2358,8 +2362,10 @@ void GLAPIENTRY _mesa_GetInteger64Indexedv( GLenum pname, GLuint index, GLint64 *params ) { union value v; + enum value_type type = + find_value_indexed("glGetIntegerIndexedv", pname, index, &v); - switch (find_value_indexed("glGetIntegerIndexedv", pname, index, &v)) { + switch (type) { case TYPE_INT: params[0] = v.value_int; break; @@ -2373,7 +2379,7 @@ _mesa_GetInteger64Indexedv( GLenum pname, GLuint index, GLint64 *params ) params[0] = v.value_int; break; default: - assert(0); + ; /* nothing - GL error was recorded */ } } #endif /* FEATURE_ARB_sync */