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

Author: Mike Blumenkrantz <michael.blumenkra...@gmail.com>
Date:   Wed Apr  7 14:02:54 2021 -0400

zink: handle in-renderpass clears in fb_clears_apply_internal()

this isn't used yet, but it may as well be handled in case that changes

Reviewed-by: Dave Airlie <airl...@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10705>

---

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

diff --git a/src/gallium/drivers/zink/zink_clear.c 
b/src/gallium/drivers/zink/zink_clear.c
index 96f5aaf7b91..ff932b2ca78 100644
--- a/src/gallium/drivers/zink/zink_clear.c
+++ b/src/gallium/drivers/zink/zink_clear.c
@@ -492,8 +492,9 @@ fb_clears_apply_internal(struct zink_context *ctx, struct 
pipe_resource *pres, i
 
    if (!zink_fb_clear_enabled(ctx, i))
       return;
-   if (zink_resource(pres)->aspect == VK_IMAGE_ASPECT_COLOR_BIT) {
-      assert(!ctx->batch.in_rp);
+   if (ctx->batch.in_rp)
+      zink_clear_framebuffer(ctx, BITFIELD_BIT(i));
+   else if (zink_resource(pres)->aspect == VK_IMAGE_ASPECT_COLOR_BIT) {
       if (zink_fb_clear_needs_explicit(fb_clear) || 
!check_3d_layers(ctx->fb_state.cbufs[i]))
          /* this will automatically trigger all the clears */
          zink_batch_rp(ctx);
@@ -510,7 +511,6 @@ fb_clears_apply_internal(struct zink_context *ctx, struct 
pipe_resource *pres, i
       zink_fb_clear_reset(ctx, i);
       return;
    } else {
-      assert(!ctx->batch.in_rp);
       if (zink_fb_clear_needs_explicit(fb_clear) || 
!check_3d_layers(ctx->fb_state.zsbuf))
          /* this will automatically trigger all the clears */
          zink_batch_rp(ctx);

_______________________________________________
mesa-commit mailing list
mesa-commit@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-commit

Reply via email to