From 244b7f1cdd91d47ecfcba3ab221d99f001765bcc Mon Sep 17 00:00:00 2001 From: msiglreith Date: Thu, 23 Nov 2017 14:04:56 +0100 Subject: [PATCH] Add query related functions --- ash/src/device.rs | 88 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 88 insertions(+) diff --git a/ash/src/device.rs b/ash/src/device.rs index ca152e3..8dd1e7a 100644 --- a/ash/src/device.rs +++ b/ash/src/device.rs @@ -209,6 +209,18 @@ pub trait DeviceV1_0 { ); } + unsafe fn destroy_query_pool( + &self, + pool: vk::QueryPool, + allocation_callbacks: Option<&vk::AllocationCallbacks>, + ) { + self.fp_v1_0().destroy_query_pool( + self.handle(), + pool, + allocation_callbacks.as_raw_ptr(), + ); + } + unsafe fn destroy_descriptor_set_layout( &self, layout: vk::DescriptorSetLayout, @@ -830,6 +842,64 @@ pub trait DeviceV1_0 { ); } + unsafe fn cmd_begin_query( + &self, + command_buffer: vk::CommandBuffer, + query_pool: vk::QueryPool, + query: u32, + flags: vk::QueryControlFlags, + ) { + self.fp_v1_0().cmd_begin_query( + command_buffer, + query_pool, + query, + flags, + ); + } + + unsafe fn cmd_end_query( + &self, + command_buffer: vk::CommandBuffer, + query_pool: vk::QueryPool, + query: u32, + ) { + self.fp_v1_0().cmd_end_query( + command_buffer, + query_pool, + query, + ); + } + + unsafe fn cmd_reset_query_pool( + &self, + command_buffer: vk::CommandBuffer, + pool: vk::QueryPool, + first_query: u32, + query_count: u32, + ) { + self.fp_v1_0().cmd_reset_query_pool( + command_buffer, + pool, + first_query, + query_count, + ); + } + + unsafe fn cmd_write_timestamp( + &self, + command_buffer: vk::CommandBuffer, + pipeline_stage: vk::PipelineStageFlags, + query_pool: vk::QueryPool, + query: u32, + ) { + self.fp_v1_0().cmd_write_timestamp( + command_buffer, + pipeline_stage, + query_pool, + query, + ); + } + unsafe fn create_semaphore( &self, create_info: &vk::SemaphoreCreateInfo, @@ -1225,6 +1295,24 @@ pub trait DeviceV1_0 { } } + unsafe fn create_query_pool( + &self, + create_info: &vk::QueryPoolCreateInfo, + allocation_callbacks: Option<&vk::AllocationCallbacks>, + ) -> VkResult { + let mut pool = mem::uninitialized(); + let err_code = self.fp_v1_0().create_query_pool( + self.handle(), + create_info, + allocation_callbacks.as_raw_ptr(), + &mut pool, + ); + match err_code { + vk::Result::Success => Ok(pool), + _ => Err(err_code), + } + } + unsafe fn create_image( &self, create_info: &vk::ImageCreateInfo,