From c9d05409aeebd79eadf6721d12324a116d62bfa6 Mon Sep 17 00:00:00 2001 From: Dave Airlie Date: Thu, 1 Sep 2022 11:37:27 +1000 Subject: [PATCH] llvmpipe: finish rendering before flushing frontbuffer resources. Fixes misrendering on front with mesa demos Cc: mesa-stable Reviewed-By: Mike Blumenkrantz Reviewed-by: Brian Paul Part-of: (cherry picked from commit 91dcadf95690c658b34b20cf5dbf77f79c1cf297) --- .pick_status.json | 2 +- src/gallium/drivers/llvmpipe/lp_screen.c | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/.pick_status.json b/.pick_status.json index 07719bbff53..055df55fac1 100644 --- a/.pick_status.json +++ b/.pick_status.json @@ -7213,7 +7213,7 @@ "description": "llvmpipe: finish rendering before flushing frontbuffer resources.", "nominated": true, "nomination_type": 0, - "resolution": 0, + "resolution": 1, "main_sha": null, "because_sha": null }, diff --git a/src/gallium/drivers/llvmpipe/lp_screen.c b/src/gallium/drivers/llvmpipe/lp_screen.c index ebaa8326697..55ee39b201f 100644 --- a/src/gallium/drivers/llvmpipe/lp_screen.c +++ b/src/gallium/drivers/llvmpipe/lp_screen.c @@ -51,6 +51,7 @@ #include "lp_limits.h" #include "lp_rast.h" #include "lp_cs_tpool.h" +#include "lp_flush.h" #include "frontend/sw_winsys.h" @@ -832,8 +833,11 @@ llvmpipe_flush_frontbuffer(struct pipe_screen *_screen, struct llvmpipe_resource *texture = llvmpipe_resource(resource); assert(texture->dt); - if (texture->dt) + + if (texture->dt) { + llvmpipe_flush_resource(_pipe, resource, 0, true, true, false, "frontbuffer"); winsys->displaytarget_display(winsys, texture->dt, context_private, sub_box); + } } static void