Expand description
Debug messenger called by intermediate layers or by the driver.
When working on an application, it is recommended to register a debug messenger. For example if you enable the validation layers provided by the official Vulkan SDK, they will warn you about invalid API usages or performance problems by calling this callback. The callback can also be called by the driver or by whatever intermediate layer is activated.
Note that the vulkano library can also emit messages to warn you about performance issues. TODO: ^ that’s not the case yet, need to choose whether we keep this idea
Examples
use vulkano::instance::debug::{
DebugUtilsMessenger, DebugUtilsMessengerCallback, DebugUtilsMessengerCreateInfo,
};
let _callback = unsafe {
DebugUtilsMessenger::new(
instance,
DebugUtilsMessengerCreateInfo::user_callback(
DebugUtilsMessengerCallback::new(|message_severity, message_type, callback_data| {
println!("Debug callback: {:?}", callback_data.message);
}),
),
).ok()
};
Note that you must keep the _callback
object alive for as long as you want your callback to
be callable. If you don’t store the return value of DebugUtilsMessenger
’s constructor in a
variable, it will be immediately destroyed and your callback will not work.
Structs
- A label to associate with a span of work in a queue.
- Severity of message.
- Type of message.
- Registration of a callback called by validation layers.
- The callback function for debug messages.
- The data of a message received by the user callback.
- The values of
DebugUtilsLabel
, as returned to a messenger callback. - An object that triggered a callback.
- Parameters to create a
DebugUtilsMessenger
.
Enums
- Features of the validation layer to disable.
- Features of the validation layer to enable.