Mesa (main): drisw: do an MSAA resolve when copying the backbuffer
GitLab Mirror
gitlab-mirror at kemper.freedesktop.org
Sat Dec 11 18:09:50 UTC 2021
Module: Mesa
Branch: main
Commit: f0eb163ae0535ead5e89fd9d66dfc4b04488eb62
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=f0eb163ae0535ead5e89fd9d66dfc4b04488eb62
Author: Italo Nicola <italonicola at collabora.com>
Date: Fri Jul 9 07:34:02 2021 -0300
drisw: do an MSAA resolve when copying the backbuffer
When calling glXCopySubBuffer, we must resolve the backbuffer before
copying it the frontbuffer.
Fixes piglit's glx/glx-copy-sub-buffer on virgl.
Signed-off-by: Italo Nicola <italonicola at collabora.com>
Reviewed-by: Gert Wollny <gert.wollny at collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11714>
---
src/gallium/frontends/dri/drisw.c | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/src/gallium/frontends/dri/drisw.c b/src/gallium/frontends/dri/drisw.c
index adb486ceb0b..64c77889de4 100644
--- a/src/gallium/frontends/dri/drisw.c
+++ b/src/gallium/frontends/dri/drisw.c
@@ -285,6 +285,13 @@ drisw_copy_sub_buffer(__DRIdrawable *dPriv, int x, int y,
ctx->st->flush(ctx->st, ST_FLUSH_FRONT, NULL, NULL, NULL);
+ if (drawable->stvis.samples > 1) {
+ /* Resolve the back buffer. */
+ dri_pipe_blit(ctx->st->pipe,
+ drawable->textures[ST_ATTACHMENT_BACK_LEFT],
+ drawable->msaa_textures[ST_ATTACHMENT_BACK_LEFT]);
+ }
+
u_box_2d(x, dPriv->h - y - h, w, h, &box);
drisw_present_texture(ctx->st->pipe, dPriv, ptex, &box);
}
More information about the mesa-commit
mailing list