[PATCH 1/5] wined3d: Don't bother trying to blit from discarded textures.

Henri Verbeet hverbeet at codeweavers.com
Mon Oct 29 02:17:07 CDT 2018


Signed-off-by: Henri Verbeet <hverbeet at codeweavers.com>
---
 dlls/wined3d/surface.c | 12 +++++++++---
 1 file changed, 9 insertions(+), 3 deletions(-)

diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c
index 71693adc589..746599e58f5 100644
--- a/dlls/wined3d/surface.c
+++ b/dlls/wined3d/surface.c
@@ -3121,6 +3121,15 @@ HRESULT texture2d_blt(struct wined3d_texture *dst_texture, unsigned int dst_sub_
                 fx->src_color_key.color_space_high_value);
     }
 
+    dst_sub_resource = &dst_texture->sub_resources[dst_sub_resource_idx];
+    src_sub_resource = &src_texture->sub_resources[src_sub_resource_idx];
+
+    if (src_sub_resource->locations & WINED3D_LOCATION_DISCARDED)
+    {
+        WARN("Source sub-resource is discarded, nothing to do.\n");
+        return WINED3D_OK;
+    }
+
     SetRect(&src_rect, src_box->left, src_box->top, src_box->right, src_box->bottom);
     SetRect(&dst_rect, dst_box->left, dst_box->top, dst_box->right, dst_box->bottom);
 
@@ -3202,9 +3211,6 @@ HRESULT texture2d_blt(struct wined3d_texture *dst_texture, unsigned int dst_sub_
 
     TRACE("Colour blit.\n");
 
-    dst_sub_resource = &dst_texture->sub_resources[dst_sub_resource_idx];
-    src_sub_resource = &src_texture->sub_resources[src_sub_resource_idx];
-
     /* In principle this would apply to depth blits as well, but we don't
      * implement those in the CPU blitter at the moment. */
     if ((dst_sub_resource->locations & dst_texture->resource.map_binding)
-- 
2.11.0




More information about the wine-devel mailing list