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

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


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

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

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

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

---

 dlls/wined3d/texture.c | 22 +++++++++++++---------
 1 file changed, 13 insertions(+), 9 deletions(-)

diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c
index eb43f9975e..cd3d4b4912 100644
--- a/dlls/wined3d/texture.c
+++ b/dlls/wined3d/texture.c
@@ -450,7 +450,7 @@ static void texture2d_depth_blt_fbo(const struct wined3d_device *device, struct
 {
     struct wined3d_context_gl *context_gl = wined3d_context_gl(context);
     const struct wined3d_gl_info *gl_info = context_gl->gl_info;
-    DWORD src_mask, dst_mask;
+    GLbitfield src_mask, dst_mask;
     GLbitfield gl_mask;
 
     TRACE("device %p, src_texture %p, src_sub_resource_idx %u, src_location %s, src_rect %s, "
@@ -458,8 +458,17 @@ static void texture2d_depth_blt_fbo(const struct wined3d_device *device, struct
             src_texture, src_sub_resource_idx, wined3d_debug_location(src_location), wine_dbgstr_rect(src_rect),
             dst_texture, dst_sub_resource_idx, wined3d_debug_location(dst_location), wine_dbgstr_rect(dst_rect));
 
-    src_mask = src_texture->resource.format_flags & (WINED3DFMT_FLAG_DEPTH | WINED3DFMT_FLAG_STENCIL);
-    dst_mask = dst_texture->resource.format_flags & (WINED3DFMT_FLAG_DEPTH | WINED3DFMT_FLAG_STENCIL);
+    src_mask = 0;
+    if (src_texture->resource.format->depth_size)
+        src_mask |= GL_DEPTH_BUFFER_BIT;
+    if (src_texture->resource.format->stencil_size)
+        src_mask |= GL_STENCIL_BUFFER_BIT;
+
+    dst_mask = 0;
+    if (dst_texture->resource.format->depth_size)
+        dst_mask |= GL_DEPTH_BUFFER_BIT;
+    if (dst_texture->resource.format->stencil_size)
+        dst_mask |= GL_STENCIL_BUFFER_BIT;
 
     if (src_mask != dst_mask)
     {
@@ -475,12 +484,7 @@ static void texture2d_depth_blt_fbo(const struct wined3d_device *device, struct
                 debug_d3dformat(src_texture->resource.format->id));
         return;
     }
-
-    gl_mask = 0;
-    if (src_mask & WINED3DFMT_FLAG_DEPTH)
-        gl_mask |= GL_DEPTH_BUFFER_BIT;
-    if (src_mask & WINED3DFMT_FLAG_STENCIL)
-        gl_mask |= GL_STENCIL_BUFFER_BIT;
+    gl_mask = src_mask;
 
     /* Make sure the locations are up-to-date. Loading the destination
      * surface isn't required if the entire surface is overwritten. */




More information about the wine-cvs mailing list