[−][src]Module vulkano::instance::debug
Debug callback called by intermediate layers or by the driver.
When working on an application, it is recommended to register a debug callback. 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
Example
use vulkano::instance::debug::DebugCallback; let _callback = DebugCallback::errors_and_warnings(&instance, |msg| { println!("Debug callback: {:?}", msg.description); }).ok();
The type of msg
in the callback is Message
.
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 DebugCallback
's constructor in a
variable, it will be immediately destroyed and your callback will not work.
Structs
DebugCallback | Registration of a callback called by validation layers. |
Message | A message received by the callback. |
MessageTypes | Type of message. |
Enums
DebugCallbackCreationError | Error that can happen when creating a debug callback. |