Mesa (master): mesa: Handle pbuffers in desktop GL framebuffer attachment queries

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Tue Oct 15 23:08:21 UTC 2019


Module: Mesa
Branch: master
Commit: e6ca6e587e7f88d6b06c0a5c966438beac6cb18e
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=e6ca6e587e7f88d6b06c0a5c966438beac6cb18e

Author: Kenneth Graunke <kenneth at whitecape.org>
Date:   Mon Oct 14 10:07:30 2019 -0700

mesa: Handle pbuffers in desktop GL framebuffer attachment queries

Once again, we were handling back-to-front in the GLES3 case, but not
the desktop GL case.

Fixes GTF-GL46.gtf30.GL3Tests.framebuffer_srgb.framebuffer_srgb_default_encoding when run with --deqp-surface-type=pbuffer --deqp-gl-context-type=egl.

Reviewed-by: Kristian H. Kristensen <hoegsberg at google.com>
Reviewed-by: Marek Olšák <marek.olsak at amd.com>

---

 src/mesa/main/fbobject.c | 12 +++++++-----
 1 file changed, 7 insertions(+), 5 deletions(-)

diff --git a/src/mesa/main/fbobject.c b/src/mesa/main/fbobject.c
index bc4f69c149e..50ba6dd7fad 100644
--- a/src/mesa/main/fbobject.c
+++ b/src/mesa/main/fbobject.c
@@ -326,22 +326,24 @@ get_fb0_attachment(struct gl_context *ctx, struct gl_framebuffer *fb,
 {
    assert(_mesa_is_winsys_fbo(fb));
 
+   attachment = _mesa_back_to_front_if_single_buffered(fb, attachment);
+
    if (_mesa_is_gles3(ctx)) {
-      assert(attachment == GL_BACK ||
-             attachment == GL_DEPTH ||
-             attachment == GL_STENCIL);
       switch (attachment) {
       case GL_BACK:
          /* Since there is no stereo rendering in ES 3.0, only return the
           * LEFT bits.
           */
-         if (ctx->DrawBuffer->Visual.doubleBufferMode)
-            return &fb->Attachment[BUFFER_BACK_LEFT];
+         return &fb->Attachment[BUFFER_BACK_LEFT];
+      case GL_FRONT:
+         /* We might get this if back_to_front triggers above */
          return &fb->Attachment[BUFFER_FRONT_LEFT];
       case GL_DEPTH:
          return &fb->Attachment[BUFFER_DEPTH];
       case GL_STENCIL:
          return &fb->Attachment[BUFFER_STENCIL];
+      default:
+         unreachable("invalid attachment");
       }
    }
 




More information about the mesa-commit mailing list