Mesa (main): zink: update pipe_screen::num_contexts

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Wed Jun 16 14:43:43 UTC 2021


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

Author: Mike Blumenkrantz <michael.blumenkrantz at gmail.com>
Date:   Thu Apr 22 14:52:58 2021 -0400

zink: update pipe_screen::num_contexts

Reviewed-by: Erik Faye-Lund <erik.faye-lund at collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11394>

---

 src/gallium/drivers/zink/zink_context.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/src/gallium/drivers/zink/zink_context.c b/src/gallium/drivers/zink/zink_context.c
index 51833b7177c..c7cc9c2f723 100644
--- a/src/gallium/drivers/zink/zink_context.c
+++ b/src/gallium/drivers/zink/zink_context.c
@@ -139,6 +139,8 @@ zink_context_destroy(struct pipe_context *pctx)
 
    zink_descriptor_layouts_deinit(ctx);
 
+   p_atomic_dec(&screen->base.num_contexts);
+
    ralloc_free(ctx);
 }
 
@@ -3496,6 +3498,7 @@ zink_context_create(struct pipe_screen *pscreen, void *priv, unsigned flags)
          update_descriptor_state(ctx, i, ZINK_DESCRIPTOR_TYPE_IMAGE, j);
       }
    }
+   p_atomic_inc(&screen->base.num_contexts);
 
    if (!(flags & PIPE_CONTEXT_PREFER_THREADED) || flags & PIPE_CONTEXT_COMPUTE_ONLY) {
       return &ctx->base;



More information about the mesa-commit mailing list