From: Jason Ekstrand Date: Tue, 4 Aug 2015 21:00:09 +0000 (-0700) Subject: vk/cmd_buffer: Allow for null VkCmdPool's X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=6757e2f75c304afc958309d3084aa66ceb92bb10;p=mesa.git vk/cmd_buffer: Allow for null VkCmdPool's --- 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);