From 3d4238d26c5de4a0f7a5c225c77fd29db29672ee Mon Sep 17 00:00:00 2001 From: Eric Engestrom Date: Wed, 27 Feb 2019 12:20:31 +0000 Subject: anv: use the platform defines in vk.xml instead of hard-coding them Signed-off-by: Eric Engestrom Reviewed-by: Jason Ekstrand --- src/intel/vulkan/anv_entrypoints_gen.py | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/intel/vulkan/anv_entrypoints_gen.py b/src/intel/vulkan/anv_entrypoints_gen.py index 8e815b102ea..4dfde4513f0 100644 --- a/src/intel/vulkan/anv_entrypoints_gen.py +++ b/src/intel/vulkan/anv_entrypoints_gen.py @@ -582,12 +582,15 @@ def get_entrypoints_defines(doc): """Maps entry points to extension defines.""" entrypoints_to_defines = {} + platform_define = {} + for platform in doc.findall('./platforms/platform'): + name = platform.attrib['name'] + define = platform.attrib['protect'] + platform_define[name] = define + for extension in doc.findall('./extensions/extension[@platform]'): platform = extension.attrib['platform'] - ext = '_KHR' - if platform.upper() == 'XLIB_XRANDR': - ext = '_EXT' - define = 'VK_USE_PLATFORM_' + platform.upper() + ext + define = platform_define[platform] for entrypoint in extension.findall('./require/command'): fullname = entrypoint.attrib['name'] -- cgit v1.2.3