diff options
author | Timothy Arceri <[email protected]> | 2017-03-28 14:43:23 +1100 |
---|---|---|
committer | Timothy Arceri <[email protected]> | 2017-04-19 16:53:25 +1000 |
commit | 2c9ac0bc6377800ac5110c781dfabea68efa79a5 (patch) | |
tree | 3dfa3b16722e1b12493d6c2b2e326d0482ed90cf /src/mesa/main/getstring.c | |
parent | 3ff1fce6c9a3cc81ada6df62f6c77e345132ca2c (diff) |
mesa: always return GL_OUT_OF_MEMORY or GL_NO_ERROR when KHR_no_error enabled
Reviewed-by: Nicolai Hähnle <[email protected]>
Diffstat (limited to 'src/mesa/main/getstring.c')
-rw-r--r-- | src/mesa/main/getstring.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/mesa/main/getstring.c b/src/mesa/main/getstring.c index 6e9051188b3..5da405d9fa4 100644 --- a/src/mesa/main/getstring.c +++ b/src/mesa/main/getstring.c @@ -304,6 +304,17 @@ _mesa_GetError( void ) GLenum e = ctx->ErrorValue; ASSERT_OUTSIDE_BEGIN_END_WITH_RETVAL(ctx, 0); + /* From Issue (3) of the KHR_no_error spec: + * + * "Should glGetError() always return NO_ERROR or have undefined + * results? + * + * RESOLVED: It should for all errors except OUT_OF_MEMORY." + */ + if (_mesa_is_no_error_enabled(ctx) && e != GL_OUT_OF_MEMORY) { + e = GL_NO_ERROR; + } + if (MESA_VERBOSE & VERBOSE_API) _mesa_debug(ctx, "glGetError <-- %s\n", _mesa_enum_to_string(e)); |