/// Creates a new Debug Extension for vulkan with the associated user data for
/// the debug callback, if provided.
///
/// This user data must be Sync, which is garunteed by Arc.
Creates a new Debug Extension for vulkan with the associated user data for
the debug callback, if provided.

This user data must be Sync, which is garunteed by Arc.
Creates a new Debug Extension for vulkan with the associated user data for the debug callback if provided . This user data must be Sync which is garunteed by Arc .
pub fn new(
    entry: &Entry, instance: &Instance, severity_flags: vk::DebugUtilsMessageSeverityFlagsEXT,
    type_flags: vk::DebugUtilsMessageTypeFlagsEXT,
    debug_user_data: Option<Pin<Arc<DebugUserData>>>,
  ) -> Self {
    let debug_user_data = if let Some(debug_user_data) = debug_user_data {
      debug_user_data
    } else {
      Arc::pin(DebugUserData::new())
    };
    let debug_user_data_ptr =
      unsafe { Arc::into_raw(Pin::into_inner_unchecked(debug_user_data.clone())) as *mut c_void };
    let debug_utils = DebugUtils::new(entry, instance);
    let messenger_ci = vk::DebugUtilsMessengerCreateInfoEXT::builder()
      .message_severity(severity_flags)
      .message_type(type_flags)
      .pfn_user_callback(Some(Self::debug_callback))
      .user_data(debug_user_data_ptr)
      .build();
    let messenger = unsafe {
      debug_utils
        .create_debug_utils_messenger(&messenger_ci, None)
        .expect("Could not create debug utils messenger")
    };
    DebugUtilsAndMessenger {
      debug_utils,
      messenger,
      debug_user_data,
    }
  }
pub fn new ( entry : & Entry , instance : & Instance , severity_flags : vk :: DebugUtilsMessageSeverityFlagsEXT , type_flags : vk :: DebugUtilsMessageTypeFlagsEXT , debug_user_data : Option < Pin < Arc < DebugUserData > > > , ) -> Self { let debug_user_data = if let Some ( debug_user_data ) = debug_user_data { debug_user_data } else { Arc :: pin ( DebugUserData :: new ( ) ) } ; let debug_user_data_ptr = unsafe { Arc :: into_raw ( Pin :: into_inner_unchecked ( debug_user_data . clone ( ) ) ) as * mut c_void } ; let debug_utils = DebugUtils :: new ( entry , instance ) ; let messenger_ci = vk :: DebugUtilsMessengerCreateInfoEXT :: builder ( ) . message_severity ( severity_flags ) . message_type ( type_flags ) . pfn_user_callback ( Some ( Self :: debug_callback ) ) . user_data ( debug_user_data_ptr ) . build ( ) ; let messenger = unsafe { debug_utils . create_debug_utils_messenger ( & messenger_ci , None ) . expect ( " " ) } ; DebugUtilsAndMessenger { debug_utils , messenger , debug_user_data , } }
Creates a new Debug Extension for vulkan with the associated user data for
the debug callback, if provided.
Creates a new Debug Extension for vulkan with the associated user data for the debug callback if provided .
entry
&Entry
instance
&Instance
severity_flags
vk::DebugUtilsMessageSeverityFlagsEXT
type_flags
vk::DebugUtilsMessageTypeFlagsEXT
debug_user_data
Option<Pin<Arc<DebugUserData>>>