Henri Verbeet : wined3d: Split combined render target and depth/ stencil clears if needed in ffp_blitter_clear().

Alexandre Julliard julliard at winehq.org
Mon Jul 17 15:37:19 CDT 2017


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

Author: Henri Verbeet <hverbeet at codeweavers.com>
Date:   Mon Jul 17 14:01:39 2017 +0200

wined3d: Split combined render target and depth/stencil clears if needed in ffp_blitter_clear().

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

---

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

diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c
index 632a42b..d5820bd 100644
--- a/dlls/wined3d/surface.c
+++ b/dlls/wined3d/surface.c
@@ -2570,6 +2570,7 @@ static void ffp_blitter_clear(struct wined3d_blitter *blitter, struct wined3d_de
 {
     struct wined3d_rendertarget_view *view;
     struct wined3d_blitter *next;
+    DWORD next_flags = 0;
     unsigned int i;
 
     if (flags & WINED3DCLEAR_TARGET)
@@ -2579,12 +2580,15 @@ static void ffp_blitter_clear(struct wined3d_blitter *blitter, struct wined3d_de
             if (!(view = fb->render_targets[i]))
                 continue;
 
-            if ((!(flags & (WINED3DCLEAR_ZBUFFER | WINED3DCLEAR_STENCIL))
-                    && ffp_blitter_use_cpu_clear(view))
+            if (ffp_blitter_use_cpu_clear(view)
                     || (!(view->resource->usage & WINED3DUSAGE_RENDERTARGET)
                     && (wined3d_settings.offscreen_rendering_mode != ORM_FBO
                     || !(view->format_flags & WINED3DFMT_FLAG_FBO_ATTACHABLE))))
-                goto next;
+            {
+                next_flags |= WINED3DCLEAR_TARGET;
+                flags &= ~WINED3DCLEAR_TARGET;
+                break;
+            }
 
             /* FIXME: We should reject colour fills on formats with fixups,
              * but this would break P8 colour fills for example. */
@@ -2593,16 +2597,18 @@ static void ffp_blitter_clear(struct wined3d_blitter *blitter, struct wined3d_de
 
     if ((flags & (WINED3DCLEAR_ZBUFFER | WINED3DCLEAR_STENCIL))
             && (view = fb->depth_stencil) && ffp_blitter_use_cpu_clear(view))
-        goto next;
+    {
+        next_flags |= flags & (WINED3DCLEAR_ZBUFFER | WINED3DCLEAR_STENCIL);
+        flags &= ~(WINED3DCLEAR_ZBUFFER | WINED3DCLEAR_STENCIL);
+    }
 
-    device_clear_render_targets(device, rt_count, fb, rect_count,
-            clear_rects, draw_rect, flags, colour, depth, stencil);
-    return;
+    if (flags)
+        device_clear_render_targets(device, rt_count, fb, rect_count,
+                clear_rects, draw_rect, flags, colour, depth, stencil);
 
-next:
-    if ((next = blitter->next))
+    if (next_flags && (next = blitter->next))
         next->ops->blitter_clear(next, device, rt_count, fb, rect_count,
-                clear_rects, draw_rect, flags, colour, depth, stencil);
+                clear_rects, draw_rect, next_flags, colour, depth, stencil);
 }
 
 static void ffp_blitter_blit(struct wined3d_blitter *blitter, enum wined3d_blit_op op,




More information about the wine-cvs mailing list