From: Jason Ekstrand Date: Tue, 17 Oct 2017 04:46:55 +0000 (-0700) Subject: anv/entrypoints: Generate #ifdef guards from platform attributes X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=eb23ca069fa15bb2c0527a741e49ea47c4ab2fae;p=mesa.git anv/entrypoints: Generate #ifdef guards from platform attributes Reviewed-by: Samuel Iglesias Gonsálvez --- diff --git a/src/intel/vulkan/anv_entrypoints_gen.py b/src/intel/vulkan/anv_entrypoints_gen.py index fbbbf896a6c..55ebd169064 100644 --- a/src/intel/vulkan/anv_entrypoints_gen.py +++ b/src/intel/vulkan/anv_entrypoints_gen.py @@ -512,6 +512,14 @@ def get_entrypoints_defines(doc): fullname = entrypoint.attrib['name'] entrypoints_to_defines[fullname] = define + for extension in doc.findall('./extensions/extension[@platform]'): + platform = extension.attrib['platform'] + define = 'VK_USE_PLATFORM_' + platform.upper() + '_KHR' + + for entrypoint in extension.findall('./require/command'): + fullname = entrypoint.attrib['name'] + entrypoints_to_defines[fullname] = define + return entrypoints_to_defines