v3dv/pipeline: handle properly OUT_OF_HOST_MEMORY error when allocating p_stage
authorAlejandro Piñeiro <apinheiro@igalia.com>
Sun, 26 Jul 2020 23:51:36 +0000 (01:51 +0200)
committerMarge Bot <eric+marge@anholt.net>
Tue, 13 Oct 2020 21:21:32 +0000 (21:21 +0000)
commit7c9b40effaaa0d2bd068c19425edb599fec68615
tree25c7d4e4808c2b3b45283d303f5185e4fd8c2cd7
parentd64ff26563768106eb9309e0618184035e17cec3
v3dv/pipeline: handle properly OUT_OF_HOST_MEMORY error when allocating p_stage

So far we were just assuming that it would work (so we could try to
access a NULL pointer), and not freeing it properly.

Fixing that was somewhat messy due pipeline_compile_graphics using a
temporary array and then update the internal pipeline stages. As we
are here we just removed the array and simplified
pipeline_compile_graphics code.

Fixes following tests:
  dEQP-VK.api.object_management.alloc_callback_fail.graphics_pipeline
  dEQP-VK.api.object_management.alloc_callback_fail_multiple.graphics_pipeline

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6766>
src/broadcom/vulkan/v3dv_pipeline.c