summaryrefslogtreecommitdiffstats
path: root/src/vulkan/anv_cmd_buffer.c
diff options
context:
space:
mode:
authorJason Ekstrand <[email protected]>2015-08-04 14:00:09 -0700
committerJason Ekstrand <[email protected]>2015-08-04 14:01:08 -0700
commit6757e2f75c304afc958309d3084aa66ceb92bb10 (patch)
treecaef20c164eede557a5f8c87f09bbc308678526c /src/vulkan/anv_cmd_buffer.c
parent4b097d73e6bc360235915d34b798284d09174929 (diff)
vk/cmd_buffer: Allow for null VkCmdPool's
Diffstat (limited to 'src/vulkan/anv_cmd_buffer.c')
-rw-r--r--src/vulkan/anv_cmd_buffer.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/vulkan/anv_cmd_buffer.c b/src/vulkan/anv_cmd_buffer.c
index 9ee5cf8b247..5178f6529ab 100644
--- a/src/vulkan/anv_cmd_buffer.c
+++ b/src/vulkan/anv_cmd_buffer.c
@@ -88,7 +88,14 @@ VkResult anv_CreateCommandBuffer(
anv_cmd_state_init(&cmd_buffer->state);
- list_addtail(&cmd_buffer->pool_link, &pool->cmd_buffers);
+ if (pool) {
+ list_addtail(&cmd_buffer->pool_link, &pool->cmd_buffers);
+ } else {
+ /* Init the pool_link so we can safefly call list_del when we destroy
+ * the command buffer
+ */
+ list_inithead(&cmd_buffer->pool_link);
+ }
*pCmdBuffer = anv_cmd_buffer_to_handle(cmd_buffer);