anv: use the platform defines in vk.xml instead of hard-coding them

Signed-off-by: Eric Engestrom <eric.engestrom@intel.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
This commit is contained in:
Eric Engestrom 2019-02-27 12:20:31 +00:00 committed by Eric Engestrom
parent e21c201c96
commit 3d4238d26c
1 changed files with 7 additions and 4 deletions

View File

@ -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']