Makes framebuffer_blit_coverage_default_draw_buffer_binding.test in
gles3 conformance pass.

Signed-off-by: Anuj Phogat <anuj.pho...@gmail.com>
---
 src/mesa/main/buffers.c |   11 ++++++++++-
 1 files changed, 10 insertions(+), 1 deletions(-)

diff --git a/src/mesa/main/buffers.c b/src/mesa/main/buffers.c
index c2a02c0..dff3c0e 100644
--- a/src/mesa/main/buffers.c
+++ b/src/mesa/main/buffers.c
@@ -339,8 +339,17 @@ _mesa_DrawBuffers(GLsizei n, const GLenum *buffers)
           *  the error INVALID_OPERATION.  This restriction is because these
           *  constants may themselves refer to multiple buffers, as shown in
           *  table 4.4."
+         *
+         *  from OpenGL ES 3.0 specification, Page 180:
+         *  "If the GL is bound to the default framebuffer, then n must be 1
+         *  and the constant must be BACK or NONE. When draw buffer zero is 
BACK,
+         *  color values are written into the sole buffer for single-buffered
+         *  contexts, or into the back buffer for double- buffered contexts.
+         *  If DrawBuffers is supplied with a constant other than BACK and
+         *  NONE, the error INVALID_OPERATION is generated."
           */
-         if (_mesa_bitcount(destMask[output]) > 1) {
+         if (!(_mesa_is_gles3(ctx) && buffers[output] == GL_BACK) &&
+            _mesa_bitcount(destMask[output]) > 1) {
             _mesa_error(ctx, GL_INVALID_OPERATION, "glDrawBuffersARB(buffer)");
             return;
          }
-- 
1.7.7.6

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

Reply via email to