v3dv: properly return OOM error during pipeline creation

Graphics / Mesa 3D Graphics Library / Mesa - Alejandro Piñeiro [igalia.com] - 13 October 2020 21:21 UTC

So far we were just asserting or aborting if any of the internal method used during the pipeline creation failed.

We needed to change the return value of several methods, in order to bubble up the proper memory allocation error.

Note that as the pipeline creation is complex and splitted in several methods, if an error happens in the middle, it returns back, and rely on the higher level to call PipelineDestroy. This method needs to take into account that some of the resources could have not been allocated when freeing it.

Also note that v3dv_get_shader_variant is used during the pipeline bind, as with the new resources bound, we need to check if we need to recompile a new variant. At that moment we are not creating a new
vulkan object so we can really return a OOM error. For now we just assert on that case.


1b4a9c7d450 v3dv: properly return OOM error during pipeline creation
src/broadcom/vulkan/v3dv_cmd_buffer.c | 28 +++++++++--
src/broadcom/vulkan/v3dv_pipeline.c | 91 +++++++++++++++++++++++++++--------
src/broadcom/vulkan/v3dv_private.h | 4 +-
3 files changed, 99 insertions(+), 24 deletions(-)

Upstream: cgit.freedesktop.org

  • Share