vulkan: Add a static assert

We don't want to make the push constants larger than what the spec
guarantees. And that is 128 bytes, see value for
maxPushConstantsSize in table 55 of
https://registry.khronos.org/vulkan/specs/1.3-extensions/html/vkspec.html#limits-minmax
This commit is contained in:
Benjamin Otte 2023-05-10 17:55:56 +02:00
parent 186e056c56
commit c479f93372

View File

@ -15,6 +15,12 @@ struct _GskVulkanPushConstantsWire
} common;
};
/* This is the value we know every conformant GPU must provide.
* See value for maxPushConstantsSize in table 55 of
* https://registry.khronos.org/vulkan/specs/1.3-extensions/html/vkspec.html#limits-minmax
*/
G_STATIC_ASSERT (sizeof (GskVulkanPushConstantsWire) <= 128);
void
gsk_vulkan_push_constants_init (GskVulkanPushConstants *constants,
const graphene_matrix_t *mvp,