| 1 | //! <https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/VK_KHR_performance_query.html> |
| 2 | |
| 3 | use craterust-analyzer cargo ash 0.38.0+1.3.281 crate/::preluderust-analyzer cargo ash 0.38.0+1.3.281 prelude/::*; |
| 4 | use craterust-analyzer cargo ash 0.38.0+1.3.281 crate/::vkrust-analyzer cargo ash 0.38.0+1.3.281 vk/; |
| 5 | use corerust-analyzer cargo core https://github.com/rust-lang/rust/library/core crate/::memrust-analyzer cargo core https://github.com/rust-lang/rust/library/core mem/; |
| 6 | use corerust-analyzer cargo core https://github.com/rust-lang/rust/library/core crate/::ptrrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ptr/; |
| 7 | |
| 8 | impl craterust-analyzer cargo ash 0.38.0+1.3.281 crate/::khrrust-analyzer cargo ash 0.38.0+1.3.281 extensions_generated/khr/::performance_queryrust-analyzer cargo ash 0.38.0+1.3.281 extensions_generated/khr/performance_query/::Devicerust-analyzer cargo ash 0.38.0+1.3.281 extensions_generated/khr/performance_query/Device# { |
| 9 | /// <https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/vkAcquireProfilingLockKHR.html> |
| 10 | #[inline] |
| 11 | pub unsafe fn acquire_profiling_lockrust-analyzer cargo ash 0.38.0+1.3.281 extensions/khr/performance_query/impl#[`crate::khr::performance_query::Device`]acquire_profiling_lock().( |
| 12 | &self, |
| 13 | info: &vkrust-analyzer cargo ash 0.38.0+1.3.281 vk/::AcquireProfilingLockInfoKHRrust-analyzer cargo ash 0.38.0+1.3.281 vk/definitions/AcquireProfilingLockInfoKHR#<'_>, |
| 14 | ) -> VkResultrust-analyzer cargo ash 0.38.0+1.3.281 prelude/VkResult#<()> { |
| 15 | (self.fprust-analyzer cargo ash 0.38.0+1.3.281 extensions_generated/khr/performance_query/Device#fp..acquire_profiling_lock_khrrust-analyzer cargo ash 0.38.0+1.3.281 extensions_generated/khr/performance_query/DeviceFn#acquire_profiling_lock_khr.)(self.handlerust-analyzer cargo ash 0.38.0+1.3.281 extensions_generated/khr/performance_query/Device#handle., info).resultrust-analyzer cargo ash 0.38.0+1.3.281 prelude/impl#[`vk::Result`]result().() |
| 16 | } |
| 17 | |
| 18 | /// <https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/vkReleaseProfilingLockKHR.html> |
| 19 | #[inline] |
| 20 | pub unsafe fn release_profiling_lockrust-analyzer cargo ash 0.38.0+1.3.281 extensions/khr/performance_query/impl#[`crate::khr::performance_query::Device`]release_profiling_lock().(&self) { |
| 21 | (self.fprust-analyzer cargo ash 0.38.0+1.3.281 extensions_generated/khr/performance_query/Device#fp..release_profiling_lock_khrrust-analyzer cargo ash 0.38.0+1.3.281 extensions_generated/khr/performance_query/DeviceFn#release_profiling_lock_khr.)(self.handlerust-analyzer cargo ash 0.38.0+1.3.281 extensions_generated/khr/performance_query/Device#handle.) |
| 22 | } |
| 23 | } |
| 24 | |
| 25 | impl craterust-analyzer cargo ash 0.38.0+1.3.281 crate/::khrrust-analyzer cargo ash 0.38.0+1.3.281 extensions_generated/khr/::performance_queryrust-analyzer cargo ash 0.38.0+1.3.281 extensions_generated/khr/performance_query/::Instancerust-analyzer cargo ash 0.38.0+1.3.281 extensions_generated/khr/performance_query/Instance# { |
| 26 | /// Retrieve the number of elements to pass to [`enumerate_physical_device_queue_family_performance_query_counters()`][Self::enumerate_physical_device_queue_family_performance_query_counters()] |
| 27 | #[inline] |
| 28 | pub unsafe fn enumerate_physical_device_queue_family_performance_query_counters_lenrust-analyzer cargo ash 0.38.0+1.3.281 extensions/khr/performance_query/impl#[`crate::khr::performance_query::Instance`]enumerate_physical_device_queue_family_performance_query_counters_len().( |
| 29 | &self, |
| 30 | physical_device: vkrust-analyzer cargo ash 0.38.0+1.3.281 vk/::PhysicalDevicerust-analyzer cargo ash 0.38.0+1.3.281 vk/definitions/PhysicalDevice#, |
| 31 | queue_family_index: u32, |
| 32 | ) -> VkResultrust-analyzer cargo ash 0.38.0+1.3.281 prelude/VkResult#<usize> { |
| 33 | let mut count = memrust-analyzer cargo core https://github.com/rust-lang/rust/library/core mem/::MaybeUninitrust-analyzer cargo core https://github.com/rust-lang/rust/library/core mem/maybe_uninit/MaybeUninit#::uninitrust-analyzer cargo core https://github.com/rust-lang/rust/library/core mem/maybe_uninit/impl#[`MaybeUninit<T>`]uninit().(); |
| 34 | (self |
| 35 | .fprust-analyzer cargo ash 0.38.0+1.3.281 extensions_generated/khr/performance_query/Instance#fp. |
| 36 | .enumerate_physical_device_queue_family_performance_query_counters_khrrust-analyzer cargo ash 0.38.0+1.3.281 extensions_generated/khr/performance_query/InstanceFn#enumerate_physical_device_queue_family_performance_query_counters_khr.)( |
| 37 | physical_device, |
| 38 | queue_family_index, |
| 39 | count.as_mut_ptrrust-analyzer cargo core https://github.com/rust-lang/rust/library/core mem/maybe_uninit/impl#[`MaybeUninit<T>`]as_mut_ptr().(), |
| 40 | ptrrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ptr/::null_mutrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ptr/null_mut().(), |
| 41 | ptrrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ptr/::null_mutrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ptr/null_mut().(), |
| 42 | ) |
| 43 | .assume_init_on_successrust-analyzer cargo ash 0.38.0+1.3.281 prelude/impl#[`vk::Result`]assume_init_on_success().(count) |
| 44 | .maprust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`]map().(|c| c as usize) |
| 45 | } |
| 46 | |
| 47 | /// <https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/vkEnumeratePhysicalDeviceQueueFamilyPerformanceQueryCountersKHR.html> |
| 48 | /// |
| 49 | /// Call [`enumerate_physical_device_queue_family_performance_query_counters_len()`][Self::enumerate_physical_device_queue_family_performance_query_counters_len()] to query the number of elements to pass to `out_counters` and `out_counter_descriptions`. |
| 50 | /// Be sure to [`Default::default()`]-initialize these elements and optionally set their `p_next` pointer. |
| 51 | #[inline] |
| 52 | pub unsafe fn enumerate_physical_device_queue_family_performance_query_countersrust-analyzer cargo ash 0.38.0+1.3.281 extensions/khr/performance_query/impl#[`crate::khr::performance_query::Instance`]enumerate_physical_device_queue_family_performance_query_counters().( |
| 53 | &self, |
| 54 | physical_device: vkrust-analyzer cargo ash 0.38.0+1.3.281 vk/::PhysicalDevicerust-analyzer cargo ash 0.38.0+1.3.281 vk/definitions/PhysicalDevice#, |
| 55 | queue_family_index: u32, |
| 56 | out_counters: &mut [vkrust-analyzer cargo ash 0.38.0+1.3.281 vk/::PerformanceCounterKHRrust-analyzer cargo ash 0.38.0+1.3.281 vk/definitions/PerformanceCounterKHR#<'_>], |
| 57 | out_counter_descriptions: &mut [vkrust-analyzer cargo ash 0.38.0+1.3.281 vk/::PerformanceCounterDescriptionKHRrust-analyzer cargo ash 0.38.0+1.3.281 vk/definitions/PerformanceCounterDescriptionKHR#<'_>], |
| 58 | ) -> VkResultrust-analyzer cargo ash 0.38.0+1.3.281 prelude/VkResult#<()> { |
| 59 | assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(out_counters.lenrust-analyzer cargo core https://github.com/rust-lang/rust/library/core slice/impl#[`[T]`]len().(), out_counter_descriptions.lenrust-analyzer cargo core https://github.com/rust-lang/rust/library/core slice/impl#[`[T]`]len().()); |
| 60 | let mut count = out_counters.lenrust-analyzer cargo core https://github.com/rust-lang/rust/library/core slice/impl#[`[T]`]len().() as u32; |
| 61 | (self |
| 62 | .fprust-analyzer cargo ash 0.38.0+1.3.281 extensions_generated/khr/performance_query/Instance#fp. |
| 63 | .enumerate_physical_device_queue_family_performance_query_counters_khrrust-analyzer cargo ash 0.38.0+1.3.281 extensions_generated/khr/performance_query/InstanceFn#enumerate_physical_device_queue_family_performance_query_counters_khr.)( |
| 64 | physical_device, |
| 65 | queue_family_index, |
| 66 | &mut count, |
| 67 | out_counters.as_mut_ptrrust-analyzer cargo core https://github.com/rust-lang/rust/library/core slice/impl#[`[T]`]as_mut_ptr().(), |
| 68 | out_counter_descriptions.as_mut_ptrrust-analyzer cargo core https://github.com/rust-lang/rust/library/core slice/impl#[`[T]`]as_mut_ptr().(), |
| 69 | ) |
| 70 | .resultrust-analyzer cargo ash 0.38.0+1.3.281 prelude/impl#[`vk::Result`]result().()?rust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`][Try]branch().; |
| 71 | assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(count as usize, out_counters.lenrust-analyzer cargo core https://github.com/rust-lang/rust/library/core slice/impl#[`[T]`]len().()); |
| 72 | assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(count as usize, out_counter_descriptions.lenrust-analyzer cargo core https://github.com/rust-lang/rust/library/core slice/impl#[`[T]`]len().()); |
| 73 | Okrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Ok#(()) |
| 74 | } |
| 75 | |
| 76 | /// <https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/vkGetPhysicalDeviceQueueFamilyPerformanceQueryPassesKHR.html> |
| 77 | #[inline] |
| 78 | pub unsafe fn get_physical_device_queue_family_performance_query_passesrust-analyzer cargo ash 0.38.0+1.3.281 extensions/khr/performance_query/impl#[`crate::khr::performance_query::Instance`]get_physical_device_queue_family_performance_query_passes().( |
| 79 | &self, |
| 80 | physical_device: vkrust-analyzer cargo ash 0.38.0+1.3.281 vk/::PhysicalDevicerust-analyzer cargo ash 0.38.0+1.3.281 vk/definitions/PhysicalDevice#, |
| 81 | performance_query_create_info: &vkrust-analyzer cargo ash 0.38.0+1.3.281 vk/::QueryPoolPerformanceCreateInfoKHRrust-analyzer cargo ash 0.38.0+1.3.281 vk/definitions/QueryPoolPerformanceCreateInfoKHR#<'_>, |
| 82 | ) -> u32 { |
| 83 | let mut num_passes = memrust-analyzer cargo core https://github.com/rust-lang/rust/library/core mem/::MaybeUninitrust-analyzer cargo core https://github.com/rust-lang/rust/library/core mem/maybe_uninit/MaybeUninit#::uninitrust-analyzer cargo core https://github.com/rust-lang/rust/library/core mem/maybe_uninit/impl#[`MaybeUninit<T>`]uninit().(); |
| 84 | (self |
| 85 | .fprust-analyzer cargo ash 0.38.0+1.3.281 extensions_generated/khr/performance_query/Instance#fp. |
| 86 | .get_physical_device_queue_family_performance_query_passes_khrrust-analyzer cargo ash 0.38.0+1.3.281 extensions_generated/khr/performance_query/InstanceFn#get_physical_device_queue_family_performance_query_passes_khr.)( |
| 87 | physical_device, |
| 88 | performance_query_create_info, |
| 89 | num_passes.as_mut_ptrrust-analyzer cargo core https://github.com/rust-lang/rust/library/core mem/maybe_uninit/impl#[`MaybeUninit<T>`]as_mut_ptr().(), |
| 90 | ); |
| 91 | num_passes.assume_initrust-analyzer cargo core https://github.com/rust-lang/rust/library/core mem/maybe_uninit/impl#[`MaybeUninit<T>`]assume_init().() |
| 92 | } |
| 93 | } |