render/vulkan: fix VkPushConstantRange for wlr_vk_frag_texture_pcr_data

We pass an alpha multiplier plus a luminance multiplier now.

Fixes the following validation layer error:

    vkCmdPushConstants(): is called with
    stageFlags (VK_SHADER_STAGE_FRAGMENT_BIT), offset (80), size (72)
    but the VkPipelineLayout 0x510000000051 doesn't have a VkPushConstantRange with VK_SHADER_STAGE_FRAGMENT_BIT.
    The Vulkan spec states: For each byte in the range specified by offset and size and for each shader stage in stageFlags, there must be a push constant range in layout that includes that byte and that stage (https://docs.vulkan.org/spec/latest/chapters/descriptorsets.html#VUID-vkCmdPushConstants-offset-01795) (VUID-vkCmdPushConstants-offset-01795)

Fixes: 56d95c2ecb ("render/vulkan: introduce wlr_vk_frag_texture_pcr_data")
This commit is contained in:
Simon Ser 2025-08-16 11:44:24 +02:00 committed by Simon Zeni
parent bbd9a49bdf
commit 1a18e47efa

View file

@ -1473,7 +1473,7 @@ static bool init_tex_layouts(struct wlr_vk_renderer *renderer,
},
{
.offset = pc_ranges[0].size,
.size = sizeof(float) * 4, // alpha or color
.size = sizeof(struct wlr_vk_frag_texture_pcr_data),
.stageFlags = VK_SHADER_STAGE_FRAGMENT_BIT,
},
};