vulkan: Add a common entrypoint table generator
This is based on the one in ANV but it's a bit different because it uses vk_entrypoint_table instead of vk_dispatch_table. This is because, without knowing what extensions are implemented by a driver, we have to generate a table with everything and sort it all out later. We use the same trick as ANV with weak function declarations to provide NULL values for any entrypoints NOT implemented by the driver. Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com> Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8676>
This commit is contained in:

committed by
Marge Bot

parent
66cdc0c0db
commit
9be7aa3fc8
@@ -806,21 +806,10 @@ def get_entrypoints_defines(doc):
|
||||
|
||||
return entrypoints_to_defines
|
||||
|
||||
|
||||
def main():
|
||||
parser = argparse.ArgumentParser()
|
||||
parser.add_argument('--out-c', help='Output C file.')
|
||||
parser.add_argument('--out-h', help='Output H file.')
|
||||
parser.add_argument('--xml',
|
||||
help='Vulkan API XML file.',
|
||||
required=True,
|
||||
action='append',
|
||||
dest='xml_files')
|
||||
args = parser.parse_args()
|
||||
|
||||
def get_entrypoints_from_xml(xml_files):
|
||||
entrypoints = []
|
||||
|
||||
for filename in args.xml_files:
|
||||
for filename in xml_files:
|
||||
doc = et.parse(filename)
|
||||
entrypoints += get_entrypoints(doc, get_entrypoints_defines(doc))
|
||||
|
||||
@@ -836,6 +825,21 @@ def main():
|
||||
EntrypointParam('VkImage', 'pImage', 'VkImage* pImage')
|
||||
]))
|
||||
|
||||
return entrypoints
|
||||
|
||||
def main():
|
||||
parser = argparse.ArgumentParser()
|
||||
parser.add_argument('--out-c', help='Output C file.')
|
||||
parser.add_argument('--out-h', help='Output H file.')
|
||||
parser.add_argument('--xml',
|
||||
help='Vulkan API XML file.',
|
||||
required=True,
|
||||
action='append',
|
||||
dest='xml_files')
|
||||
args = parser.parse_args()
|
||||
|
||||
entrypoints = get_entrypoints_from_xml(args.xml_files)
|
||||
|
||||
device_entrypoints = []
|
||||
physical_device_entrypoints = []
|
||||
instance_entrypoints = []
|
||||
|
Reference in New Issue
Block a user