vulkan: Add common features2_to_features
authorAlyssa Rosenzweig <alyssa@collabora.com>
Thu, 30 Mar 2023 15:48:56 +0000 (11:48 -0400)
committerAlyssa Rosenzweig <alyssa@collabora.com>
Fri, 7 Apr 2023 22:16:27 +0000 (18:16 -0400)
Needed to correctly implement GetPhysicalDeviceFormatProperties2.

Cc stable so the turnip patch can get backported cleanly.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Cc: mesa-stable
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22217>

src/vulkan/util/gen_enum_to_str.py

index f633f97..fabba6f 100644 (file)
@@ -243,6 +243,12 @@ H_DEFINE_TEMPLATE = Template(textwrap.dedent(u"""\
       % endif
     % endfor
 
+    static inline VkFormatFeatureFlags
+    vk_format_features2_to_features(VkFormatFeatureFlags2 features2)
+    {
+       return features2 & VK_ALL_FORMAT_FEATURE_FLAG_BITS;
+    }
+
     #ifdef __cplusplus
     } /* extern "C" */
     #endif