Module: wine Branch: master Commit: da574ed9f320cd8d768096931f5d51ac7e984242 URL: https://gitlab.winehq.org/wine/wine/-/commit/da574ed9f320cd8d768096931f5d51a...
Author: Henri Verbeet hverbeet@codeweavers.com Date: Thu Sep 14 16:29:48 2023 +0200
wined3d: Don't validate the frontbuffer's DRAWABLE location in wined3d_swapchain_resize_buffers() when NO3D is set.
In general, NO3D surfaces are always in SYSMEM. More importantly though, validating DRAWABLE will evict SYSMEM, but a subsequent wined3d_texture_no3d_load_location() won't recreate it because it's always supposed to be current. This fixes a regression introduced by commit ebaa0a9426864cfa6e36955f26ff4c66c1d5af76, and exposed by running the ddraw tests with the "no3d" renderer.
---
dlls/wined3d/swapchain.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/dlls/wined3d/swapchain.c b/dlls/wined3d/swapchain.c index 84dcdb5b110..99d717641e1 100644 --- a/dlls/wined3d/swapchain.c +++ b/dlls/wined3d/swapchain.c @@ -2004,8 +2004,11 @@ HRESULT CDECL wined3d_swapchain_resize_buffers(struct wined3d_swapchain *swapcha ERR("Something's still holding the front buffer (%p).\n", swapchain->front_buffer); swapchain->front_buffer = new_texture;
- wined3d_texture_validate_location(swapchain->front_buffer, 0, WINED3D_LOCATION_DRAWABLE); - wined3d_texture_invalidate_location(swapchain->front_buffer, 0, ~WINED3D_LOCATION_DRAWABLE); + if (!(swapchain->device->wined3d->flags & WINED3D_NO3D)) + { + wined3d_texture_validate_location(swapchain->front_buffer, 0, WINED3D_LOCATION_DRAWABLE); + wined3d_texture_invalidate_location(swapchain->front_buffer, 0, ~WINED3D_LOCATION_DRAWABLE); + }
for (i = 0; i < desc->backbuffer_count; ++i) {