Set VK_LAYER_KHRONOS_validation to Optional in case layer not available#1522
Open
SRSaunders wants to merge 4 commits intoKhronosGroup:mainfrom
Open
Set VK_LAYER_KHRONOS_validation to Optional in case layer not available#1522SRSaunders wants to merge 4 commits intoKhronosGroup:mainfrom
SRSaunders wants to merge 4 commits intoKhronosGroup:mainfrom
Conversation
…le for debug builds
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
This PR fixes a few small issues found when testing on the iOS Simulator, and on Windows 11 with no SDK installed:
VK_LAYER_KHRONOS_validationto be Optional for debug builds vs. Required. This applies to all platforms but allows debug builds to run even when the validation layer is not available. This is important for several use cases: a) Windows users who do not install the SDK, and b) on the iOS Simulator where the VVL library is not built or available for that target. I debated this change before making it, but I believe it is correct given that Windows build docs do not mention or require installation of the SDK, and the default build config for Visual Studio is debug. I am interested in feedback from maintainers on this regarding project intentions: i.e. Required forces a runtime error that prevents samples from running in debug mode for the above scenarios, or Optional which allows execution with a runtime warning message instead. I believe the latter is more appropriate.VK_LAYER_KHRONOS_validationset to the original Required.VK_FORMAT_UNDEFINEDfor the depth format when using dynamic rendering. While Vulkan technically allows the pipeline to be created with a defined depth format, even while rendering uses a null depth attachment, this is not necessarily the best practice. Looking at docs and recommendations for dynamic rendering, the both the pipeline and rendering steps should indidate that no depth attachment will be used in cases like gui overlay rendering as implemented in this project. Note the gui pipeline already specifiesdepthTestEnable = falseanddepthWriteEnable = falseso I felt it was appropriate to also setdepthAttachmentFormat = VK_FORMAT_UNDEFINED. This has the added benefit of allowed the VVL to identify a mismatch case if the gui ever erroneously specifies a non-null depth attachment during dynamic rendering for the gui. Note I found this issue not from the VVL, but because Metal validation picks it up.Fixes #1523.
Tested on Windows 11, macOS Sequoia, iOS 26, and iOS Simulator running iOS 26.
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: