Mesa (main): zink: improve zink_clear_depth_stencil check for current attachment

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Mon Jul 18 03:57:15 UTC 2022


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

Author: Mike Blumenkrantz <michael.blumenkrantz at gmail.com>
Date:   Wed Jul  6 08:29:30 2022 -0400

zink: improve zink_clear_depth_stencil check for current attachment

this is technically more correct since it accounts for multi-context usage

Acked-by: Dave Airlie <airlied at redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17366>

---

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

diff --git a/src/gallium/drivers/zink/zink_clear.c b/src/gallium/drivers/zink/zink_clear.c
index 3b4d97631fe..e6927b13c3f 100644
--- a/src/gallium/drivers/zink/zink_clear.c
+++ b/src/gallium/drivers/zink/zink_clear.c
@@ -534,8 +534,9 @@ zink_clear_depth_stencil(struct pipe_context *pctx, struct pipe_surface *dst,
    struct u_rect rect = {dstx, dstx + width, dsty, dsty + height};
    bool needs_rp = !zink_blit_region_fills(rect, dst->texture->width0, dst->texture->height0);
    needs_rp |= check_3d_layers(dst);
+   bool cur_attachment = zink_csurface(ctx->fb_state.zsbuf) == zink_csurface(dst);
    bool render_condition_active = ctx->render_condition_active;
-   if (res->fb_binds) { //current depth attachment
+   if (cur_attachment) { //current depth attachment
       struct pipe_scissor_state scissor = {dstx, dsty, dstx + width, dsty + height};
       if (!render_condition_enabled && render_condition_active) {
          zink_stop_conditional_render(ctx);



More information about the mesa-commit mailing list