vulkan/physical_device_features: Stop generating a header
It only has one entrypoint and nothing in it is based on code-gen. We can put that one entrypoint in vk_physical_device.h instead. Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com> Reviewed-by: Tapani Pälli <tapani.palli@intel.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13150>
This commit is contained in:

committed by
Marge Bot

parent
ec9619a83e
commit
2f55aace9c
@@ -143,10 +143,10 @@ vk_cmd_queue = custom_target(
|
|||||||
vk_physical_device_features = custom_target(
|
vk_physical_device_features = custom_target(
|
||||||
'vk_physical_device_features',
|
'vk_physical_device_features',
|
||||||
input : ['vk_physical_device_features.py', vk_api_xml],
|
input : ['vk_physical_device_features.py', vk_api_xml],
|
||||||
output : ['vk_physical_device_features.c', 'vk_physical_device_features.h'],
|
output : ['vk_physical_device_features.c'],
|
||||||
command : [
|
command : [
|
||||||
prog_python, '@INPUT0@', '--xml', '@INPUT1@',
|
prog_python, '@INPUT0@', '--xml', '@INPUT1@',
|
||||||
'--out-c', '@OUTPUT0@', '--out-h', '@OUTPUT1@'
|
'--out-c', '@OUTPUT0@'
|
||||||
],
|
],
|
||||||
depend_files : vk_physical_device_features_gen_depend_files,
|
depend_files : vk_physical_device_features_gen_depend_files,
|
||||||
)
|
)
|
||||||
|
@@ -26,7 +26,6 @@
|
|||||||
#include "vk_common_entrypoints.h"
|
#include "vk_common_entrypoints.h"
|
||||||
#include "vk_instance.h"
|
#include "vk_instance.h"
|
||||||
#include "vk_physical_device.h"
|
#include "vk_physical_device.h"
|
||||||
#include "vk_physical_device_features.h"
|
|
||||||
#include "vk_queue.h"
|
#include "vk_queue.h"
|
||||||
#include "vk_util.h"
|
#include "vk_util.h"
|
||||||
#include "util/hash_table.h"
|
#include "util/hash_table.h"
|
||||||
|
@@ -52,6 +52,10 @@ vk_physical_device_init(struct vk_physical_device *physical_device,
|
|||||||
void
|
void
|
||||||
vk_physical_device_finish(struct vk_physical_device *physical_device);
|
vk_physical_device_finish(struct vk_physical_device *physical_device);
|
||||||
|
|
||||||
|
VkResult
|
||||||
|
vk_physical_device_check_device_features(struct vk_physical_device *physical_device,
|
||||||
|
const VkDeviceCreateInfo *pCreateInfo);
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
@@ -30,37 +30,9 @@ import xml.etree.ElementTree as et
|
|||||||
|
|
||||||
from mako.template import Template
|
from mako.template import Template
|
||||||
|
|
||||||
TEMPLATE_H = Template(COPYRIGHT + """\
|
|
||||||
/* This file generated from ${filename}, don't edit directly. */
|
|
||||||
|
|
||||||
#pragma once
|
|
||||||
|
|
||||||
#define VK_PROTOTYPES
|
|
||||||
#include <vulkan/vulkan.h>
|
|
||||||
#include "vk_physical_device.h"
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
|
||||||
extern "C" {
|
|
||||||
#endif
|
|
||||||
|
|
||||||
VkResult
|
|
||||||
vk_physical_device_check_device_features(struct vk_physical_device *physical_device,
|
|
||||||
const VkDeviceCreateInfo *pCreateInfo);
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
""", output_encoding='utf-8')
|
|
||||||
|
|
||||||
TEMPLATE_C = Template(COPYRIGHT + """
|
TEMPLATE_C = Template(COPYRIGHT + """
|
||||||
/* This file generated from ${filename}, don't edit directly. */
|
/* This file generated from ${filename}, don't edit directly. */
|
||||||
|
|
||||||
#include "${header}"
|
|
||||||
|
|
||||||
#define VK_PROTOTYPES
|
|
||||||
#include <vulkan/vulkan.h>
|
|
||||||
|
|
||||||
#include "vk_dispatch_table.h"
|
|
||||||
#include "vk_physical_device.h"
|
#include "vk_physical_device.h"
|
||||||
#include "vk_util.h"
|
#include "vk_util.h"
|
||||||
|
|
||||||
@@ -222,7 +194,6 @@ def get_features_from_xml(xml_files):
|
|||||||
def main():
|
def main():
|
||||||
parser = argparse.ArgumentParser()
|
parser = argparse.ArgumentParser()
|
||||||
parser.add_argument('--out-c', required=True, help='Output C file.')
|
parser.add_argument('--out-c', required=True, help='Output C file.')
|
||||||
parser.add_argument('--out-h', required=True, help='Output H file.')
|
|
||||||
parser.add_argument('--xml',
|
parser.add_argument('--xml',
|
||||||
help='Vulkan API XML file.',
|
help='Vulkan API XML file.',
|
||||||
required=True, action='append', dest='xml_files')
|
required=True, action='append', dest='xml_files')
|
||||||
@@ -230,18 +201,12 @@ def main():
|
|||||||
|
|
||||||
features = get_features_from_xml(args.xml_files)
|
features = get_features_from_xml(args.xml_files)
|
||||||
|
|
||||||
assert os.path.dirname(args.out_c) == os.path.dirname(args.out_h)
|
|
||||||
|
|
||||||
environment = {
|
environment = {
|
||||||
'header': os.path.basename(args.out_h),
|
|
||||||
'filename': os.path.basename(__file__),
|
'filename': os.path.basename(__file__),
|
||||||
'features': features,
|
'features': features,
|
||||||
}
|
}
|
||||||
|
|
||||||
try:
|
try:
|
||||||
with open(args.out_h, 'wb') as f:
|
|
||||||
guard = os.path.basename(args.out_h).replace('.', '_').upper()
|
|
||||||
f.write(TEMPLATE_H.render(guard=guard, **environment))
|
|
||||||
with open(args.out_c, 'wb') as f:
|
with open(args.out_c, 'wb') as f:
|
||||||
f.write(TEMPLATE_C.render(**environment))
|
f.write(TEMPLATE_C.render(**environment))
|
||||||
except Exception:
|
except Exception:
|
||||||
|
Reference in New Issue
Block a user