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

Author: Jason Ekstrand <[email protected]>
Date:   Wed Mar  9 20:14:44 2022 -0600

lavapipe: Reset the free_cmd_buffers list in TrimCommandPool

We delete all the command buffers but they're still in the list so
future allocations may try to re-use them post-free and another trim
will re-delete them.

Fixes: b38879f8c5f5 ("vallium: initial import of the vulkan frontend")
Reviewed-by: Boris Brezillon <[email protected]>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15311>

---

 src/gallium/frontends/lavapipe/lvp_cmd_buffer.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/src/gallium/frontends/lavapipe/lvp_cmd_buffer.c 
b/src/gallium/frontends/lavapipe/lvp_cmd_buffer.c
index 28589e66a39..07b36b9f9d5 100644
--- a/src/gallium/frontends/lavapipe/lvp_cmd_buffer.c
+++ b/src/gallium/frontends/lavapipe/lvp_cmd_buffer.c
@@ -265,6 +265,7 @@ VKAPI_ATTR void VKAPI_CALL lvp_TrimCommandPool(
                             &pool->free_cmd_buffers, pool_link) {
       lvp_cmd_buffer_destroy(cmd_buffer);
    }
+   list_inithead(&pool->free_cmd_buffers);
 }
 
 VKAPI_ATTR void VKAPI_CALL lvp_CmdDrawMultiEXT(

Reply via email to