diff options
Diffstat (limited to 'src/vulkan')
-rw-r--r-- | src/vulkan/anv_cmd_buffer.c | 9 |
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); |