Mesa (main): lavapipe: fix sampler + sampler view leaks.

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Wed Feb 9 01:18:05 UTC 2022


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

Author: Dave Airlie <airlied at redhat.com>
Date:   Tue Feb  8 18:24:12 2022 +1000

lavapipe: fix sampler + sampler view leaks.

The compute sampler views are using a different method
of generation so have to be deleted explicitly.

Fixes: e94fd4cc6589 ("lavapipe: rename vallium to lavapipe")

Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz at gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14939>

---

 src/gallium/frontends/lavapipe/lvp_execute.c | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/src/gallium/frontends/lavapipe/lvp_execute.c b/src/gallium/frontends/lavapipe/lvp_execute.c
index d47f3ad4ba4..228aeb72662 100644
--- a/src/gallium/frontends/lavapipe/lvp_execute.c
+++ b/src/gallium/frontends/lavapipe/lvp_execute.c
@@ -4116,6 +4116,18 @@ VkResult lvp_execute_cmds(struct lvp_device *device,
       }
    }
 
+   for (enum pipe_shader_type s = PIPE_SHADER_VERTEX; s < PIPE_SHADER_TYPES; s++) {
+      for (unsigned i = 0; i < PIPE_MAX_SAMPLERS; i++) {
+         if (state.sv[s][i])
+            pipe_sampler_view_reference(&state.sv[s][i], NULL);
+      }
+   }
+
+   for (unsigned i = 0; i < PIPE_MAX_SAMPLERS; i++) {
+      if (state.cso_ss_ptr[PIPE_SHADER_COMPUTE][i])
+         state.pctx->delete_sampler_state(state.pctx, state.ss_cso[PIPE_SHADER_COMPUTE][i]);
+   }
+
    free(state.imageless_views);
    free(state.pending_clear_aspects);
    free(state.cleared_views);



More information about the mesa-commit mailing list