[Mesa-dev] [PATCH 1/3] mesa: Allow GL_BACK in glDrawBuffers() for gles3

Anuj Phogat anuj.phogat at gmail.com
Thu Nov 29 15:39:09 PST 2012


Makes framebuffer_blit_coverage_default_draw_buffer_binding.test in
gles3 conformance pass.

Signed-off-by: Anuj Phogat <anuj.phogat at 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 12c3f25..1e842f4 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



More information about the mesa-dev mailing list