-
Notifications
You must be signed in to change notification settings - Fork 1.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
vulkan: fix subpass validation #6980
Conversation
- Before, we supposed that the maximum number of input attachment should match the maximum number of color attachments. But in reality, we've only used one input attachment for the second subpass. - The problem with the above supposition is that the descriptor set layout for the input attachment descriptor set must have the exact number of input attachment specified in the shader. If the *layout* has more input attachment slots than specified in the shader, then we'd run into a validation error. - In this patch, we fix the number of max input attachment in the descriptor set layout to 1, since we ever only make use of one. Fixes #6513
// We assume only one possible input attachment between two subpasses. See also the subpasses | ||
// definition in VulkanFboCache. | ||
static constexpr uint32_t INPUT_ATTACHMENT_COUNT = 1; | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what would need to change so that we break that assumption? I suppose the material knows how many inputs it has, so that should be passed to the renderpass or something like that?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In the really general case, we'd need to know how many subpasses, and the attachment -> input mapping between consecutive subpasses at the start of the renderpass.
right now we assume we have at most one additional subpass, and the sole input attachment to the second subpass is always the first color attachment.
- Before, we supposed that the maximum number of input attachment should match the maximum number of color attachments. But in reality, we've only used one input attachment for the second subpass. - The problem with the above supposition is that the descriptor set layout for the input attachment descriptor set must have the exact number of input attachment specified in the shader. If the *layout* has more input attachment slots than specified in the shader, then we'd run into a validation error. - In this patch, we fix the number of max input attachment in the descriptor set layout to 1, since we ever only make use of one. Fixes google#6513
Fixes #6513