Skip to content

Commit 1f3d772

Browse files
Align push constant size to 16 bytes
KhronosGroup/SPIRV-Reflect#292
1 parent 911d94b commit 1f3d772

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

lvk/vulkan/VulkanClasses.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4613,7 +4613,7 @@ VkPipeline lvk::VulkanContext::getVkPipeline(RenderPipelineHandle handle) {
46134613
const VkPushConstantRange range = {
46144614
.stageFlags = rps->shaderStageFlags_,
46154615
.offset = 0,
4616-
.size = pushConstantsSize,
4616+
.size = (uint32_t)getAlignedSize(pushConstantsSize, 16),
46174617
};
46184618
const VkPipelineLayoutCreateInfo ci = {
46194619
.sType = VK_STRUCTURE_TYPE_PIPELINE_LAYOUT_CREATE_INFO,
@@ -4751,7 +4751,7 @@ VkPipeline lvk::VulkanContext::getVkPipeline(RayTracingPipelineHandle handle) {
47514751
const VkDescriptorSetLayout dsls[] = {vkDSL_, vkDSL_, vkDSL_, vkDSL_};
47524752
const VkPushConstantRange range = {
47534753
.stageFlags = rtps->shaderStageFlags_,
4754-
.size = pushConstantsSize,
4754+
.size = (uint32_t)getAlignedSize(pushConstantsSize, 16),
47554755
};
47564756

47574757
const VkPipelineLayoutCreateInfo ciPipelineLayout = {
@@ -4943,7 +4943,7 @@ VkPipeline lvk::VulkanContext::getVkPipeline(ComputePipelineHandle handle) {
49434943
const VkPushConstantRange range = {
49444944
.stageFlags = VK_SHADER_STAGE_COMPUTE_BIT,
49454945
.offset = 0,
4946-
.size = sm->pushConstantsSize,
4946+
.size = (uint32_t)getAlignedSize(sm->pushConstantsSize, 16),
49474947
};
49484948
const VkPipelineLayoutCreateInfo ci = {
49494949
.sType = VK_STRUCTURE_TYPE_PIPELINE_LAYOUT_CREATE_INFO,

0 commit comments

Comments
 (0)