Module: Mesa
Branch: main
Commit: 07a5ede65a9110643f8484826553227be2bc7e05
URL:    
http://cgit.freedesktop.org/mesa/mesa/commit/?id=07a5ede65a9110643f8484826553227be2bc7e05

Author: Mike Blumenkrantz <[email protected]>
Date:   Sat Mar 18 09:58:43 2023 -0400

zink: reset fb clears using the clears_enabled mask

iterating was fine before, but it will become problematic to reset
all the clears once they start being stashed for unordered ops

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21906>

---

 src/gallium/drivers/zink/zink_clear.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/src/gallium/drivers/zink/zink_clear.c 
b/src/gallium/drivers/zink/zink_clear.c
index 39ac5c4a7ec..4a14e58c389 100644
--- a/src/gallium/drivers/zink/zink_clear.c
+++ b/src/gallium/drivers/zink/zink_clear.c
@@ -408,8 +408,10 @@ out:
       }
       to_clear = 0;
    }
-   for (int i = 0; i < ARRAY_SIZE(ctx->fb_clears); i++)
-       zink_fb_clear_reset(ctx, i);
+   if (ctx->clears_enabled & PIPE_CLEAR_DEPTHSTENCIL)
+      zink_fb_clear_reset(ctx, PIPE_MAX_COLOR_BUFS);
+   u_foreach_bit(i, ctx->clears_enabled >> 2)
+      zink_fb_clear_reset(ctx, i);
 }
 
 static struct pipe_surface *

Reply via email to