turnip: Remove failed command buffer from pool
authorEduardo Lima Mitev <elima@igalia.com>
Fri, 24 Jan 2020 12:02:22 +0000 (12:02 +0000)
committerMarge Bot <eric+marge@anholt.net>
Wed, 29 Jan 2020 09:25:20 +0000 (09:25 +0000)
commit0e11e8ba89400cba55815aa10be46f7d36e93044
tree5d21f4117344b31dd472ab5c87b55df1274dc7f4
parentab54624d0d52d88da7fb7f4df61f33f600a1dfd7
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:

dEQP-VK.api.object_management.max_concurrent.command_buffer_primary
dEQP-VK.api.object_management.max_concurrent.command_buffer_secondary

due to pool attempting to destroy an invalid command buffer.

Reviewed-by: Kristian H. Kristensen <hoegsberg@google.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3572>
src/freedreno/vulkan/tu_cmd_buffer.c