vulkan: put TEMPLATE_H before TEMPLATE_C

Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22333>
This commit is contained in:
Constantine Shablya 2023-04-07 04:02:06 +03:00 committed by Marge Bot
parent 005cfc63fc
commit 9cf1cdfaa8

View file

@ -125,6 +125,36 @@ class FeatureStruct:
s_type: str
features: typing.List[str]
TEMPLATE_H = Template(COPYRIGHT + """
/* This file generated from ${filename}, don't edit directly. */
#ifndef VK_FEATURES_H
#define VK_FEATURES_H
#ifdef __cplusplus
extern "C" {
#endif
struct vk_features {
% for flag in all_flags:
bool ${flag};
% endfor
};
void
vk_set_physical_device_features(struct vk_features *all_features,
const VkPhysicalDeviceFeatures2 *pFeatures);
void
vk_set_physical_device_features_1_0(struct vk_features *all_features,
const VkPhysicalDeviceFeatures *pFeatures);
#ifdef __cplusplus
}
#endif
#endif
""", output_encoding='utf-8')
TEMPLATE_C = Template(COPYRIGHT + """
/* This file generated from ${filename}, don't edit directly. */
@ -304,36 +334,6 @@ vk_set_physical_device_features_1_0(struct vk_features *all_features,
}
""", output_encoding='utf-8')
TEMPLATE_H = Template(COPYRIGHT + """
/* This file generated from ${filename}, don't edit directly. */
#ifndef VK_FEATURES_H
#define VK_FEATURES_H
#ifdef __cplusplus
extern "C" {
#endif
struct vk_features {
% for flag in all_flags:
bool ${flag};
% endfor
};
void
vk_set_physical_device_features(struct vk_features *all_features,
const VkPhysicalDeviceFeatures2 *pFeatures);
void
vk_set_physical_device_features_1_0(struct vk_features *all_features,
const VkPhysicalDeviceFeatures *pFeatures);
#ifdef __cplusplus
}
#endif
#endif
""", output_encoding='utf-8')
def get_pdev_features(doc):
_type = doc.find(".types/type[@name='VkPhysicalDeviceFeatures']")
if _type is not None: