-
Notifications
You must be signed in to change notification settings - Fork 782
Add sample demonstrating VK_EXT_layer_settings usage #1419
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
|
This does work, but it feels a bit too minimalist. Wouldn't it make more sense to actually trigger some best practices thing (e.g. using wrong buffer flags or doing non-optimal transitions) and have them show up in the application's UI instead? Otherwise one has to scroll to the very top of the terminal to see some validation infos. And that does only work on platforms where you actually have a terminal. |
|
I had thought keeping it simple was going to make it easier to take and use elsewhere; but went ahead and made the changes recommended. |
|
So this is just supposed to be a black screen with some UI messages (that get cropped at the right side of the screen)? |
| - Enables the instance extension `VK_EXT_layer_settings` (optionally). | ||
| - Adds settings for the Khronos validation layer before the Vulkan instance is created: | ||
| - Enables Best Practices checks. | ||
| - Enables `debugPrintfEXT` support (so shader `debugPrintf` messages are emitted via validation). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Those two bullet points are not rendered as sub-points.
| if (strcmp(e.extensionName, VK_EXT_LAYER_SETTINGS_EXTENSION_NAME) == 0) | ||
| return true; | ||
| } | ||
| return false; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe:
return std::ranges::find_if( exts, []( auto const & property ){ return strcmp( property.extensionName, VK_EXT_LAYER_SETTINGS_EXTENSION_NAME ) == 0; } ) != exts.end();
| } | ||
| else | ||
| { | ||
| // Fallback for older SDKs: use VK_EXT_validation_features |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No need to check for VK_EXT_validation_features support?
| { | ||
| VkInstance instance = get_instance().get_handle(); | ||
| auto fpDestroy = reinterpret_cast<PFN_vkDestroyDebugUtilsMessengerEXT>( | ||
| vkGetInstanceProcAddr(instance, "vkDestroyDebugUtilsMessengerEXT")); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why do you explicitly get the function pointer? As volk is initialized by the framework, just calling
vkDestroyDebugUtilsMessengerEXT(instance, debug_messenger_, nullptr); works as well
|
|
||
| // Install a local DebugUtils messenger to collect validation messages into the UI. | ||
| // If it was already created during create_instance(), skip to avoid duplication. | ||
| if (debug_messenger_ == VK_NULL_HANDLE && get_instance().is_enabled(VK_EXT_DEBUG_UTILS_EXTENSION_NAME)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't get this.
Under what circumstances would the debug_messenger_ not be created during create_instance, which is called before this function?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
On my configuration (Win10, NVIDIA GPU), this sample never gets to appending some line to the log_text_.
# Conflicts: # samples/extensions/README.adoc
…aching Transforms layer_settings sample into an interactive demonstration with three toggleable validation scenarios (wrong buffer flags, suboptimal transitions, small allocations). Executes validation-triggering operations once during setup using one-time command buffers to work with message caching. Adds per-scenario warning/error counters, message caching, and resource cleanup. Updates UI with checkboxes, statistics display, and scrollable message viewer with improved styling.
Description
Demonstrate and provide a tutorial for using VK_EXT_layer_settings
Fixes #
General Checklist:
Please ensure the following points are checked:
Note: The Samples CI runs a number of checks including:
If this PR contains framework changes:
batchcommand line argument to make sure all samples still work properlySample Checklist
If your PR contains a new or modified sample, these further checks must be carried out in addition to the General Checklist: