| 1 | //! <https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/VK_EXT_debug_report.html> |
| 2 | |
| 3 | use crate::prelude::*; |
| 4 | use crate::vk; |
| 5 | use crate::RawPtr; |
| 6 | use core::mem; |
| 7 | |
| 8 | impl crate::ext::debug_report::Instance { |
| 9 | /// <https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/vkDestroyDebugReportCallbackEXT.html> |
| 10 | #[inline] |
| 11 | pub unsafe fn destroy_debug_report_callback( |
| 12 | &self, |
| 13 | debug: vk::DebugReportCallbackEXT, |
| 14 | allocation_callbacks: Option<&vk::AllocationCallbacks<'_>>, |
| 15 | ) { |
| 16 | (self.fp.destroy_debug_report_callback_ext)( |
| 17 | self.handle, |
| 18 | debug, |
| 19 | allocation_callbacks.as_raw_ptr(), |
| 20 | ); |
| 21 | } |
| 22 | |
| 23 | /// <https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/vkCreateDebugReportCallbackEXT.html> |
| 24 | #[inline] |
| 25 | pub unsafe fn create_debug_report_callback( |
| 26 | &self, |
| 27 | create_info: &vk::DebugReportCallbackCreateInfoEXT<'_>, |
| 28 | allocation_callbacks: Option<&vk::AllocationCallbacks<'_>>, |
| 29 | ) -> VkResult<vk::DebugReportCallbackEXT> { |
| 30 | let mut debug_cb = mem::MaybeUninit::uninit(); |
| 31 | (self.fp.create_debug_report_callback_ext)( |
| 32 | self.handle, |
| 33 | create_info, |
| 34 | allocation_callbacks.as_raw_ptr(), |
| 35 | debug_cb.as_mut_ptr(), |
| 36 | ) |
| 37 | .assume_init_on_success(debug_cb) |
| 38 | } |
| 39 | } |