=?UTF-8?Q?J=C3=B3zef=20Kucia=20?=: wined3d: Reduce nesting in texture2d_load_sysmem().

Alexandre Julliard julliard at winehq.org
Wed Jun 20 17:13:13 CDT 2018


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

Author: Józef Kucia <jkucia at codeweavers.com>
Date:   Tue Jun 19 17:14:59 2018 +0200

wined3d: Reduce nesting in texture2d_load_sysmem().

Signed-off-by: Józef Kucia <jkucia at codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 dlls/wined3d/surface.c | 24 ++++++++++--------------
 1 file changed, 10 insertions(+), 14 deletions(-)

diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c
index 5217033..5502d05 100644
--- a/dlls/wined3d/surface.c
+++ b/dlls/wined3d/surface.c
@@ -198,7 +198,6 @@ static void texture2d_blt_fbo(const struct wined3d_device *device, struct wined3
     else
         wined3d_texture_prepare_location(dst_texture, dst_sub_resource_idx, context, dst_location);
 
-
     if (src_location == WINED3D_LOCATION_DRAWABLE)
     {
         required_texture = src_texture;
@@ -1655,21 +1654,18 @@ BOOL texture2d_load_sysmem(struct wined3d_texture *texture, unsigned int sub_res
                 WINED3D_LOCATION_RB_RESOLVED, dst_location);
         return TRUE;
     }
-    else
-    {
-        if (sub_resource->locations & (WINED3D_LOCATION_RB_MULTISAMPLE | WINED3D_LOCATION_RB_RESOLVED))
-            wined3d_texture_load_location(texture, sub_resource_idx, context, WINED3D_LOCATION_TEXTURE_RGB);
 
-        /* Download the sub-resource to system memory. */
-        if (sub_resource->locations & (WINED3D_LOCATION_TEXTURE_RGB | WINED3D_LOCATION_TEXTURE_SRGB))
-        {
-            wined3d_texture_bind_and_dirtify(texture, context,
-                    !(sub_resource->locations & WINED3D_LOCATION_TEXTURE_RGB));
-            texture2d_download_data(texture, sub_resource_idx, context, dst_location);
-            ++texture->download_count;
+    if (sub_resource->locations & (WINED3D_LOCATION_RB_MULTISAMPLE | WINED3D_LOCATION_RB_RESOLVED))
+        wined3d_texture_load_location(texture, sub_resource_idx, context, WINED3D_LOCATION_TEXTURE_RGB);
 
-            return TRUE;
-        }
+    /* Download the sub-resource to system memory. */
+    if (sub_resource->locations & (WINED3D_LOCATION_TEXTURE_RGB | WINED3D_LOCATION_TEXTURE_SRGB))
+    {
+        wined3d_texture_bind_and_dirtify(texture, context,
+                !(sub_resource->locations & WINED3D_LOCATION_TEXTURE_RGB));
+        texture2d_download_data(texture, sub_resource_idx, context, dst_location);
+        ++texture->download_count;
+        return TRUE;
     }
 
     if (!(texture->resource.usage & WINED3DUSAGE_DEPTHSTENCIL)




More information about the wine-cvs mailing list