Module: Mesa
Branch: master
Commit: accc2222174a90fd24ee56ce751feb6022ecc0c7
URL:    
http://cgit.freedesktop.org/mesa/mesa/commit/?id=accc2222174a90fd24ee56ce751feb6022ecc0c7

Author: Ryan Neph <[email protected]>
Date:   Wed Dec 16 01:18:09 2020 +0000

virgl: fix BGRA emulation artifacts during window resize

On some devices, window resizing results in flashes of blue- and
orange-tinted versions of the current frame until resizing is
finished.

This fix ensures that the emubgra tweak used for GLES virgl hosts
has its enabled state flag set properly during resize events.

v2: removed unrelated whitespace change

Fixes: 6f68cacf619 ("virgl: Always enable emulated BGRA and swizzling unless 
specifically told not to")
Signed-off-by: Ryan Neph <[email protected]>
Reviewed-by: Gert Wollny <[email protected]>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8119>

---

 src/gallium/drivers/virgl/virgl_screen.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/src/gallium/drivers/virgl/virgl_screen.c 
b/src/gallium/drivers/virgl/virgl_screen.c
index f55b5f22ac6..80104b859d2 100644
--- a/src/gallium/drivers/virgl/virgl_screen.c
+++ b/src/gallium/drivers/virgl/virgl_screen.c
@@ -874,7 +874,9 @@ virgl_create_screen(struct virgl_winsys *vws, const struct 
pipe_screen_config *c
    fixup_formats(&screen->caps.caps, &screen->caps.caps.v2.scanout);
 
    union virgl_caps *caps = &screen->caps.caps;
-   screen->tweak_gles_emulate_bgra &= 
!virgl_format_check_bitmask(PIPE_FORMAT_B8G8R8A8_SRGB, caps->v1.render.bitmask, 
false);
+   bool may_emulate_bgra = (caps->v2.capability_bits & 
VIRGL_CAP_APP_TWEAK_SUPPORT);
+   screen->tweak_gles_emulate_bgra &= !virgl_format_check_bitmask(
+       PIPE_FORMAT_B8G8R8A8_SRGB, caps->v1.render.bitmask, may_emulate_bgra);
    screen->refcnt = 1;
 
    slab_create_parent(&screen->transfer_pool, sizeof(struct virgl_transfer), 
16);

_______________________________________________
mesa-commit mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/mesa-commit

Reply via email to