From fa830166fce926ff8c006146ce2385d8bd821b7d Mon Sep 17 00:00:00 2001 From: Zakor Gyula Date: Tue, 4 Dec 2018 14:01:06 +0100 Subject: [PATCH] Add get_pipeline_cache_data --- ash/src/device.rs | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/ash/src/device.rs b/ash/src/device.rs index 4c4330d..e5d9e03 100644 --- a/ash/src/device.rs +++ b/ash/src/device.rs @@ -1276,6 +1276,34 @@ pub trait DeviceV1_0 { } } + unsafe fn get_pipeline_cache_data( + &self, + pipeline_cache: vk::PipelineCache, + ) -> VkResult> { + let mut data_size: usize = 0; + let err_code = self.fp_v1_0().get_pipeline_cache_data( + self.handle(), + pipeline_cache, + &mut data_size, + ptr::null_mut(), + ); + if err_code != vk::Result::SUCCESS { + return Err(err_code); + }; + let mut data: Vec = Vec::with_capacity(data_size); + let err_code = self.fp_v1_0().get_pipeline_cache_data( + self.handle(), + pipeline_cache, + &mut data_size, + data.as_mut_ptr() as _, + ); + data.set_len(data_size); + match err_code { + vk::Result::SUCCESS => Ok(data), + _ => Err(err_code), + } + } + unsafe fn map_memory( &self, memory: vk::DeviceMemory,