turnip: Fix issues in tu_compute_pipeline_create() that may lead to crash
authorEduardo Lima Mitev <elima@igalia.com>
Sun, 26 Jan 2020 22:25:17 +0000 (22:25 +0000)
committerMarge Bot <eric+marge@anholt.net>
Wed, 29 Jan 2020 09:25:20 +0000 (09:25 +0000)
commite6b531af666be09ed342cc705ae4d6211cd28bc2
treeb8caa97e68c6f42c38be6f5f70c291059a179e6d
parent0e11e8ba89400cba55815aa10be46f7d36e93044
turnip: Fix issues in tu_compute_pipeline_create() that may lead to crash

The shader object is destroyed even if its creation failed. It is also
not destroyed if its compilation or upload fails, leading to leaks.

Finally, tu_compute_pipeline_create() should set output var
pPipeline to VK_NULL_HANDLE if it fails.

Avoids crash on
dEQP-VK.api.object_management.alloc_callback_fail_multiple.compute_pipeline

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