• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 use crate::prelude::*;
2 use crate::vk;
3 use crate::{EntryCustom, Instance};
4 use std::ffi::CStr;
5 use std::mem;
6 
7 #[derive(Clone)]
8 pub struct PipelineExecutableProperties {
9     handle: vk::Instance,
10     pipeline_executable_properties_fn: vk::KhrPipelineExecutablePropertiesFn,
11 }
12 
13 impl PipelineExecutableProperties {
new<L>(entry: &EntryCustom<L>, instance: &Instance) -> Self14     pub fn new<L>(entry: &EntryCustom<L>, instance: &Instance) -> Self {
15         let pipeline_executable_properties_fn =
16             vk::KhrPipelineExecutablePropertiesFn::load(|name| unsafe {
17                 mem::transmute(entry.get_instance_proc_addr(instance.handle(), name.as_ptr()))
18             });
19         Self {
20             handle: instance.handle(),
21             pipeline_executable_properties_fn,
22         }
23     }
24 
name() -> &'static CStr25     pub fn name() -> &'static CStr {
26         vk::KhrPipelineExecutablePropertiesFn::name()
27     }
28 
29     #[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/vkGetPipelineExecutableInternalRepresentationsKHR.html>"]
get_pipeline_executable_internal_representations( &self, device: vk::Device, executable_info: &vk::PipelineExecutableInfoKHR, ) -> VkResult<Vec<vk::PipelineExecutableInternalRepresentationKHR>>30     pub unsafe fn get_pipeline_executable_internal_representations(
31         &self,
32         device: vk::Device,
33         executable_info: &vk::PipelineExecutableInfoKHR,
34     ) -> VkResult<Vec<vk::PipelineExecutableInternalRepresentationKHR>> {
35         read_into_defaulted_vector(|count, data| {
36             self.pipeline_executable_properties_fn
37                 .get_pipeline_executable_internal_representations_khr(
38                     device,
39                     executable_info,
40                     count,
41                     data,
42                 )
43         })
44     }
45 
46     #[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/vkGetPipelineExecutablePropertiesKHR.html>"]
get_pipeline_executable_properties( &self, device: vk::Device, pipeline_info: &vk::PipelineInfoKHR, ) -> VkResult<Vec<vk::PipelineExecutablePropertiesKHR>>47     pub unsafe fn get_pipeline_executable_properties(
48         &self,
49         device: vk::Device,
50         pipeline_info: &vk::PipelineInfoKHR,
51     ) -> VkResult<Vec<vk::PipelineExecutablePropertiesKHR>> {
52         read_into_defaulted_vector(|count, data| {
53             self.pipeline_executable_properties_fn
54                 .get_pipeline_executable_properties_khr(device, pipeline_info, count, data)
55         })
56     }
57 
58     #[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/vkGetPipelineExecutableStatisticsKHR.html>"]
get_pipeline_executable_statistics( &self, device: vk::Device, executable_info: &vk::PipelineExecutableInfoKHR, ) -> VkResult<Vec<vk::PipelineExecutableStatisticKHR>>59     pub unsafe fn get_pipeline_executable_statistics(
60         &self,
61         device: vk::Device,
62         executable_info: &vk::PipelineExecutableInfoKHR,
63     ) -> VkResult<Vec<vk::PipelineExecutableStatisticKHR>> {
64         read_into_defaulted_vector(|count, data| {
65             self.pipeline_executable_properties_fn
66                 .get_pipeline_executable_statistics_khr(device, executable_info, count, data)
67         })
68     }
69 
fp(&self) -> &vk::KhrPipelineExecutablePropertiesFn70     pub fn fp(&self) -> &vk::KhrPipelineExecutablePropertiesFn {
71         &self.pipeline_executable_properties_fn
72     }
73 
instance(&self) -> vk::Instance74     pub fn instance(&self) -> vk::Instance {
75         self.handle
76     }
77 }
78