mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-09 06:48:06 +02:00
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 <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:
parent
37d73fa4f3
commit
ef8fd44b5f
1 changed files with 4 additions and 0 deletions
|
|
@ -70,6 +70,10 @@ struct nvk_root_descriptor_table {
|
||||||
#define nvk_root_descriptor_offset(member)\
|
#define nvk_root_descriptor_offset(member)\
|
||||||
offsetof(struct nvk_root_descriptor_table, 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 {
|
enum ENUM_PACKED nvk_descriptor_set_type {
|
||||||
NVK_DESCRIPTOR_SET_TYPE_NONE,
|
NVK_DESCRIPTOR_SET_TYPE_NONE,
|
||||||
NVK_DESCRIPTOR_SET_TYPE_SET,
|
NVK_DESCRIPTOR_SET_TYPE_SET,
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue