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@collabora.com>
Reviewed-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11714>
This commit is contained in:
Italo Nicola 2021-07-09 07:34:02 -03:00 committed by Marge Bot
parent 6740f34568
commit f0eb163ae0

View file

@ -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);
}