dri/android: Fix MSAA resolve

Commit f9a074dd55 ("dri2/android: Bypass throttling") dropped
unnecessary throtting in the SwapBuffers() path for android.  But
unfortunately MSAA resolve got tangled up in the throttle reason
flag.  So add a new flag that indicates "no throttingling, but yes
please do MSAA resolve".

Fixes: f9a074dd55 ("dri2/android: Bypass throttling")
Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22719>
This commit is contained in:
Rob Clark 2023-04-26 10:37:58 -07:00 committed by Marge Bot
parent 5969541123
commit 08ffa8e0d2
3 changed files with 8 additions and 4 deletions

View File

@ -240,7 +240,8 @@ struct __DRItexBufferExtensionRec {
enum __DRI2throttleReason {
__DRI2_THROTTLE_SWAPBUFFER,
__DRI2_THROTTLE_COPYSUBBUFFER,
__DRI2_THROTTLE_FLUSHFRONT
__DRI2_THROTTLE_FLUSHFRONT,
__DRI2_NOTHROTTLE_SWAPBUFFER,
};
struct __DRI2flushExtensionRec {

View File

@ -997,7 +997,7 @@ droid_swap_buffers(_EGLDisplay *disp, _EGLSurface *draw)
if (dri2_surf->back)
dri2_surf->back->age = 1;
dri2_flush_drawable_for_swapbuffers_flags(disp, draw, -1);
dri2_flush_drawable_for_swapbuffers_flags(disp, draw, __DRI2_NOTHROTTLE_SWAPBUFFER);
/* dri2_surf->buffer can be null even when no error has occurred. For
* example, if the user has called no GL rendering commands since the

View File

@ -430,13 +430,15 @@ notify_before_flush_cb(void* _args)
if (args->drawable->stvis.samples > 1 &&
(args->reason == __DRI2_THROTTLE_SWAPBUFFER ||
args->reason == __DRI2_NOTHROTTLE_SWAPBUFFER ||
args->reason == __DRI2_THROTTLE_COPYSUBBUFFER)) {
/* Resolve the MSAA back buffer. */
dri_pipe_blit(st->pipe,
args->drawable->textures[ST_ATTACHMENT_BACK_LEFT],
args->drawable->msaa_textures[ST_ATTACHMENT_BACK_LEFT]);
if (args->reason == __DRI2_THROTTLE_SWAPBUFFER &&
if ((args->reason == __DRI2_THROTTLE_SWAPBUFFER ||
args->reason == __DRI2_NOTHROTTLE_SWAPBUFFER) &&
args->drawable->msaa_textures[ST_ATTACHMENT_FRONT_LEFT] &&
args->drawable->msaa_textures[ST_ATTACHMENT_BACK_LEFT]) {
args->swap_msaa_buffers = true;
@ -519,7 +521,8 @@ dri_flush(__DRIcontext *cPriv,
flush_flags = 0;
if (flags & __DRI2_FLUSH_CONTEXT)
flush_flags |= ST_FLUSH_FRONT;
if (reason == __DRI2_THROTTLE_SWAPBUFFER)
if (reason == __DRI2_THROTTLE_SWAPBUFFER ||
reason == __DRI2_NOTHROTTLE_SWAPBUFFER)
flush_flags |= ST_FLUSH_END_OF_FRAME;
/* Flush the context and throttle if needed. */