[PATCH 5/5] wined3d: Read back onscreen surfaces before downloading.

Matteo Bruni mbruni at codeweavers.com
Wed Mar 17 07:35:23 CDT 2021


Signed-off-by: Matteo Bruni <mbruni at codeweavers.com>
---
 dlls/wined3d/surface.c | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c
index cb03b99fc97..ca8e6ba89d5 100644
--- a/dlls/wined3d/surface.c
+++ b/dlls/wined3d/surface.c
@@ -1666,6 +1666,16 @@ HRESULT texture2d_blt(struct wined3d_texture *dst_texture, unsigned int dst_sub_
             TRACE("Not doing download because of partial download (src).\n");
         else if (!wined3d_texture_is_full_rect(dst_texture, dst_sub_resource_idx % dst_texture->level_count, &dst_rect))
             TRACE("Not doing download because of partial download (dst).\n");
+        else if (src_sub_resource->locations == WINED3D_LOCATION_DRAWABLE)
+        {
+            context = context_acquire(device, src_texture, src_sub_resource_idx);
+            texture2d_read_from_framebuffer(src_texture, src_sub_resource_idx, context,
+                    WINED3D_LOCATION_DRAWABLE, dst_texture->resource.map_binding);
+            wined3d_texture_validate_location(src_texture, src_sub_resource_idx, dst_texture->resource.map_binding);
+            context_release(context);
+            return texture2d_blt(dst_texture, dst_sub_resource_idx, dst_box,
+                    src_texture, src_sub_resource_idx, src_box, flags, fx, filter);
+        }
         else
         {
             wined3d_texture_download_from_texture(dst_texture, dst_sub_resource_idx, src_texture,
-- 
2.26.2




More information about the wine-devel mailing list