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

Author: Karol Herbst <kher...@redhat.com>
Date:   Sat Oct 28 18:18:15 2023 +0200

rusticl/queue: release bound constant buffer

This fixes memory leaks in drivers.

Signed-off-by: Karol Herbst <kher...@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25946>

---

 src/gallium/frontends/rusticl/core/queue.rs | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/src/gallium/frontends/rusticl/core/queue.rs 
b/src/gallium/frontends/rusticl/core/queue.rs
index c089aa4af8a..1275f48786e 100644
--- a/src/gallium/frontends/rusticl/core/queue.rs
+++ b/src/gallium/frontends/rusticl/core/queue.rs
@@ -45,6 +45,12 @@ impl Deref for QueueContext {
     }
 }
 
+impl Drop for QueueContext {
+    fn drop(&mut self) {
+        self.ctx.set_constant_buffer(0, &[])
+    }
+}
+
 struct QueueState {
     pending: Vec<Arc<Event>>,
     last: Weak<Event>,

Reply via email to