From ef8fd44b5f6f3fd5e8f2893e03416d2ec280ff55 Mon Sep 17 00:00:00 2001 From: Mary Guillemard Date: Thu, 12 Feb 2026 17:01:43 +0100 Subject: [PATCH] nvk: Validate push constant offset in nvk_root_descriptor_table We requires this to be aligned to a 8 byte granuality. This is something that came up with mesh shader enablement so let's avoid this footgun with some assertion. Signed-off-by: Mary Guillemard Reviewed-by: Mel Henning Part-of: --- src/nouveau/vulkan/nvk_cmd_buffer.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/nouveau/vulkan/nvk_cmd_buffer.h b/src/nouveau/vulkan/nvk_cmd_buffer.h index ad1cb306077..a243b404416 100644 --- a/src/nouveau/vulkan/nvk_cmd_buffer.h +++ b/src/nouveau/vulkan/nvk_cmd_buffer.h @@ -70,6 +70,10 @@ struct nvk_root_descriptor_table { #define nvk_root_descriptor_offset(member)\ offsetof(struct nvk_root_descriptor_table, member) +/* Push constants should be aligned properly */ +static_assert(nvk_root_descriptor_offset(push) % 8 == 0, + "Push constants should be aligned properly"); + enum ENUM_PACKED nvk_descriptor_set_type { NVK_DESCRIPTOR_SET_TYPE_NONE, NVK_DESCRIPTOR_SET_TYPE_SET,