Fix push constant range validation with multiple entry points#866
Open
rjodinchr wants to merge 1 commit into
Open
Fix push constant range validation with multiple entry points#866rjodinchr wants to merge 1 commit into
rjodinchr wants to merge 1 commit into
Conversation
When a program has multiple entry points, and only a subset of them use image/sampler metadata, the SPIR-V shader declares a larger push constant block that accommodates all potential metadata across the program. Previously, the push constant range in the pipeline layout was calculated per entry point in `cvk_entry_point::init()`. This resulted in a mismatch between the declared SPIR-V push constant block size and the pipeline layout's push constant range size on entry points without metadata usage, triggering Vulkan validation layer errors. This commit resolves the issue by: * Moving the complete push constant range calculation from `cvk_entry_point` to `cvk_program::prepare_push_constant_range()`. * Consolidating all potential push constant sources (binary constants, push constant kernel arguments, image metadata, and sampler metadata) upfront across the entire program. * Ensuring the pipeline layout's push constant range consistently covers the maximum declared SPIR-V block size across all entry points. * Updating the POD buffer size assertion in `create_pod_buffer()` to precisely match `m_entry_point->pod_buffer_size()`.
Contributor
Author
|
Note that we do not see that error in the GitHub CI because the VVL we use is too old. |
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.
When a program has multiple entry points, and only a subset of them use image/sampler metadata, the SPIR-V shader declares a larger push constant block that accommodates all potential metadata across the program. Previously, the push constant range in the pipeline layout was calculated per entry point in
cvk_entry_point::init(). This resulted in a mismatch between the declared SPIR-V push constant block size and the pipeline layout's push constant range size on entry points without metadata usage, triggering Vulkan validation layer errors.This commit resolves the issue by:
cvk_entry_pointtocvk_program::prepare_push_constant_range().create_pod_buffer()to precisely matchm_entry_point->pod_buffer_size().