nvk: Validate push constant offset in nvk_root_descriptor_table
Some checks are pending
macOS-CI / macOS-CI (dri) (push) Waiting to run
macOS-CI / macOS-CI (xlib) (push) Waiting to run

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 <mary@mary.zone>
Reviewed-by: Mel Henning <mhenning@darkrefraction.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40407>
This commit is contained in:
Mary Guillemard 2026-02-12 17:01:43 +01:00 committed by Marge Bot
parent 37d73fa4f3
commit ef8fd44b5f

View file

@ -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,