Skip to content

Conversation

@gpx1000
Copy link
Collaborator

@gpx1000 gpx1000 commented Oct 16, 2025

Description

Demonstrate and provide a tutorial for using VK_EXT_layer_settings

Fixes #

General Checklist:

Please ensure the following points are checked:

  • My code follows the coding style
  • I have reviewed file licenses
  • I have commented any added functions (in line with Doxygen)
  • I have commented any code that could be hard to understand
  • My changes do not add any new compiler warnings
  • My changes do not add any new validation layer errors or warnings
  • I have used existing framework/helper functions where possible
  • My changes do not add any regressions
  • I have tested every sample to ensure everything runs correctly
  • This PR describes the scope and expected impact of the changes I am making

Note: The Samples CI runs a number of checks including:

  • I have updated the header Copyright to reflect the current year (CI build will fail if Copyright is out of date)
  • My changes build on Windows, Linux, macOS and Android. Otherwise I have documented any exceptions

If this PR contains framework changes:

  • I did a full batch run using the batch command line argument to make sure all samples still work properly

Sample Checklist

If your PR contains a new or modified sample, these further checks must be carried out in addition to the General Checklist:

  • I have tested the sample on at least one compliant Vulkan implementation
  • If the sample is vendor-specific, I have tagged it appropriately
  • I have stated on what implementation the sample has been tested so that others can test on different implementations and platforms
  • Any dependent assets have been merged and published in downstream modules
  • For new samples, I have added a paragraph with a summary to the appropriate chapter in the readme of the folder that the sample belongs to e.g. api samples readme
  • For new samples, I have added a tutorial README.md file to guide users through what they need to know to implement code using this feature. For example, see conditional_rendering
  • For new samples, I have added a link to the Antora navigation so that the sample will be listed at the Vulkan documentation site

@SaschaWillems
Copy link
Collaborator

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.

@gpx1000
Copy link
Collaborator Author

gpx1000 commented Oct 19, 2025

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.

@gary-sweet
Copy link
Contributor

So this is just supposed to be a black screen with some UI messages (that get cropped at the right side of the screen)?

# 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.
…rnize C++ usage

Replaces `std::array` with `std::unordered_map<Scenario, ScenarioState>` for scenario state storage, removing the `Scenario::Count` sentinel. Adds custom hash functor for the enum key. Modernizes code with `std::format`, `std::ranges`, and direct use of `vkCreateDebugUtilsMessengerEXT`. Updates README list formatting, adds `validation_features_supported()` helper, and initializes scenario map entries in constructor. Improves code consistency with better whitespace and comment cleanup.
@gpx1000
Copy link
Collaborator Author

gpx1000 commented Jan 8, 2026

To be clear, when you toggle the three items in the UI, you will see the warnings assiated with those 3 items. The background is clear as I thought this the best way to demonstrate the feature.

@gpx1000
Copy link
Collaborator Author

gpx1000 commented Jan 8, 2026

Successful CI Building will depend upon the updated clang tidy call in #1418 Please ensure that is taken before validating that this one is CI clean.

@gary-sweet
Copy link
Contributor

This has the same std::format build problems for me as the pipeline_binary sample. We'll need to discuss (and hopefully undo) those format changes so that Broadcom can build the samples.

// Check if all scenarios are disabled and clear log if so
bool any_enabled = false;
for (const auto &state : scenario_states_)
for (const auto &kv : scenario_states_)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What does kv stand for?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants