mesa: always return GL_OUT_OF_MEMORY or GL_NO_ERROR when KHR_no_error enabled
authorTimothy Arceri <tarceri@itsqueeze.com>
Tue, 28 Mar 2017 03:43:23 +0000 (14:43 +1100)
committerTimothy Arceri <tarceri@itsqueeze.com>
Wed, 19 Apr 2017 06:53:25 +0000 (16:53 +1000)
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
src/mesa/main/getstring.c

index 6e9051188b3b610571ad985aa36e4fe87fe9bf0e..5da405d9fa4cc45bc9870c35e10f074aa54bac85 100644 (file)
@@ -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));