Mesa (master): gallium: Enable MESA_framebuffer_flip_y

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Tue Oct 8 21:25:45 UTC 2019


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

Author: Fritz Koenig <frkoenig at google.com>
Date:   Tue Jul 30 14:40:33 2019 -0700

gallium: Enable MESA_framebuffer_flip_y

Reviewed-by: Kenneth Graunke <kenneth at whitecape.org>
Reviewed-by: Kristian H. Kristensen <hoegsberg at google.com>

---

 src/mesa/state_tracker/st_atom_stipple.c | 2 +-
 src/mesa/state_tracker/st_cb_fbo.c       | 5 +----
 src/mesa/state_tracker/st_extensions.c   | 1 +
 src/mesa/state_tracker/st_util.h         | 2 +-
 4 files changed, 4 insertions(+), 6 deletions(-)

diff --git a/src/mesa/state_tracker/st_atom_stipple.c b/src/mesa/state_tracker/st_atom_stipple.c
index 87599f94d50..3437553c154 100644
--- a/src/mesa/state_tracker/st_atom_stipple.c
+++ b/src/mesa/state_tracker/st_atom_stipple.c
@@ -74,7 +74,7 @@ st_update_polygon_stipple( struct st_context *st )
 
       memcpy(st->state.poly_stipple, ctx->PolygonStipple, sz);
 
-      if (_mesa_is_user_fbo(ctx->DrawBuffer)) {
+      if (ctx->DrawBuffer->FlipY) {
          memcpy(newStipple.stipple, ctx->PolygonStipple, sizeof(newStipple.stipple));
       } else {
          invert_stipple(newStipple.stipple, ctx->PolygonStipple,
diff --git a/src/mesa/state_tracker/st_cb_fbo.c b/src/mesa/state_tracker/st_cb_fbo.c
index 55546f9fab3..7cb4a3e1650 100644
--- a/src/mesa/state_tracker/st_cb_fbo.c
+++ b/src/mesa/state_tracker/st_cb_fbo.c
@@ -863,13 +863,10 @@ st_MapRenderbuffer(struct gl_context *ctx,
    struct st_context *st = st_context(ctx);
    struct st_renderbuffer *strb = st_renderbuffer(rb);
    struct pipe_context *pipe = st->pipe;
-   const GLboolean invert = rb->Name == 0;
+   const GLboolean invert = flip_y;
    GLuint y2;
    GLubyte *map;
 
-   /* driver does not support GL_FRAMEBUFFER_FLIP_Y_MESA */
-   assert((rb->Name == 0) == flip_y);
-
    if (strb->software) {
       /* software-allocated renderbuffer (probably an accum buffer) */
       if (strb->data) {
diff --git a/src/mesa/state_tracker/st_extensions.c b/src/mesa/state_tracker/st_extensions.c
index 3f8230a22fb..c9a99b06f4b 100644
--- a/src/mesa/state_tracker/st_extensions.c
+++ b/src/mesa/state_tracker/st_extensions.c
@@ -1024,6 +1024,7 @@ void st_init_extensions(struct pipe_screen *screen,
    extensions->ATI_fragment_shader = GL_TRUE;
    extensions->ATI_texture_env_combine3 = GL_TRUE;
 
+   extensions->MESA_framebuffer_flip_y = GL_TRUE;
    extensions->MESA_pack_invert = GL_TRUE;
 
    extensions->NV_fog_distance = GL_TRUE;
diff --git a/src/mesa/state_tracker/st_util.h b/src/mesa/state_tracker/st_util.h
index b6454e5a958..bae85974f0e 100644
--- a/src/mesa/state_tracker/st_util.h
+++ b/src/mesa/state_tracker/st_util.h
@@ -71,7 +71,7 @@ st_invalidate_readpix_cache(struct st_context *st)
 static inline GLuint
 st_fb_orientation(const struct gl_framebuffer *fb)
 {
-   if (fb && _mesa_is_winsys_fbo(fb)) {
+   if (fb && fb->FlipY) {
       /* Drawing into a window (on-screen buffer).
        *
        * Negate Y scale to flip image vertically.




More information about the mesa-commit mailing list