glXCopySubBufferMESA copies data from the back buffer to the front,
so it needs to perform a MSAA downsampling operation just like
glXSwapBuffers would.
Currently, the CopySubBuffer implementations supply a throttle reason
of __DRI2_THROTTLE_SWAPBUFFERS, so they hit this path and work today.
But we'd like to avoid swapbuffer throttling in this case, so the next
patch will change that reason.
Tested-by: Michel Dänzer <mdaenzer@redhat.com> # DRI3 only
Reviewed-by: Michel Dänzer <mdaenzer@redhat.com>
struct pipe_context *pipe = st->pipe;
if (drawable->stvis.samples > 1 &&
- reason == __DRI2_THROTTLE_SWAPBUFFER) {
+ (reason == __DRI2_THROTTLE_SWAPBUFFER ||
+ reason == __DRI2_THROTTLE_COPYSUBBUFFER)) {
/* Resolve the MSAA back buffer. */
dri_pipe_blit(st->pipe,
drawable->textures[ST_ATTACHMENT_BACK_LEFT],
drawable->msaa_textures[ST_ATTACHMENT_BACK_LEFT]);
- if (drawable->msaa_textures[ST_ATTACHMENT_FRONT_LEFT] &&
+ if (reason == __DRI2_THROTTLE_SWAPBUFFER &&
+ drawable->msaa_textures[ST_ATTACHMENT_FRONT_LEFT] &&
drawable->msaa_textures[ST_ATTACHMENT_BACK_LEFT]) {
swap_msaa_buffers = true;
}