From eb23ca069fa15bb2c0527a741e49ea47c4ab2fae Mon Sep 17 00:00:00 2001 From: Jason Ekstrand Date: Mon, 16 Oct 2017 21:46:55 -0700 Subject: [PATCH] anv/entrypoints: Generate #ifdef guards from platform attributes MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Reviewed-by: Samuel Iglesias Gonsálvez --- src/intel/vulkan/anv_entrypoints_gen.py | 8 ++++++++ 1 file changed, 8 insertions(+) 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 -- 2.30.2