1#[doc(alias = "VK_EXT_DEBUG_REPORT_SPEC_VERSION")]
4pub const EXT_DEBUG_REPORT_SPEC_VERSION: u32 = 10;
5#[doc(alias = "VK_EXT_DEBUG_REPORT_EXTENSION_NAME")]
7pub const EXT_DEBUG_REPORT_EXTENSION_NAME: *const std::os::raw::c_char = crate::cstr!(
8 "VK_EXT_debug_report"
9);
10pub const FN_CREATE_DEBUG_REPORT_CALLBACK_EXT: *const std::os::raw::c_char = crate::cstr!(
12 "vkCreateDebugReportCallbackEXT"
13);
14pub const FN_DESTROY_DEBUG_REPORT_CALLBACK_EXT: *const std::os::raw::c_char = crate::cstr!(
16 "vkDestroyDebugReportCallbackEXT"
17);
18pub const FN_DEBUG_REPORT_MESSAGE_EXT: *const std::os::raw::c_char = crate::cstr!(
20 "vkDebugReportMessageEXT"
21);
22crate::non_dispatchable_handle!(
23 DebugReportCallbackEXT, DEBUG_REPORT_CALLBACK_EXT,
24 "[Vulkan Manual Page](https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/VkDebugReportCallbackEXT.html) · Non-dispatchable Handle",
25 "VkDebugReportCallbackEXT"
26);
27impl crate::vk1_0::Result {
29 pub const ERROR_VALIDATION_FAILED_EXT: Self = Self(-1000011001);
30}
31impl crate::vk1_0::StructureType {
33 pub const DEBUG_REPORT_CALLBACK_CREATE_INFO_EXT: Self = Self(1000011000);
34 #[deprecated]
35 pub const DEBUG_REPORT_CREATE_INFO_EXT: Self = Self::DEBUG_REPORT_CALLBACK_CREATE_INFO_EXT;
36}
37impl crate::vk1_0::ObjectType {
39 pub const DEBUG_REPORT_CALLBACK_EXT: Self = Self(1000011000);
40}
41bitflags::bitflags! {
42 #[doc =
43 "[Vulkan Manual Page](https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/VkDebugReportFlagsEXT.html) · Bitmask of [`DebugReportFlagBitsEXT`]"]
44 #[doc(alias = "VkDebugReportFlagsEXT")] #[derive(Default)] #[repr(transparent)] pub
45 struct DebugReportFlagsEXT : u32 { const INFORMATION_EXT =
46 DebugReportFlagBitsEXT::INFORMATION_EXT.0; const WARNING_EXT =
47 DebugReportFlagBitsEXT::WARNING_EXT.0; const PERFORMANCE_WARNING_EXT =
48 DebugReportFlagBitsEXT::PERFORMANCE_WARNING_EXT.0; const ERROR_EXT =
49 DebugReportFlagBitsEXT::ERROR_EXT.0; const DEBUG_EXT =
50 DebugReportFlagBitsEXT::DEBUG_EXT.0; }
51}
52#[doc(alias = "VkDebugReportFlagBitsEXT")]
54#[derive(Copy, Clone, PartialEq, Eq, Hash, Default, Ord, PartialOrd)]
55#[repr(transparent)]
56pub struct DebugReportFlagBitsEXT(pub u32);
57impl DebugReportFlagBitsEXT {
58 #[inline]
59 pub const fn bitmask(&self) -> DebugReportFlagsEXT {
61 DebugReportFlagsEXT::from_bits_truncate(self.0)
62 }
63}
64impl std::fmt::Debug for DebugReportFlagBitsEXT {
65 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
66 f.write_str(
67 match self {
68 &Self::INFORMATION_EXT => "INFORMATION_EXT",
69 &Self::WARNING_EXT => "WARNING_EXT",
70 &Self::PERFORMANCE_WARNING_EXT => "PERFORMANCE_WARNING_EXT",
71 &Self::ERROR_EXT => "ERROR_EXT",
72 &Self::DEBUG_EXT => "DEBUG_EXT",
73 _ => "(unknown variant)",
74 },
75 )
76 }
77}
78impl crate::extensions::ext_debug_report::DebugReportFlagBitsEXT {
80 pub const INFORMATION_EXT: Self = Self(1);
81 pub const WARNING_EXT: Self = Self(2);
82 pub const PERFORMANCE_WARNING_EXT: Self = Self(4);
83 pub const ERROR_EXT: Self = Self(8);
84 pub const DEBUG_EXT: Self = Self(16);
85}
86#[doc(alias = "VkDebugReportObjectTypeEXT")]
88#[derive(Copy, Clone, PartialEq, Eq, Hash, Default, Ord, PartialOrd)]
89#[repr(transparent)]
90pub struct DebugReportObjectTypeEXT(pub i32);
91impl std::fmt::Debug for DebugReportObjectTypeEXT {
92 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
93 f.write_str(
94 match self {
95 &Self::UNKNOWN_EXT => "UNKNOWN_EXT",
96 &Self::INSTANCE_EXT => "INSTANCE_EXT",
97 &Self::PHYSICAL_DEVICE_EXT => "PHYSICAL_DEVICE_EXT",
98 &Self::DEVICE_EXT => "DEVICE_EXT",
99 &Self::QUEUE_EXT => "QUEUE_EXT",
100 &Self::SEMAPHORE_EXT => "SEMAPHORE_EXT",
101 &Self::COMMAND_BUFFER_EXT => "COMMAND_BUFFER_EXT",
102 &Self::FENCE_EXT => "FENCE_EXT",
103 &Self::DEVICE_MEMORY_EXT => "DEVICE_MEMORY_EXT",
104 &Self::BUFFER_EXT => "BUFFER_EXT",
105 &Self::IMAGE_EXT => "IMAGE_EXT",
106 &Self::EVENT_EXT => "EVENT_EXT",
107 &Self::QUERY_POOL_EXT => "QUERY_POOL_EXT",
108 &Self::BUFFER_VIEW_EXT => "BUFFER_VIEW_EXT",
109 &Self::IMAGE_VIEW_EXT => "IMAGE_VIEW_EXT",
110 &Self::SHADER_MODULE_EXT => "SHADER_MODULE_EXT",
111 &Self::PIPELINE_CACHE_EXT => "PIPELINE_CACHE_EXT",
112 &Self::PIPELINE_LAYOUT_EXT => "PIPELINE_LAYOUT_EXT",
113 &Self::RENDER_PASS_EXT => "RENDER_PASS_EXT",
114 &Self::PIPELINE_EXT => "PIPELINE_EXT",
115 &Self::DESCRIPTOR_SET_LAYOUT_EXT => "DESCRIPTOR_SET_LAYOUT_EXT",
116 &Self::SAMPLER_EXT => "SAMPLER_EXT",
117 &Self::DESCRIPTOR_POOL_EXT => "DESCRIPTOR_POOL_EXT",
118 &Self::DESCRIPTOR_SET_EXT => "DESCRIPTOR_SET_EXT",
119 &Self::FRAMEBUFFER_EXT => "FRAMEBUFFER_EXT",
120 &Self::COMMAND_POOL_EXT => "COMMAND_POOL_EXT",
121 &Self::SURFACE_KHR_EXT => "SURFACE_KHR_EXT",
122 &Self::SWAPCHAIN_KHR_EXT => "SWAPCHAIN_KHR_EXT",
123 &Self::DEBUG_REPORT_CALLBACK_EXT_EXT => "DEBUG_REPORT_CALLBACK_EXT_EXT",
124 &Self::DISPLAY_KHR_EXT => "DISPLAY_KHR_EXT",
125 &Self::DISPLAY_MODE_KHR_EXT => "DISPLAY_MODE_KHR_EXT",
126 &Self::VALIDATION_CACHE_EXT_EXT => "VALIDATION_CACHE_EXT_EXT",
127 &Self::SAMPLER_YCBCR_CONVERSION_EXT => "SAMPLER_YCBCR_CONVERSION_EXT",
128 &Self::DESCRIPTOR_UPDATE_TEMPLATE_EXT => "DESCRIPTOR_UPDATE_TEMPLATE_EXT",
129 &Self::CU_MODULE_NVX_EXT => "CU_MODULE_NVX_EXT",
130 &Self::CU_FUNCTION_NVX_EXT => "CU_FUNCTION_NVX_EXT",
131 &Self::ACCELERATION_STRUCTURE_KHR_EXT => "ACCELERATION_STRUCTURE_KHR_EXT",
132 &Self::ACCELERATION_STRUCTURE_NV_EXT => "ACCELERATION_STRUCTURE_NV_EXT",
133 &Self::BUFFER_COLLECTION_FUCHSIA_EXT => "BUFFER_COLLECTION_FUCHSIA_EXT",
134 _ => "(unknown variant)",
135 },
136 )
137 }
138}
139impl crate::extensions::ext_debug_report::DebugReportObjectTypeEXT {
141 pub const UNKNOWN_EXT: Self = Self(0);
142 pub const INSTANCE_EXT: Self = Self(1);
143 pub const PHYSICAL_DEVICE_EXT: Self = Self(2);
144 pub const DEVICE_EXT: Self = Self(3);
145 pub const QUEUE_EXT: Self = Self(4);
146 pub const SEMAPHORE_EXT: Self = Self(5);
147 pub const COMMAND_BUFFER_EXT: Self = Self(6);
148 pub const FENCE_EXT: Self = Self(7);
149 pub const DEVICE_MEMORY_EXT: Self = Self(8);
150 pub const BUFFER_EXT: Self = Self(9);
151 pub const IMAGE_EXT: Self = Self(10);
152 pub const EVENT_EXT: Self = Self(11);
153 pub const QUERY_POOL_EXT: Self = Self(12);
154 pub const BUFFER_VIEW_EXT: Self = Self(13);
155 pub const IMAGE_VIEW_EXT: Self = Self(14);
156 pub const SHADER_MODULE_EXT: Self = Self(15);
157 pub const PIPELINE_CACHE_EXT: Self = Self(16);
158 pub const PIPELINE_LAYOUT_EXT: Self = Self(17);
159 pub const RENDER_PASS_EXT: Self = Self(18);
160 pub const PIPELINE_EXT: Self = Self(19);
161 pub const DESCRIPTOR_SET_LAYOUT_EXT: Self = Self(20);
162 pub const SAMPLER_EXT: Self = Self(21);
163 pub const DESCRIPTOR_POOL_EXT: Self = Self(22);
164 pub const DESCRIPTOR_SET_EXT: Self = Self(23);
165 pub const FRAMEBUFFER_EXT: Self = Self(24);
166 pub const COMMAND_POOL_EXT: Self = Self(25);
167 pub const SURFACE_KHR_EXT: Self = Self(26);
168 pub const SWAPCHAIN_KHR_EXT: Self = Self(27);
169 pub const DEBUG_REPORT_CALLBACK_EXT_EXT: Self = Self(28);
170 pub const DISPLAY_KHR_EXT: Self = Self(29);
171 pub const DISPLAY_MODE_KHR_EXT: Self = Self(30);
172 pub const VALIDATION_CACHE_EXT_EXT: Self = Self(33);
173 pub const SAMPLER_YCBCR_CONVERSION_EXT: Self = Self(1000156000);
174 pub const DESCRIPTOR_UPDATE_TEMPLATE_EXT: Self = Self(1000085000);
175 #[deprecated]
176 pub const DEBUG_REPORT_EXT: Self = Self::DEBUG_REPORT_CALLBACK_EXT_EXT;
177 #[deprecated]
178 pub const VALIDATION_CACHE_EXT: Self = Self::VALIDATION_CACHE_EXT_EXT;
179}
180#[allow(non_camel_case_types)]
182pub type PFN_vkCreateDebugReportCallbackEXT = unsafe extern "system" fn(
183 instance: crate::vk1_0::Instance,
184 p_create_info: *const crate::extensions::ext_debug_report::DebugReportCallbackCreateInfoEXT,
185 p_allocator: *const crate::vk1_0::AllocationCallbacks,
186 p_callback: *mut crate::extensions::ext_debug_report::DebugReportCallbackEXT,
187) -> crate::vk1_0::Result;
188#[allow(non_camel_case_types)]
190pub type PFN_vkDestroyDebugReportCallbackEXT = unsafe extern "system" fn(
191 instance: crate::vk1_0::Instance,
192 callback: crate::extensions::ext_debug_report::DebugReportCallbackEXT,
193 p_allocator: *const crate::vk1_0::AllocationCallbacks,
194) -> ();
195#[allow(non_camel_case_types)]
197pub type PFN_vkDebugReportMessageEXT = unsafe extern "system" fn(
198 instance: crate::vk1_0::Instance,
199 flags: crate::extensions::ext_debug_report::DebugReportFlagsEXT,
200 object_type: crate::extensions::ext_debug_report::DebugReportObjectTypeEXT,
201 object: u64,
202 location: usize,
203 message_code: i32,
204 p_layer_prefix: *const std::os::raw::c_char,
205 p_message: *const std::os::raw::c_char,
206) -> ();
207#[allow(non_camel_case_types)]
209pub type PFN_vkDebugReportCallbackEXT = unsafe extern "system" fn(
210 flags: crate::extensions::ext_debug_report::DebugReportFlagsEXT,
211 object_type: crate::extensions::ext_debug_report::DebugReportObjectTypeEXT,
212 object: u64,
213 location: usize,
214 message_code: i32,
215 p_layer_prefix: *const std::os::raw::c_char,
216 p_message: *const std::os::raw::c_char,
217 p_user_data: *mut std::ffi::c_void,
218) -> crate::vk1_0::Bool32;
219impl<'a> crate::ExtendableFrom<'a, DebugReportCallbackCreateInfoEXT>
220for crate::vk1_0::InstanceCreateInfoBuilder<'a> {}
221impl<'a> crate::ExtendableFrom<'a, DebugReportCallbackCreateInfoEXTBuilder<'_>>
222for crate::vk1_0::InstanceCreateInfoBuilder<'a> {}
223#[doc(alias = "VkDebugReportCallbackCreateInfoEXT")]
225#[derive(Copy, Clone)]
226#[repr(C)]
227pub struct DebugReportCallbackCreateInfoEXT {
228 pub s_type: crate::vk1_0::StructureType,
229 pub p_next: *const std::ffi::c_void,
230 pub flags: crate::extensions::ext_debug_report::DebugReportFlagsEXT,
231 pub pfn_callback: Option<
232 crate::extensions::ext_debug_report::PFN_vkDebugReportCallbackEXT,
233 >,
234 pub p_user_data: *mut std::ffi::c_void,
235}
236impl DebugReportCallbackCreateInfoEXT {
237 pub const STRUCTURE_TYPE: crate::vk1_0::StructureType = crate::vk1_0::StructureType::DEBUG_REPORT_CALLBACK_CREATE_INFO_EXT;
238}
239impl Default for DebugReportCallbackCreateInfoEXT {
240 fn default() -> Self {
241 Self {
242 s_type: Self::STRUCTURE_TYPE,
243 p_next: std::ptr::null(),
244 flags: Default::default(),
245 pfn_callback: Default::default(),
246 p_user_data: std::ptr::null_mut(),
247 }
248 }
249}
250impl std::fmt::Debug for DebugReportCallbackCreateInfoEXT {
251 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
252 f.debug_struct("DebugReportCallbackCreateInfoEXT")
253 .field("s_type", &self.s_type)
254 .field("p_next", &self.p_next)
255 .field("flags", &self.flags)
256 .field(
257 "pfn_callback",
258 unsafe { &std::mem::transmute::<_, *const ()>(self.pfn_callback) },
259 )
260 .field("p_user_data", &self.p_user_data)
261 .finish()
262 }
263}
264impl DebugReportCallbackCreateInfoEXT {
265 #[inline]
266 pub fn into_builder<'a>(self) -> DebugReportCallbackCreateInfoEXTBuilder<'a> {
267 DebugReportCallbackCreateInfoEXTBuilder(self, std::marker::PhantomData)
268 }
269}
270#[derive(Copy, Clone)]
271#[repr(transparent)]
273pub struct DebugReportCallbackCreateInfoEXTBuilder<'a>(
274 DebugReportCallbackCreateInfoEXT,
275 std::marker::PhantomData<&'a ()>,
276);
277impl<'a> DebugReportCallbackCreateInfoEXTBuilder<'a> {
278 #[inline]
279 pub fn new() -> DebugReportCallbackCreateInfoEXTBuilder<'a> {
280 DebugReportCallbackCreateInfoEXTBuilder(
281 Default::default(),
282 std::marker::PhantomData,
283 )
284 }
285 #[inline]
286 #[must_use]
287 pub fn flags(
288 mut self,
289 flags: crate::extensions::ext_debug_report::DebugReportFlagsEXT,
290 ) -> Self {
291 self.0.flags = flags as _;
292 self
293 }
294 #[inline]
295 #[must_use]
296 pub fn pfn_callback(
297 mut self,
298 pfn_callback: Option<
299 crate::extensions::ext_debug_report::PFN_vkDebugReportCallbackEXT,
300 >,
301 ) -> Self {
302 self.0.pfn_callback = pfn_callback as _;
303 self
304 }
305 #[inline]
306 #[must_use]
307 pub fn user_data(mut self, user_data: *mut std::ffi::c_void) -> Self {
308 self.0.p_user_data = user_data;
309 self
310 }
311 #[inline]
312 pub fn build_dangling(self) -> DebugReportCallbackCreateInfoEXT {
315 self.0
316 }
317}
318impl<'a> std::default::Default for DebugReportCallbackCreateInfoEXTBuilder<'a> {
319 fn default() -> DebugReportCallbackCreateInfoEXTBuilder<'a> {
320 Self::new()
321 }
322}
323impl<'a> std::fmt::Debug for DebugReportCallbackCreateInfoEXTBuilder<'a> {
324 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
325 std::fmt::Debug::fmt(&self.0, f)
326 }
327}
328impl<'a> std::ops::Deref for DebugReportCallbackCreateInfoEXTBuilder<'a> {
329 type Target = DebugReportCallbackCreateInfoEXT;
330 fn deref(&self) -> &Self::Target {
331 &self.0
332 }
333}
334impl<'a> std::ops::DerefMut for DebugReportCallbackCreateInfoEXTBuilder<'a> {
335 fn deref_mut(&mut self) -> &mut Self::Target {
336 &mut self.0
337 }
338}
339impl crate::InstanceLoader {
341 #[inline]
342 #[track_caller]
343 #[doc(alias = "vkCreateDebugReportCallbackEXT")]
345 pub unsafe fn create_debug_report_callback_ext(
346 &self,
347 create_info: &crate::extensions::ext_debug_report::DebugReportCallbackCreateInfoEXT,
348 allocator: Option<&crate::vk1_0::AllocationCallbacks>,
349 ) -> crate::utils::VulkanResult<
350 crate::extensions::ext_debug_report::DebugReportCallbackEXT,
351 > {
352 let _function = self
353 .create_debug_report_callback_ext
354 .expect(crate::NOT_LOADED_MESSAGE);
355 let mut callback = Default::default();
356 let _return = _function(
357 self.handle,
358 create_info as _,
359 match allocator {
360 Some(v) => v,
361 None => std::ptr::null(),
362 },
363 &mut callback,
364 );
365 crate::utils::VulkanResult::new(_return, callback)
366 }
367 #[inline]
368 #[track_caller]
369 #[doc(alias = "vkDestroyDebugReportCallbackEXT")]
371 pub unsafe fn destroy_debug_report_callback_ext(
372 &self,
373 callback: crate::extensions::ext_debug_report::DebugReportCallbackEXT,
374 allocator: Option<&crate::vk1_0::AllocationCallbacks>,
375 ) -> () {
376 let _function = self
377 .destroy_debug_report_callback_ext
378 .expect(crate::NOT_LOADED_MESSAGE);
379 let _return = _function(
380 self.handle,
381 callback as _,
382 match allocator {
383 Some(v) => v,
384 None => std::ptr::null(),
385 },
386 );
387 ()
388 }
389 #[inline]
390 #[track_caller]
391 #[doc(alias = "vkDebugReportMessageEXT")]
393 pub unsafe fn debug_report_message_ext(
394 &self,
395 flags: crate::extensions::ext_debug_report::DebugReportFlagsEXT,
396 object_type: crate::extensions::ext_debug_report::DebugReportObjectTypeEXT,
397 object: u64,
398 location: usize,
399 message_code: i32,
400 layer_prefix: Option<&std::ffi::CStr>,
401 message: Option<&std::ffi::CStr>,
402 ) -> () {
403 let _function = self.debug_report_message_ext.expect(crate::NOT_LOADED_MESSAGE);
404 let _return = _function(
405 self.handle,
406 flags as _,
407 object_type as _,
408 object as _,
409 location as _,
410 message_code as _,
411 match layer_prefix {
412 Some(v) => v.as_ptr(),
413 None => std::ptr::null(),
414 },
415 match message {
416 Some(v) => v.as_ptr(),
417 None => std::ptr::null(),
418 },
419 );
420 ()
421 }
422}