mesa: recognize enums GL_COLOR_ATTACHMENT8-31 as valid
authorIlia Mirkin <imirkin@alum.mit.edu>
Fri, 12 Feb 2016 18:12:09 +0000 (13:12 -0500)
committerIlia Mirkin <imirkin@alum.mit.edu>
Fri, 12 Feb 2016 23:22:49 +0000 (18:22 -0500)
Similar as for AUX1-3, these enums aren't invalid (i.e. -1) but also not
supported by mesa. Returning BUFFER_COUNT causes the proper error to be
returned by ReadBuffer and other functions. This resolves some failures
in

dEQP-GLES31.functional.debug.negative_coverage.get_error.buffer.read_buffer

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Brian Paul <brianp@vmware.com>
src/mesa/main/buffers.c

index 83e238ae825f6faa348e231784c4f1a594ed80fb..3ca4b66d771a1cf79390f7ceb4da4fa5b5277701 100644 (file)
@@ -159,6 +159,9 @@ draw_buffer_enum_to_bitmask(const struct gl_context *ctx, GLenum buffer)
       case GL_COLOR_ATTACHMENT7_EXT:
          return BUFFER_BIT_COLOR7;
       default:
+         /* not an error, but also not supported */
+         if (buffer >= GL_COLOR_ATTACHMENT8 && buffer <= GL_COLOR_ATTACHMENT31)
+            return 1 << BUFFER_COUNT;
          /* error */
          return BAD_MASK;
    }
@@ -214,6 +217,9 @@ read_buffer_enum_to_index(GLenum buffer)
       case GL_COLOR_ATTACHMENT7_EXT:
          return BUFFER_COLOR7;
       default:
+         /* not an error, but also not supported */
+         if (buffer >= GL_COLOR_ATTACHMENT8 && buffer <= GL_COLOR_ATTACHMENT31)
+            return BUFFER_COUNT;
          /* error */
          return -1;
    }