summaryrefslogtreecommitdiffstats
path: root/src/freedreno/vulkan
diff options
context:
space:
mode:
Diffstat (limited to 'src/freedreno/vulkan')
-rw-r--r--src/freedreno/vulkan/tu_pipeline.c46
1 files changed, 31 insertions, 15 deletions
diff --git a/src/freedreno/vulkan/tu_pipeline.c b/src/freedreno/vulkan/tu_pipeline.c
index 547115b0359..0e35d4e60dc 100644
--- a/src/freedreno/vulkan/tu_pipeline.c
+++ b/src/freedreno/vulkan/tu_pipeline.c
@@ -1901,6 +1901,32 @@ tu_pipeline_builder_init_graphics(
}
}
+static VkResult
+tu_graphics_pipeline_create(VkDevice device,
+ VkPipelineCache pipelineCache,
+ const VkGraphicsPipelineCreateInfo *pCreateInfo,
+ const VkAllocationCallbacks *pAllocator,
+ VkPipeline *pPipeline)
+{
+ TU_FROM_HANDLE(tu_device, dev, device);
+ TU_FROM_HANDLE(tu_pipeline_cache, cache, pipelineCache);
+
+ struct tu_pipeline_builder builder;
+ tu_pipeline_builder_init_graphics(&builder, dev, cache,
+ pCreateInfo, pAllocator);
+
+ struct tu_pipeline *pipeline = NULL;
+ VkResult result = tu_pipeline_builder_build(&builder, &pipeline);
+ tu_pipeline_builder_finish(&builder);
+
+ if (result == VK_SUCCESS)
+ *pPipeline = tu_pipeline_to_handle(pipeline);
+ else
+ *pPipeline = NULL;
+
+ return result;
+}
+
VkResult
tu_CreateGraphicsPipelines(VkDevice device,
VkPipelineCache pipelineCache,
@@ -1909,25 +1935,15 @@ tu_CreateGraphicsPipelines(VkDevice device,
const VkAllocationCallbacks *pAllocator,
VkPipeline *pPipelines)
{
- 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;
- tu_pipeline_builder_init_graphics(&builder, dev, cache,
- &pCreateInfos[i], pAllocator);
-
- struct tu_pipeline *pipeline = NULL;
- VkResult result = tu_pipeline_builder_build(&builder, &pipeline);
- tu_pipeline_builder_finish(&builder);
-
- if (result == VK_SUCCESS) {
- pPipelines[i] = tu_pipeline_to_handle(pipeline);
- } else {
- pPipelines[i] = NULL;
+ VkResult result = tu_graphics_pipeline_create(device, pipelineCache,
+ &pCreateInfos[i], pAllocator,
+ &pPipelines[i]);
+
+ if (result != VK_SUCCESS)
final_result = result;
- }
}
return final_result;