Repository navigation
safe_struct: Copy every pSampleMask word - #423
Merged
Merged
Conversation
ziga-lunarg
approved these changes
Nov 22, 2026
Contributor
|
@lordalcol Can you rebase |
In 2017 (VVL GH1383) the generator read the latexmath length of pSampleMask as rasterizationSamples/32, which is 0 below 32 samples, so the copy was empty. The fix copied a single element for every length with a division. The length now comes from altlen as (rasterizationSamples + 31) / 32. pSampleMask is the only such array without custom code (pCode has its own). A 64-sample mask loses its second word, so VVL reads past the copy when it compares two words for pLibraries-06635 and reports the error at random. Copy the whole array, and put the length in parentheses since it is multiplied by the element size.
lordalcol
force-pushed
the
sample-mask-copy
branch
from
November 23, 2026 10:04
fc0b9f8 to
b75d4e1
Compare
spencer-lunarg
approved these changes
Nov 23, 2026
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.
VkPipelineMultisampleStateCreateInfo::pSampleMask has (rasterizationSamples + 31) / 32 words, but the safe struct copies only the first one. With 64 samples the second word is lost, and the validation layers read past the copy when they compare the sample masks of pipeline libraries (VUID-VkGraphicsPipelineCreateInfo-pLibraries-06635), so that error comes and goes in the CTS pipeline_library and fast_linked_library sample_mask samples_64 cases, depending on what the heap holds.
The single-element copy comes from the fix for Vulkan-ValidationLayers#1383, when the length was read as rasterizationSamples/32, which is 0 below 32 samples. The length now comes from altlen, so this copies the whole array and adds a test with a 64-sample mask.