From 9d34ce91cb445ea15d0aed4e6c6b82fbad09e41a Mon Sep 17 00:00:00 2001 From: Renato Pereyra Date: Tue, 21 May 2024 18:57:14 -0500 Subject: [PATCH] anv: Attempt to compile all pipelines even after errors Per the Vulkan Spec section 10.1, the implementation is supposed to attempt to create all pipelines even if creation of any one pipeline in a create call fails. If more than one error occur, any one error is valid as a return value. Signed-off-by: Renato Pereyra Cc: mesa-stable Reviewed-by: Ivan Briano Reviewed-by: Lionel Landwerlin Part-of: (cherry picked from commit 51d6162c80bb27281f014b72b52b12e7ef11db98) --- .pick_status.json | 2 +- src/intel/vulkan/anv_pipeline.c | 59 ++++++++++----------------------- 2 files changed, 19 insertions(+), 42 deletions(-) diff --git a/.pick_status.json b/.pick_status.json index 7b9b5fe9a32..4b1ba0a8046 100644 --- a/.pick_status.json +++ b/.pick_status.json @@ -3624,7 +3624,7 @@ "description": "anv: Attempt to compile all pipelines even after errors", "nominated": true, "nomination_type": 0, - "resolution": 0, + "resolution": 1, "main_sha": null, "because_sha": null, "notes": null diff --git a/src/intel/vulkan/anv_pipeline.c b/src/intel/vulkan/anv_pipeline.c index 0f8a57ebd9e..3d98cf86dce 100644 --- a/src/intel/vulkan/anv_pipeline.c +++ b/src/intel/vulkan/anv_pipeline.c @@ -2811,20 +2811,12 @@ VkResult anv_CreateComputePipelines( &pCreateInfos[i], pAllocator, &pPipelines[i]); - if (res == VK_SUCCESS) - continue; - - /* Bail out on the first error != VK_PIPELINE_COMPILE_REQUIRED as it - * is not obvious what error should be report upon 2 different failures. - * */ - result = res; - if (res != VK_PIPELINE_COMPILE_REQUIRED) - break; - - pPipelines[i] = VK_NULL_HANDLE; - - if (flags & VK_PIPELINE_CREATE_2_EARLY_RETURN_ON_FAILURE_BIT_KHR) - break; + if (res != VK_SUCCESS) { + result = res; + if (flags & VK_PIPELINE_CREATE_2_EARLY_RETURN_ON_FAILURE_BIT_KHR) + break; + pPipelines[i] = VK_NULL_HANDLE; + } } for (; i < count; i++) @@ -3344,20 +3336,12 @@ VkResult anv_CreateGraphicsPipelines( pAllocator, &pPipelines[i]); } - if (res == VK_SUCCESS) - continue; - - /* Bail out on the first error != VK_PIPELINE_COMPILE_REQUIRED as it - * is not obvious what error should be report upon 2 different failures. - * */ - result = res; - if (res != VK_PIPELINE_COMPILE_REQUIRED) - break; - - pPipelines[i] = VK_NULL_HANDLE; - - if (flags & VK_PIPELINE_CREATE_2_EARLY_RETURN_ON_FAILURE_BIT_KHR) - break; + if (res != VK_SUCCESS) { + result = res; + if (flags & VK_PIPELINE_CREATE_2_EARLY_RETURN_ON_FAILURE_BIT_KHR) + break; + pPipelines[i] = VK_NULL_HANDLE; + } } for (; i < count; i++) @@ -4192,19 +4176,12 @@ anv_CreateRayTracingPipelinesKHR( &pCreateInfos[i], pAllocator, &pPipelines[i]); - if (res == VK_SUCCESS) - continue; - - /* Bail out on the first error as it is not obvious what error should be - * report upon 2 different failures. */ - result = res; - if (result != VK_PIPELINE_COMPILE_REQUIRED) - break; - - pPipelines[i] = VK_NULL_HANDLE; - - if (flags & VK_PIPELINE_CREATE_2_EARLY_RETURN_ON_FAILURE_BIT_KHR) - break; + if (res != VK_SUCCESS) { + result = res; + if (flags & VK_PIPELINE_CREATE_2_EARLY_RETURN_ON_FAILURE_BIT_KHR) + break; + pPipelines[i] = VK_NULL_HANDLE; + } } for (; i < createInfoCount; i++)