summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJason Ekstrand <[email protected]>2016-06-06 14:29:18 -0700
committerEmil Velikov <[email protected]>2016-06-07 12:30:25 +0100
commitd1a53f91ee950720b54c35b7d61f0213659533de (patch)
tree748186305001753a99f1a95d0c38cdf3b60ab8f3 /src
parent1ea233c6f30a74e6ff5456c3521328237b01eed8 (diff)
anv/entrypoints: Emit #if guards for all platforms
Reviewed-by: Emil Velikov <[email protected]>
Diffstat (limited to 'src')
-rw-r--r--src/intel/vulkan/anv_entrypoints_gen.py32
1 files changed, 22 insertions, 10 deletions
diff --git a/src/intel/vulkan/anv_entrypoints_gen.py b/src/intel/vulkan/anv_entrypoints_gen.py
index 7a473721bac..546829f7f71 100644
--- a/src/intel/vulkan/anv_entrypoints_gen.py
+++ b/src/intel/vulkan/anv_entrypoints_gen.py
@@ -51,19 +51,31 @@ def hash(name):
return h
+def get_platform_guard_macro(name):
+ if "Xlib" in name:
+ return "VK_USE_PLATFORM_XLIB_KHR"
+ elif "Xcb" in name:
+ return "VK_USE_PLATFORM_XCB_KHR"
+ elif "Wayland" in name:
+ return "VK_USE_PLATFORM_WAYLAND_KHR"
+ elif "Mir" in name:
+ return "VK_USE_PLATFORM_MIR_KHR"
+ elif "Android" in name:
+ return "VK_USE_PLATFORM_ANDROID_KHR"
+ elif "Win32" in name:
+ return "VK_USE_PLATFORM_WIN32_KHR"
+ else:
+ return None
+
def print_guard_start(name):
- if "Wayland" in name:
- print "#ifdef VK_USE_PLATFORM_WAYLAND_KHR"
- if "Xcb" in name:
- print "#ifdef VK_USE_PLATFORM_XCB_KHR"
- return
+ guard = get_platform_guard_macro(name)
+ if guard is not None:
+ print "#ifdef {0}".format(guard)
def print_guard_end(name):
- if "Wayland" in name:
- print "#endif // VK_USE_PLATFORM_WAYLAND_KHR"
- if "Xcb" in name:
- print "#endif // VK_USE_PLATFORM_XCB_KHR"
- return
+ guard = get_platform_guard_macro(name)
+ if guard is not None:
+ print "#endif // {0}".format(guard)
opt_header = False
opt_code = False