X-Git-Url: https://git.libre-soc.org/?a=blobdiff_plain;f=src%2Fmesa%2Fmain%2Fgetstring.c;h=6e9051188b3b610571ad985aa36e4fe87fe9bf0e;hb=34953f8907fddd0d2b27d276580a1d3223047987;hp=f9d13a7253a760e7a4a629044b1e8970352bcc4e;hpb=cd1b0f04be041fa1750cac332d5539c48a3f272d;p=mesa.git diff --git a/src/mesa/main/getstring.c b/src/mesa/main/getstring.c index f9d13a7253a..6e9051188b3 100644 --- a/src/mesa/main/getstring.c +++ b/src/mesa/main/getstring.c @@ -26,11 +26,12 @@ #include #include "glheader.h" #include "context.h" +#include "debug_output.h" #include "get.h" #include "enums.h" #include "extensions.h" #include "mtypes.h" - +#include "macros.h" /** * Return the string for a glGetString(GL_SHADING_LANGUAGE_VERSION) query. @@ -72,10 +73,20 @@ shading_language_version(struct gl_context *ctx) break; case API_OPENGLES2: - return (ctx->Version < 30) - ? (const GLubyte *) "OpenGL ES GLSL ES 1.0.16" - : (const GLubyte *) "OpenGL ES GLSL ES 3.0"; - + switch (ctx->Version) { + case 20: + return (const GLubyte *) "OpenGL ES GLSL ES 1.0.16"; + case 30: + return (const GLubyte *) "OpenGL ES GLSL ES 3.00"; + case 31: + return (const GLubyte *) "OpenGL ES GLSL ES 3.10"; + case 32: + return (const GLubyte *) "OpenGL ES GLSL ES 3.20"; + default: + _mesa_problem(ctx, + "Invalid OpenGL ES version in shading_language_version()"); + return (const GLubyte *) 0; + } case API_OPENGLES: /* fall-through */ @@ -113,7 +124,7 @@ _mesa_GetString( GLenum name ) assert(ctx->Driver.GetString); { /* Give the driver the chance to handle this query */ - const GLubyte *str = (*ctx->Driver.GetString)(ctx, name); + const GLubyte *str = ctx->Driver.GetString(ctx, name); if (str) return str; } @@ -195,12 +206,18 @@ _mesa_GetPointerv( GLenum pname, GLvoid **params ) { GET_CURRENT_CONTEXT(ctx); const GLuint clientUnit = ctx->Array.ActiveTexture; + const char *callerstr; + + if (_mesa_is_desktop_gl(ctx)) + callerstr = "glGetPointerv"; + else + callerstr = "glGetPointervKHR"; if (!params) return; if (MESA_VERBOSE & VERBOSE_API) - _mesa_debug(ctx, "glGetPointerv %s\n", _mesa_lookup_enum_by_nr(pname)); + _mesa_debug(ctx, "%s %s\n", callerstr, _mesa_enum_to_string(pname)); switch (pname) { case GL_VERTEX_ARRAY_POINTER: @@ -260,10 +277,7 @@ _mesa_GetPointerv( GLenum pname, GLvoid **params ) break; case GL_DEBUG_CALLBACK_FUNCTION_ARB: case GL_DEBUG_CALLBACK_USER_PARAM_ARB: - if (!_mesa_is_desktop_gl(ctx)) - goto invalid_pname; - else - *params = _mesa_get_debug_state_ptr(ctx, pname); + *params = _mesa_get_debug_state_ptr(ctx, pname); break; default: goto invalid_pname; @@ -272,7 +286,7 @@ _mesa_GetPointerv( GLenum pname, GLvoid **params ) return; invalid_pname: - _mesa_error( ctx, GL_INVALID_ENUM, "glGetPointerv" ); + _mesa_error( ctx, GL_INVALID_ENUM, "%s", callerstr); return; } @@ -291,65 +305,9 @@ _mesa_GetError( void ) ASSERT_OUTSIDE_BEGIN_END_WITH_RETVAL(ctx, 0); if (MESA_VERBOSE & VERBOSE_API) - _mesa_debug(ctx, "glGetError <-- %s\n", _mesa_lookup_enum_by_nr(e)); + _mesa_debug(ctx, "glGetError <-- %s\n", _mesa_enum_to_string(e)); ctx->ErrorValue = (GLenum) GL_NO_ERROR; ctx->ErrorDebugCount = 0; return e; } - -/** - * Returns an error code specified by GL_ARB_robustness, or GL_NO_ERROR. - * \return current context status - */ -GLenum GLAPIENTRY -_mesa_GetGraphicsResetStatusARB( void ) -{ - GET_CURRENT_CONTEXT(ctx); - GLenum status = GL_NO_ERROR; - - /* The ARB_robustness specification says: - * - * "If the reset notification behavior is NO_RESET_NOTIFICATION_ARB, - * then the implementation will never deliver notification of reset - * events, and GetGraphicsResetStatusARB will always return NO_ERROR." - */ - if (ctx->Const.ResetStrategy == GL_NO_RESET_NOTIFICATION_ARB) { - if (MESA_VERBOSE & VERBOSE_API) - _mesa_debug(ctx, - "glGetGraphicsResetStatusARB always returns GL_NO_ERROR " - "because reset notifictation was not requested at context " - "creation.\n"); - - return GL_NO_ERROR; - } - - if (ctx->Driver.GetGraphicsResetStatus) { - /* Query the reset status of this context from the driver core. - */ - status = ctx->Driver.GetGraphicsResetStatus(ctx); - - mtx_lock(&ctx->Shared->Mutex); - - /* If this context has not been affected by a GPU reset, check to see if - * some other context in the share group has been affected by a reset. - * If another context saw a reset but this context did not, assume that - * this context was not guilty. - */ - if (status != GL_NO_ERROR) { - ctx->Shared->ShareGroupReset = true; - } else if (ctx->Shared->ShareGroupReset && !ctx->ShareGroupReset) { - status = GL_INNOCENT_CONTEXT_RESET_ARB; - } - - ctx->ShareGroupReset = ctx->Shared->ShareGroupReset; - mtx_unlock(&ctx->Shared->Mutex); - } - - if (!ctx->Driver.GetGraphicsResetStatus && (MESA_VERBOSE & VERBOSE_API)) - _mesa_debug(ctx, - "glGetGraphicsResetStatusARB always returns GL_NO_ERROR " - "because the driver doesn't track reset status.\n"); - - return status; -}