Mesa (main): radeonsi: fix a leak in draw_vertex_state if threaded_context is disabled

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Fri Oct 8 02:52:38 UTC 2021


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

Author: Marek Olšák <marek.olsak at amd.com>
Date:   Wed Oct  6 16:28:39 2021 -0400

radeonsi: fix a leak in draw_vertex_state if threaded_context is disabled

Fixes: fb8f532ea1b - radeonsi: implement draw_vertex_state for lower display list overhead

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer at amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13235>

---

 src/gallium/drivers/radeonsi/si_state_draw.cpp | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/src/gallium/drivers/radeonsi/si_state_draw.cpp b/src/gallium/drivers/radeonsi/si_state_draw.cpp
index ec1f10ca596..c6d37f541a3 100644
--- a/src/gallium/drivers/radeonsi/si_state_draw.cpp
+++ b/src/gallium/drivers/radeonsi/si_state_draw.cpp
@@ -2600,6 +2600,9 @@ static void si_draw_vertex_state(struct pipe_context *ctx,
 
    si_draw<GFX_VERSION, HAS_TESS, HAS_GS, NGG, DRAW_VERTEX_STATE_ON, POPCNT>
       (ctx, &dinfo, 0, NULL, draws, num_draws, vstate, partial_velem_mask);
+
+   if (info.take_vertex_state_ownership)
+      pipe_vertex_state_reference(&vstate, NULL);
 }
 
 static void si_draw_rectangle(struct blitter_context *blitter, void *vertex_elements_cso,



More information about the mesa-commit mailing list