From 5029b6c1b5989363e8912178cf3282d809c99b0b 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 09773d68b4f..7b42bd5d04a 100644 --- a/.pick_status.json +++ b/.pick_status.json @@ -3794,7 +3794,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 7d3c974254e..8085760953a 100644 --- a/src/intel/vulkan/anv_pipeline.c +++ b/src/intel/vulkan/anv_pipeline.c @@ -2781,20 +2781,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++) @@ -3317,20 +3309,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++) @@ -4154,19 +4138,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++)