On 02/12/2016 11:22 AM, Ilia Mirkin wrote:
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 <imir...@alum.mit.edu>
---
  src/mesa/main/buffers.c | 6 ++++++
  1 file changed, 6 insertions(+)

diff --git a/src/mesa/main/buffers.c b/src/mesa/main/buffers.c
index 83e238a..3ca4b66 100644
--- a/src/mesa/main/buffers.c
+++ b/src/mesa/main/buffers.c
@@ -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;
     }


Reviewed-by: Brian Paul <bri...@vmware.com>

_______________________________________________
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev

Reply via email to