summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBenjamin Otte <otte@redhat.com>2023-05-10 17:55:56 +0200
committerBenjamin Otte <otte@redhat.com>2023-05-17 02:25:32 +0200
commitccacc7299080f861b3479d445b73350c72e5a1f8 (patch)
treec7985e6410193618b95c22a28387eda58865837a
parent234a7a02b318af9e27b957262b093bc63cdb1d1d (diff)
downloadgtk+-ccacc7299080f861b3479d445b73350c72e5a1f8.tar.gz
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
-rw-r--r--gsk/vulkan/gskvulkanpushconstants.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/gsk/vulkan/gskvulkanpushconstants.c b/gsk/vulkan/gskvulkanpushconstants.c
index 36ba9852a6..0bf5ca71b0 100644
--- a/gsk/vulkan/gskvulkanpushconstants.c
+++ b/gsk/vulkan/gskvulkanpushconstants.c
@@ -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,