Henri Verbeet : wined3d: Don' t bother trying to blit from discarded textures.

Alexandre Julliard julliard at winehq.org
Mon Oct 29 18:26:29 CDT 2018


Module: wine
Branch: master
Commit: c130a028fcf61b57a63ded6ce0cdbed47df1e5bb
URL:    https://source.winehq.org/git/wine.git/?a=commit;h=c130a028fcf61b57a63ded6ce0cdbed47df1e5bb

Author: Henri Verbeet <hverbeet at codeweavers.com>
Date:   Mon Oct 29 11:05:07 2018 +0330

wined3d: Don't bother trying to blit from discarded textures.

Signed-off-by: Henri Verbeet <hverbeet at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 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 71693ad..746599e 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)




More information about the wine-cvs mailing list