Added wined3d-rotate-WINED3D_SWAP_EFFECT_DISCARD patchset

This commit is contained in:
Alistair Leslie-Hughes 2022-02-05 12:38:03 +11:00
parent f538f2e2db
commit 54850aa1ff
3 changed files with 61 additions and 0 deletions

View File

@ -239,6 +239,7 @@ patch_enable_all ()
enable_wined3d_WINED3DFMT_B8G8R8X8_UNORM="$1"
enable_wined3d_bindless_texture="$1"
enable_wined3d_mesa_texture_download="$1"
enable_wined3d_rotate_WINED3D_SWAP_EFFECT_DISCARD="$1"
enable_wined3d_unset_flip_gdi="$1"
enable_wined3d_wined3d_guess_gl_vendor="$1"
enable_wined3d_zero_inf_shaders="$1"
@ -749,6 +750,9 @@ patch_enable ()
wined3d-mesa_texture_download)
enable_wined3d_mesa_texture_download="$2"
;;
wined3d-rotate-WINED3D_SWAP_EFFECT_DISCARD)
enable_wined3d_rotate_WINED3D_SWAP_EFFECT_DISCARD="$2"
;;
wined3d-unset-flip-gdi)
enable_wined3d_unset_flip_gdi="$2"
;;
@ -3671,6 +3675,18 @@ if test "$enable_wined3d_mesa_texture_download" -eq 1; then
patch_apply wined3d-mesa_texture_download/0001-wined3d-Use-glReadPixels-for-RT-texture-download.patch
fi
# Patchset wined3d-rotate-WINED3D_SWAP_EFFECT_DISCARD
# |
# | This patchset fixes the following Wine bugs:
# | * [#47331] Stop Steam browser flickering.
# |
# | Modified files:
# | * dlls/wined3d/swapchain.c
# |
if test "$enable_wined3d_rotate_WINED3D_SWAP_EFFECT_DISCARD" -eq 1; then
patch_apply wined3d-rotate-WINED3D_SWAP_EFFECT_DISCARD/0001-wined3d-Do-not-rotate-WINED3D_SWAP_EFFECT_DISCARD-sw.patch
fi
# Patchset wined3d-unset-flip-gdi
# |
# | This patchset fixes the following Wine bugs:

View File

@ -0,0 +1,44 @@
From 1f455f575b3a17cbf4bae3d44d8fa08ec3d21c4c Mon Sep 17 00:00:00 2001
From: Henri Verbeet <hverbeet@codeweavers.com>
Date: Thu, 13 May 2021 17:58:12 +0200
Subject: [PATCH] wined3d: Do not rotate WINED3D_SWAP_EFFECT_DISCARD
swapchains.
RenderDoc/Qt creates swapchains with 2 buffers, a front buffer and a back
buffer, and the DISCARD swap effect. It doesn't redraw the back buffer after a
Present(), seemingly expecting that the back buffer will only be copied to the
front buffer, and otherwise remain unmodified. Incidentally, CEF seems to
behave in a similar way.
---
dlls/wined3d/swapchain.c | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)
diff --git a/dlls/wined3d/swapchain.c b/dlls/wined3d/swapchain.c
index 49a40f3e1d6..d0f73fc690e 100644
--- a/dlls/wined3d/swapchain.c
+++ b/dlls/wined3d/swapchain.c
@@ -531,8 +531,9 @@ static void wined3d_swapchain_gl_rotate(struct wined3d_swapchain *swapchain, str
unsigned int i;
static const DWORD supported_locations = WINED3D_LOCATION_TEXTURE_RGB | WINED3D_LOCATION_RB_MULTISAMPLE;
- if (swapchain->state.desc.backbuffer_count < 2 || wined3d_settings.offscreen_rendering_mode != ORM_FBO)
- return;
+ if (swapchain->state.desc.swap_effect == WINED3D_SWAP_EFFECT_DISCARD
+ || swapchain->state.desc.backbuffer_count < 2 || wined3d_settings.offscreen_rendering_mode != ORM_FBO)
+ return;
texture_prev = wined3d_texture_gl(swapchain->back_buffers[0]);
@@ -1181,7 +1182,8 @@ static void wined3d_swapchain_vk_rotate(struct wined3d_swapchain *swapchain, str
static const DWORD supported_locations = WINED3D_LOCATION_TEXTURE_RGB | WINED3D_LOCATION_RB_MULTISAMPLE;
- if (swapchain->state.desc.backbuffer_count < 2)
+ if (swapchain->state.desc.swap_effect == WINED3D_SWAP_EFFECT_DISCARD
+ || swapchain->state.desc.backbuffer_count < 2)
return;
texture_prev = wined3d_texture_vk(swapchain->back_buffers[0]);
--
2.34.1

View File

@ -0,0 +1 @@
Fixes: [47331] Stop Steam browser flickering.