From 0b7f81205cdcc0dc2722fc630d7703eeec77caf7 Mon Sep 17 00:00:00 2001 From: msiglreith Date: Fri, 28 Apr 2017 16:10:13 +0200 Subject: [PATCH] Add create_compute_pipelines to device --- ash/src/device.rs | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/ash/src/device.rs b/ash/src/device.rs index 76e1ceb..72b8887 100644 --- a/ash/src/device.rs +++ b/ash/src/device.rs @@ -481,6 +481,27 @@ pub trait DeviceV1_0 { } } + unsafe fn create_compute_pipelines + (&self, + pipeline_cache: vk::PipelineCache, + create_infos: &[vk::ComputePipelineCreateInfo], + allocation_callbacks: Option<&vk::AllocationCallbacks>) + -> Result, (Vec, vk::Result)> { + let mut pipelines = Vec::with_capacity(create_infos.len()); + let err_code = self.fp_v1_0() + .create_compute_pipelines(self.handle(), + pipeline_cache, + create_infos.len() as vk::uint32_t, + create_infos.as_ptr(), + allocation_callbacks.as_raw_ptr(), + pipelines.as_mut_ptr()); + pipelines.set_len(create_infos.len()); + match err_code { + vk::Result::Success => Ok(pipelines), + _ => Err((pipelines, err_code)), + } + } + unsafe fn create_buffer(&self, create_info: &vk::BufferCreateInfo, allocation_callbacks: Option<&vk::AllocationCallbacks>)