From 6757e2f75c304afc958309d3084aa66ceb92bb10 Mon Sep 17 00:00:00 2001 From: Jason Ekstrand Date: Tue, 4 Aug 2015 14:00:09 -0700 Subject: vk/cmd_buffer: Allow for null VkCmdPool's --- src/vulkan/anv_cmd_buffer.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'src') 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); -- cgit v1.2.3