vk: fix push constant implementation and test (#9588)

All stages share a push constant "block". We need to order
the fragment stage bytes to after the vertex stage if they
both exists.

FIXES=453776664
This commit is contained in:
Powei Feng
2026-01-14 18:18:04 +00:00
committed by GitHub
parent 92c058a736
commit 2d943f40bb
5 changed files with 39 additions and 13 deletions
@@ -963,6 +963,10 @@ utils::io::sstream& CodeGenerator::generateSpecializationConstant(utils::io::sst
return out;
}
// Note that we've only introduced push constants to the vertex stage. If we want to add push
// constants to the fragment stage, in vulkan, we would have to offset the definition of the field
// by the size of the constant struct in the vertex stage. This is due to vulkan having essentially
// one block of memory for push constants that is shared across all stages).
utils::io::sstream& CodeGenerator::generatePushConstants(utils::io::sstream& out,
MaterialBuilder::PushConstantList const& pushConstants, size_t const layoutLocation) const {
if (UTILS_UNLIKELY(pushConstants.empty())) {