Skip to content
Open
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions antora/modules/ROOT/nav.adoc
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
////
- Copyright (c) 2023-2025, Holochip Inc
- Copyright (c) 2023-2025, Sascha Willems
- Copyright (c) 2023-2026, Holochip Inc
- Copyright (c) 2023-2026, Sascha Willems
- Copyright (c) 2025, Arm Limited and Contributors
-
- SPDX-License-Identifier: Apache-2.0
Expand Down
3 changes: 2 additions & 1 deletion samples/extensions/README.adoc
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
////
- Copyright (c) 2021-2025, The Khronos Group
- Copyright (c) 2025, Arm Limited and Contributors
- Copyright (c) 2021-2026, The Khronos Group
-
- SPDX-License-Identifier: Apache-2.0
-
Expand Down
2 changes: 1 addition & 1 deletion samples/extensions/layer_settings/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright (c) 2025, Holochip Inc.
# Copyright (c) 2025-2026, Holochip Inc.
#
# SPDX-License-Identifier: Apache-2.0
#
Expand Down
29 changes: 27 additions & 2 deletions samples/extensions/layer_settings/README.adoc
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
////
- Copyright (c) 2025, Holochip Inc
- Copyright (c) 2026, Holochip Inc
-
- SPDX-License-Identifier: Apache-2.0
-
Expand Down Expand Up @@ -38,7 +38,32 @@ VK_EXT_layer_settings supersedes the older `VK_EXT_validation_features` and `VK_
- 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).
- Runs a minimal frame loop that presents without validation errors (uses a small per‑frame command buffer that transitions the swapchain image to `PRESENT`).
- Provides an interactive UI with toggleable validation scenarios that demonstrate common mistakes:
- *Wrong Buffer Flags*: Creates a buffer with `TRANSFER_DST` usage but binds it as a vertex buffer (missing `VERTEX_BUFFER_BIT`).
- *Suboptimal Transitions*: Performs image layout transitions to `GENERAL` instead of more optimal layouts like `COLOR_ATTACHMENT_OPTIMAL`.
- *Many Small Allocations*: Creates numerous small memory allocations (512 bytes each) instead of suballocating from larger blocks.
- Displays validation messages in real-time within the application UI, showing warning counts per scenario and total statistics.
- Works on all platforms without requiring terminal access to see validation output.

== How to use this sample

When you run the sample, you'll see an interactive UI with checkboxes for each validation scenario:

1. *Enable scenarios individually*: Check the boxes to activate specific Best Practices violations.
2. *Observe validation messages*: Watch the "Recent Validation Messages" section populate with warnings as scenarios trigger.
3. *Review statistics*: See warning counts per scenario and total counts at the bottom.
4. *Learn from mistakes*: Each scenario demonstrates a real-world mistake that Best Practices validation catches.

=== What each scenario teaches

*Wrong Buffer Flags*::
Demonstrates the importance of declaring correct usage flags at buffer creation time. Using a buffer without the appropriate usage bit (e.g., `VERTEX_BUFFER_BIT`) can lead to undefined behavior or performance issues on some implementations.

*Suboptimal Transitions*::
Shows why choosing the right image layout matters. Transitioning to `GENERAL` layout is legal but often suboptimal—specific layouts like `COLOR_ATTACHMENT_OPTIMAL` or `SHADER_READ_ONLY_OPTIMAL` enable better performance.

*Many Small Allocations*::
Demonstrates why suballocation is important. Creating hundreds of tiny memory allocations wastes resources and can hit driver limits. Use a memory allocator library (like VMA) or implement suballocation.

== When to use it vs. alternatives
- Prefer VK_EXT_layer_settings whenever you need to configure validation from within your app (development builds, samples, tools).
Expand Down
Loading
Loading