X-Git-Url: https://git.libre-soc.org/?a=blobdiff_plain;f=src%2Fmesa%2Fmain%2Fgetstring.c;h=6e9051188b3b610571ad985aa36e4fe87fe9bf0e;hb=34953f8907fddd0d2b27d276580a1d3223047987;hp=125b03aeca6dcec8489259c271b3023737b5d9f4;hpb=85008db1d51f923113832394d7f8d6b1868be882;p=mesa.git diff --git a/src/mesa/main/getstring.c b/src/mesa/main/getstring.c index 125b03aeca6..6e9051188b3 100644 --- a/src/mesa/main/getstring.c +++ b/src/mesa/main/getstring.c @@ -32,7 +32,6 @@ #include "extensions.h" #include "mtypes.h" #include "macros.h" -#include "main/dispatch.h" /* for _gloffset_COUNT */ /** * Return the string for a glGetString(GL_SHADING_LANGUAGE_VERSION) query. @@ -81,6 +80,8 @@ shading_language_version(struct gl_context *ctx) 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()"); @@ -310,138 +311,3 @@ _mesa_GetError( void ) ctx->ErrorDebugCount = 0; return e; } - -static void -_context_lost_GetSynciv(GLsync sync, GLenum pname, GLsizei bufSize, GLsizei *length, - GLint *values) -{ - GET_CURRENT_CONTEXT(ctx); - if (ctx) - _mesa_error(ctx, GL_CONTEXT_LOST, "GetSynciv(invalid call)"); - - if (pname == GL_SYNC_STATUS && bufSize >= 1) - *values = GL_SIGNALED; -} - -static void -_context_lost_GetQueryObjectuiv(GLuint id, GLenum pname, GLuint *params) -{ - GET_CURRENT_CONTEXT(ctx); - if (ctx) - _mesa_error(ctx, GL_CONTEXT_LOST, "GetQueryObjectuiv(context lost)"); - - if (pname == GL_QUERY_RESULT_AVAILABLE) - *params = GL_TRUE; -} - -static int -context_lost_nop_handler(void) -{ - GET_CURRENT_CONTEXT(ctx); - if (ctx) - _mesa_error(ctx, GL_CONTEXT_LOST, "context lost"); - - return 0; -} - -void -_mesa_set_context_lost_dispatch(struct gl_context *ctx) -{ - if (ctx->ContextLost == NULL) { - int numEntries = MAX2(_glapi_get_dispatch_table_size(), _gloffset_COUNT); - - ctx->ContextLost = malloc(numEntries * sizeof(_glapi_proc)); - if (!ctx->ContextLost) - return; - - _glapi_proc *entry = (_glapi_proc *) ctx->ContextLost; - unsigned i; - for (i = 0; i < numEntries; i++) - entry[i] = (_glapi_proc) context_lost_nop_handler; - - /* The ARB_robustness specification says: - * - * "* GetError and GetGraphicsResetStatus behave normally following a - * graphics reset, so that the application can determine a reset - * has occurred, and when it is safe to destroy and recreate the - * context. - * - * * Any commands which might cause a polling application to block - * indefinitely will generate a CONTEXT_LOST error, but will also - * return a value indicating completion to the application. Such - * commands include: - * - * + GetSynciv with SYNC_STATUS ignores the other - * parameters and returns SIGNALED in . - * - * + GetQueryObjectuiv with QUERY_RESULT_AVAILABLE - * ignores the other parameters and returns TRUE in ." - */ - SET_GetError(ctx->ContextLost, _mesa_GetError); - SET_GetGraphicsResetStatusARB(ctx->ContextLost, _mesa_GetGraphicsResetStatusARB); - SET_GetSynciv(ctx->ContextLost, _context_lost_GetSynciv); - SET_GetQueryObjectuiv(ctx->ContextLost, _context_lost_GetQueryObjectuiv); - } - - ctx->CurrentDispatch = ctx->ContextLost; - _glapi_set_dispatch(ctx->CurrentDispatch); -} - -/** - * 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 (status != GL_NO_ERROR) - _mesa_set_context_lost_dispatch(ctx); - - 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; -}