aboutsummaryrefslogtreecommitdiffstats
path: root/src/freedreno
diff options
context:
space:
mode:
authorEric Anholt <[email protected]>2019-09-19 11:09:46 -0700
committerEric Anholt <[email protected]>2019-09-27 13:34:28 -0700
commit67e897729050aeec9b798621dfee6151bedf3864 (patch)
treed161c2d764d4863d94d804e51d476adebb2d0bb7 /src/freedreno
parentab3cf128a666320512b6140af18946f0c291b598 (diff)
turnip: Fix failure behavior of vkCreateGraphicsPipelines.
According to the 1.1.123 spec: "The implementation will attempt to create all pipelines, and only return VK_NULL_HANDLE values for those that actually failed." Reviewed-by: Kristian H. Kristensen <[email protected]>
Diffstat (limited to 'src/freedreno')
-rw-r--r--src/freedreno/vulkan/tu_pipeline.c17
1 files changed, 7 insertions, 10 deletions
diff --git a/src/freedreno/vulkan/tu_pipeline.c b/src/freedreno/vulkan/tu_pipeline.c
index 49ce5d27108..2acf5556434 100644
--- a/src/freedreno/vulkan/tu_pipeline.c
+++ b/src/freedreno/vulkan/tu_pipeline.c
@@ -1876,6 +1876,7 @@ tu_CreateGraphicsPipelines(VkDevice device,
{
TU_FROM_HANDLE(tu_device, dev, device);
TU_FROM_HANDLE(tu_pipeline_cache, cache, pipelineCache);
+ VkResult final_result = VK_SUCCESS;
for (uint32_t i = 0; i < count; i++) {
struct tu_pipeline_builder builder;
@@ -1886,19 +1887,15 @@ tu_CreateGraphicsPipelines(VkDevice device,
VkResult result = tu_pipeline_builder_build(&builder, &pipeline);
tu_pipeline_builder_finish(&builder);
- if (result != VK_SUCCESS) {
- for (uint32_t j = 0; j < i; j++) {
- tu_DestroyPipeline(device, pPipelines[j], pAllocator);
- pPipelines[j] = VK_NULL_HANDLE;
- }
-
- return result;
+ if (result == VK_SUCCESS) {
+ pPipelines[i] = tu_pipeline_to_handle(pipeline);
+ } else {
+ pPipelines[i] = NULL;
+ final_result = result;
}
-
- pPipelines[i] = tu_pipeline_to_handle(pipeline);
}
- return VK_SUCCESS;
+ return final_result;
}
static VkResult