From 495c6175133141b4a8840e449ada7440e1ff2399 Mon Sep 17 00:00:00 2001 From: msiglreith Date: Wed, 5 Apr 2017 15:20:02 +0200 Subject: [PATCH] Fix multi graphics pipeline creation When creating multiple graphics pipelines, some may fail and an error will be returned. Some pipelines might still be built correctly, so we want to return the error and the pipelines. The current implementation discards all pipelines --- src/device.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/device.rs b/src/device.rs index a7c0740..0c21973 100644 --- a/src/device.rs +++ b/src/device.rs @@ -425,7 +425,7 @@ pub trait DeviceV1_0 { pipeline_cache: vk::PipelineCache, create_infos: &[vk::GraphicsPipelineCreateInfo], allocation_callbacks: Option<&vk::AllocationCallbacks>) - -> VkResult> { + -> (Vec, VkResult<()>) { let mut pipelines = Vec::with_capacity(create_infos.len()); let err_code = self.fp_v1_0() .create_graphics_pipelines(self.handle(), @@ -436,8 +436,8 @@ pub trait DeviceV1_0 { pipelines.as_mut_ptr()); pipelines.set_len(create_infos.len()); match err_code { - vk::Result::Success => Ok(pipelines), - _ => Err(err_code), + vk::Result::Success => (pipelines, Ok(())), + _ => (pipelines, Err(err_code)), } }