diff --git a/src/gallium/frontends/wgl/stw_st.c b/src/gallium/frontends/wgl/stw_st.c index 7db5ebf7f5c..e8d54ef2904 100644 --- a/src/gallium/frontends/wgl/stw_st.c +++ b/src/gallium/frontends/wgl/stw_st.c @@ -169,8 +169,9 @@ stw_st_framebuffer_validate_locked(struct st_context *st, * drawing. A fake front texture is needed to handle that scenario. * For MSAA, we just need to make sure that the back buffer also * exists, so we can blt to it during flush_frontbuffer. */ - if (mask & ST_ATTACHMENT_FRONT_LEFT_MASK && - stwfb->fb->winsys_framebuffer) { + if ((mask & ST_ATTACHMENT_FRONT_LEFT_MASK) && + stwfb->fb->winsys_framebuffer && + (stwfb->stvis.buffer_mask & ST_ATTACHMENT_BACK_LEFT_MASK)) { if (stwfb->stvis.samples <= 1) stwfb->needs_fake_front = true; else @@ -488,6 +489,9 @@ stw_st_framebuffer_flush_front(struct st_context *st, /* fake front texture is now invalid */ p_atomic_inc(&stwfb->base.stamp); need_swap_textures = true; + } else if (stwfb->fb->winsys_framebuffer && + stwfb->fb->winsys_framebuffer->flush_frontbuffer) { + stwfb->fb->winsys_framebuffer->flush_frontbuffer(stwfb->fb->winsys_framebuffer, pipe); } if (need_swap_textures) { diff --git a/src/gallium/frontends/wgl/stw_winsys.h b/src/gallium/frontends/wgl/stw_winsys.h index ebf2a3a2f76..8e6e082230c 100644 --- a/src/gallium/frontends/wgl/stw_winsys.h +++ b/src/gallium/frontends/wgl/stw_winsys.h @@ -63,6 +63,10 @@ struct stw_winsys_framebuffer struct pipe_resource * (*get_resource)(struct stw_winsys_framebuffer *fb, enum st_attachment_type statt); + + void + (*flush_frontbuffer)(struct stw_winsys_framebuffer *fb, + struct pipe_context *context); }; struct stw_winsys