Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add get_pipeline_cache_data #166

Merged
merged 1 commit into from
Dec 4, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 28 additions & 0 deletions ash/src/device.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1276,6 +1276,34 @@ pub trait DeviceV1_0 {
}
}

unsafe fn get_pipeline_cache_data(
&self,
pipeline_cache: vk::PipelineCache,
) -> VkResult<Vec<u8>> {
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<u8> = 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,
Expand Down