[Mesa-dev] [PATCH] fixup! anv/android: Disable surface and swapchain extensions

Chad Versace chad at kiwitree.net
Wed Sep 6 20:09:21 UTC 2017


---

Jason, did you envision a cleanup like this?

 src/intel/vulkan/anv_extensions.py | 18 +++++++++++-------
 1 file changed, 11 insertions(+), 7 deletions(-)

diff --git a/src/intel/vulkan/anv_extensions.py b/src/intel/vulkan/anv_extensions.py
index 18062359d31..747b36b71f5 100644
--- a/src/intel/vulkan/anv_extensions.py
+++ b/src/intel/vulkan/anv_extensions.py
@@ -44,7 +44,7 @@ class Extension:
         else:
             self.enable = enable;
 
-# On Android, disable all surface and swapchain extensions. Android's Vulkan
+# On Android, we disable all surface and swapchain extensions. Android's Vulkan
 # loader implements VK_KHR_surface and VK_KHR_swapchain, and applications
 # cannot access the driver's implementation. Moreoever, if the driver exposes
 # the those extension strings, then tests dEQP-VK.api.info.instance.extensions
@@ -66,7 +66,7 @@ EXTENSIONS = [
     Extension('VK_KHR_external_semaphore_fd',             1, True),
     Extension('VK_KHR_get_memory_requirements2',          1, True),
     Extension('VK_KHR_get_physical_device_properties2',   1, True),
-    Extension('VK_KHR_get_surface_capabilities2',         1, '!ANDROID'),
+    Extension('VK_KHR_get_surface_capabilities2',         1, 'ANV_HAS_SURFACE'),
     Extension('VK_KHR_incremental_present',               1, True),
     Extension('VK_KHR_maintenance1',                      1, True),
     Extension('VK_KHR_push_descriptor',                   1, True),
@@ -74,12 +74,12 @@ EXTENSIONS = [
     Extension('VK_KHR_sampler_mirror_clamp_to_edge',      1, True),
     Extension('VK_KHR_shader_draw_parameters',            1, True),
     Extension('VK_KHR_storage_buffer_storage_class',      1, True),
-    Extension('VK_KHR_surface',                          25, '!ANDROID'),
-    Extension('VK_KHR_swapchain',                        68, '!ANDROID'),
+    Extension('VK_KHR_surface',                          25, 'ANV_HAS_SURFACE'),
+    Extension('VK_KHR_swapchain',                        68, 'ANV_HAS_SURFACE'),
     Extension('VK_KHR_variable_pointers',                 1, True),
-    Extension('VK_KHR_wayland_surface',                   6, 'VK_USE_PLATFORM_WAYLAND_KHR && !ANDROID'),
-    Extension('VK_KHR_xcb_surface',                       6, 'VK_USE_PLATFORM_XCB_KHR && !ANDROID'),
-    Extension('VK_KHR_xlib_surface',                      6, 'VK_USE_PLATFORM_XLIB_KHR && !ANDROID'),
+    Extension('VK_KHR_wayland_surface',                   6, 'VK_USE_PLATFORM_WAYLAND_KHR'),
+    Extension('VK_KHR_xcb_surface',                       6, 'VK_USE_PLATFORM_XCB_KHR'),
+    Extension('VK_KHR_xlib_surface',                      6, 'VK_USE_PLATFORM_XLIB_KHR'),
     Extension('VK_KHX_multiview',                         1, True),
 ]
 
@@ -176,6 +176,10 @@ _TEMPLATE = Template(COPYRIGHT + """
 #   define ANDROID false
 #endif
 
+#define ANV_HAS_SURFACE (VK_USE_PLATFORM_WAYLAND_KHR || \\
+                         VK_USE_PLATFORM_XCB_KHR || \\
+                         VK_USE_PLATFORM_XLIB_KHR)
+
 bool
 anv_instance_extension_supported(const char *name)
 {
-- 
2.13.5



More information about the mesa-dev mailing list