From d6047f3c3326c7fd8a742f735648facafa9f3ca8 Mon Sep 17 00:00:00 2001 From: Erik Faye-Lund Date: Fri, 13 Dec 2024 12:25:14 +0100 Subject: [PATCH] vulkan: add vk_descriptor_type_is_dynamic helper There's a few variants of this in the tree already, let's add a reusable one that we can switch to. Reviewed-by: Alyssa Rosenzweig Reviewed-by: Lionel Landwerlin Reviewed-by: Samuel Pitoiset Reviewed-by: Boris Brezillon Part-of: --- src/vulkan/util/vk_util.h | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/vulkan/util/vk_util.h b/src/vulkan/util/vk_util.h index b7292e7dd3f..9017a639cff 100644 --- a/src/vulkan/util/vk_util.h +++ b/src/vulkan/util/vk_util.h @@ -384,6 +384,19 @@ vk_index_to_restart(VkIndexType type) } } +static inline bool +vk_descriptor_type_is_dynamic(VkDescriptorType type) +{ + switch (type) { + case VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER_DYNAMIC: + case VK_DESCRIPTOR_TYPE_STORAGE_BUFFER_DYNAMIC: + return true; + + default: + return false; + } +} + #ifdef __cplusplus } #endif