Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Errors printed to stdout with validation layers, but no callback

Tags:

vulkan

I've followed this tutorial and when setting up validation layers the author says we have to setup debug callbacks so logs can be printed in stdout.

I didn't set them up and yet the application is printing various error messages in my terminal : Swapchain(ERROR): object 0x1cdd2d0 type: 1 location: 292 msgCode: 3: VkDestroyInstance() called before all of its associated VkSurfaceKHRs were destroyed for instance, when omitting the call to vkDestroySurfaceKHR.

I'm using VK_LAYER_LUNARG_standard_validation, and no particular extension (only VK_KHR_surface and VK_KHR_xcb_surface).

Is this expected behaviour?

like image 303
pleluron Avatar asked Mar 17 '26 06:03

pleluron


1 Answers

The default logging behavior for the validation layers was changed back around June 1 because people wanted the messages to go to stdout without having to provide a callback or putting a vk_layer_settings.txt in the application's directory. The tutorial website might be out of date in this area.

If this is unwanted behavior, the easiest way to change it is to get a copy of vk_layer_settings.txt (shipped in SDK) and edit it to change the behavior to what you want, and then place it in what is the current directory when the application starts.

As an alternative, you can also code a debug callback.

For more info, please see the layer docs on the LunarXchange website.

like image 194
Karl Schultz Avatar answered Mar 19 '26 15:03

Karl Schultz