From 63f24c3c016bec14bc549b71475ea0f7f7fdf893 Mon Sep 17 00:00:00 2001 From: Fritz Koenig Date: Tue, 30 Jul 2019 14:40:33 -0700 Subject: [PATCH] gallium: Enable MESA_framebuffer_flip_y Reviewed-by: Kenneth Graunke Reviewed-by: Kristian H. Kristensen --- 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. -- 2.30.2