v3dv: handle allocation failure during pipeline initialization

Fixes (with disk cache disabled):
dEQP-VK.api.device_init.create_instance_device_intentional_alloc_fail.basic
dEQP-VK.api.object_management.alloc_callback_fail.device
dEQP-VK.api.object_management.alloc_callback_fail.device_group

Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Reviewed-by: Eric Engestrom <eric@igalia.com>
cc: mesa-stable

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19458>
(cherry picked from commit 1f5966397a)
This commit is contained in:
Iago Toral Quiroga
2022-11-02 08:53:12 +01:00
committed by Dylan Baker
parent 7f7586f87f
commit 7d5c727f57
2 changed files with 5 additions and 1 deletions

View File

@@ -1930,7 +1930,7 @@
"description": "v3dv: handle allocation failure during pipeline initialization",
"nominated": true,
"nomination_type": 0,
"resolution": 0,
"resolution": 1,
"main_sha": null,
"because_sha": null
},

View File

@@ -2501,6 +2501,8 @@ pipeline_compile_graphics(struct v3dv_pipeline *pipeline,
*/
pipeline->shared_data =
v3dv_pipeline_shared_data_new_empty(pipeline->sha1, pipeline, true);
if (!pipeline->shared_data)
return VK_ERROR_OUT_OF_HOST_MEMORY;
pipeline->vs->feedback.flags |=
VK_PIPELINE_CREATION_FEEDBACK_VALID_BIT;
@@ -3203,6 +3205,8 @@ pipeline_compile_compute(struct v3dv_pipeline *pipeline,
pipeline->shared_data = v3dv_pipeline_shared_data_new_empty(pipeline->sha1,
pipeline,
false);
if (!pipeline->shared_data)
return VK_ERROR_OUT_OF_HOST_MEMORY;
p_stage->feedback.flags |= VK_PIPELINE_CREATION_FEEDBACK_VALID_BIT;