Henri Verbeet : wined3d: Use "depth_size"/"stencil_size" to check for depth/stencil formats in texture2d_blt().

Alexandre Julliard julliard at winehq.org
Wed Jun 3 16:40:56 CDT 2020


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

Author: Henri Verbeet <hverbeet at codeweavers.com>
Date:   Wed Jun  3 15:58:11 2020 +0430

wined3d: Use "depth_size"/"stencil_size" to check for depth/stencil formats in texture2d_blt().

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

---

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

diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c
index 0c95f7a43a..652f6070b9 100644
--- a/dlls/wined3d/surface.c
+++ b/dlls/wined3d/surface.c
@@ -1483,11 +1483,11 @@ HRESULT texture2d_blt(struct wined3d_texture *dst_texture, unsigned int dst_sub_
     struct wined3d_swapchain *src_swapchain, *dst_swapchain;
     const struct wined3d_color_key *colour_key = NULL;
     DWORD src_location, dst_location, valid_locations;
-    DWORD src_ds_flags, dst_ds_flags;
     struct wined3d_context *context;
     enum wined3d_blit_op blit_op;
     BOOL scale, convert, resolve;
     RECT src_rect, dst_rect;
+    bool src_ds, dst_ds;
 
     static const DWORD simple_blit = WINED3D_BLT_SRC_CKEY
             | WINED3D_BLT_SRC_CKEY_OVERRIDE
@@ -1561,12 +1561,10 @@ HRESULT texture2d_blt(struct wined3d_texture *dst_texture, unsigned int dst_sub_
     convert = src_texture->resource.format->id != dst_texture->resource.format->id;
     resolve = src_texture->resource.multisample_type != dst_texture->resource.multisample_type;
 
-    dst_ds_flags = dst_texture->resource.format_flags
-            & (WINED3DFMT_FLAG_DEPTH | WINED3DFMT_FLAG_STENCIL);
-    src_ds_flags = src_texture->resource.format_flags
-            & (WINED3DFMT_FLAG_DEPTH | WINED3DFMT_FLAG_STENCIL);
+    dst_ds = dst_texture->resource.format->depth_size || dst_texture->resource.format->stencil_size;
+    src_ds = src_texture->resource.format->depth_size || src_texture->resource.format->stencil_size;
 
-    if (src_ds_flags || dst_ds_flags)
+    if (src_ds || dst_ds)
     {
         TRACE("Depth/stencil blit.\n");
 




More information about the wine-cvs mailing list