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 <renatopereyra@chromium.org>
Cc: mesa-stable
Reviewed-by: Ivan Briano <ivan.briano@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/29315>
(cherry picked from commit 51d6162c80)
This commit is contained in:
Renato Pereyra 2024-05-21 18:57:14 -05:00 committed by Eric Engestrom
parent 6206f4cfba
commit 9d34ce91cb
2 changed files with 19 additions and 42 deletions

View file

@ -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

View file

@ -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++)