Commit 0e11e8ba authored by Eduardo Lima Mitev's avatar Eduardo Lima Mitev Committed by Marge Bot

turnip: Remove failed command buffer from pool

When an error condition occurs during tu_create_cmd_buffer(), the
cmd buffer has already been added to a pool, so the cleanup code should
remove it.

Fixes a crash (assert in tu_device::tu_bo_finish()) in dEQP tests:


due to pool attempting to destroy an invalid command buffer.
Reviewed-by: Kristian H. Kristensen's avatarKristian H. Kristensen <>
Reviewed-by: Eric Anholt's avatarEric Anholt <>
Part-of: <!3572>
parent ab54624d
......@@ -1667,7 +1667,7 @@ tu_create_cmd_buffer(struct tu_device *device,
VkResult result = tu_bo_init_new(device, &cmd_buffer->scratch_bo, 0x1000);
if (result != VK_SUCCESS)
return result;
goto fail_scratch_bo;
#define VSC_DATA_SIZE(pitch) ((pitch) * 32 + 0x100) /* extra size to store VSC_SIZE */
#define VSC_DATA2_SIZE(pitch) ((pitch) * 32)
......@@ -1690,6 +1690,8 @@ fail_vsc_data2:
tu_bo_finish(cmd_buffer->device, &cmd_buffer->vsc_data);
tu_bo_finish(cmd_buffer->device, &cmd_buffer->scratch_bo);
return result;
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment