<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Sat, Sep 2, 2017 at 1:17 AM, Chad Versace <span dir="ltr"><<a href="mailto:chadversary@chromium.org" target="_blank">chadversary@chromium.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Android's Vulkan loader implements VK_KHR_surface and VK_KHR_swapchain,<br>
and applications cannot access the driver's implementation. Moreoever,<br>
if the driver exposes the those extension strings, then tests<br>
dEQP-VK.api.info.instance.<wbr>extensions and dEQP-VK.api.info.device fail<br>
due to the duplicated strings.<br>
---<br>
src/intel/vulkan/anv_<wbr>extensions.py | 25 +++++++++++++++++++------<br>
1 file changed, 19 insertions(+), 6 deletions(-)<br>
<br>
diff --git a/src/intel/vulkan/anv_<wbr>extensions.py b/src/intel/vulkan/anv_<wbr>extensions.py<br>
index 0df3648746e..6cd0c3692b6 100644<br>
--- a/src/intel/vulkan/anv_<wbr>extensions.py<br>
+++ b/src/intel/vulkan/anv_<wbr>extensions.py<br>
@@ -44,6 +44,11 @@ class Extension:<br>
else:<br>
self.enable = enable;<br>
<br>
+# On Android, disable all surface and swapchain extensions. Android's Vulkan<br>
+# loader implements VK_KHR_surface and VK_KHR_swapchain, and applications<br>
+# cannot access the driver's implementation. Moreoever, if the driver exposes<br>
+# the those extension strings, then tests dEQP-VK.api.info.instance.<wbr>extensions<br>
+# and dEQP-VK.api.info.device fail due to the duplicated strings.<br>
EXTENSIONS = [<br>
Extension('VK_KHR_dedicated_<wbr>allocation', 1, True),<br>
Extension('VK_KHR_descriptor_<wbr>update_template', 1, True),<br>
@@ -60,7 +65,7 @@ EXTENSIONS = [<br>
Extension('VK_KHR_external_<wbr>semaphore_fd', 1, True),<br>
Extension('VK_KHR_get_memory_<wbr>requirements2', 1, True),<br>
Extension('VK_KHR_get_<wbr>physical_device_properties2', 1, True),<br>
- Extension('VK_KHR_get_surface_<wbr>capabilities2', 1, True),<br>
+ Extension('VK_KHR_get_surface_<wbr>capabilities2', 1, '!ANDROID'),<br>
Extension('VK_KHR_incremental_<wbr>present', 1, True),<br>
Extension('VK_KHR_<wbr>maintenance1', 1, True),<br>
Extension('VK_KHR_push_<wbr>descriptor', 1, True),<br>
@@ -68,12 +73,12 @@ EXTENSIONS = [<br>
Extension('VK_KHR_sampler_<wbr>mirror_clamp_to_edge', 1, True),<br>
Extension('VK_KHR_shader_draw_<wbr>parameters', 1, True),<br>
Extension('VK_KHR_storage_<wbr>buffer_storage_class', 1, True),<br>
- Extension('VK_KHR_surface', 25, True),<br>
- Extension('VK_KHR_swapchain', 68, True),<br>
+ Extension('VK_KHR_surface', 25, '!ANDROID'),<br>
+ Extension('VK_KHR_swapchain', 68, '!ANDROID'),<br></blockquote><div><br></div><div>Another option here (goes with the stuff below) would be to predicate these on XCB || Xlib || Wayland. Same with get_surface_capabilities2 above. For that matter, if we made the XML parser a bit smarter so that it understood extension dependencies, we could just adjust VK_KHR_surface and the other two would follow... (That's far more work than I expect you to do.)<br></div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Extension('VK_KHR_variable_<wbr>pointers', 1, True),<br>
- Extension('VK_KHR_wayland_<wbr>surface', 6, 'VK_USE_PLATFORM_WAYLAND_KHR')<wbr>,<br>
- Extension('VK_KHR_xcb_surface'<wbr>, 6, 'VK_USE_PLATFORM_XCB_KHR'),<br>
- Extension('VK_KHR_xlib_<wbr>surface', 6, 'VK_USE_PLATFORM_XLIB_KHR'),<br>
+ Extension('VK_KHR_wayland_<wbr>surface', 6, 'VK_USE_PLATFORM_WAYLAND_KHR && !ANDROID'),<br>
+ Extension('VK_KHR_xcb_surface'<wbr>, 6, 'VK_USE_PLATFORM_XCB_KHR && !ANDROID'),<br>
+ Extension('VK_KHR_xlib_<wbr>surface', 6, 'VK_USE_PLATFORM_XLIB_KHR && !ANDROID'),<br></blockquote><div><br></div><div>You shouldn't be enabling XCB, Xlib or Wayland on Android builds anyway...<br></div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Extension('VK_KHX_multiview', 1, True),<br>
]<br>
<br>
@@ -162,6 +167,14 @@ _TEMPLATE = Template(COPYRIGHT + """<br>
#endif<br>
%endfor<br>
<br>
+/* And ANDROID too */<br>
+#ifdef ANDROID<br>
+# undef ANDROID<br>
+# define ANDROID true<br>
+#else<br>
+# define ANDROID false<br>
+#endif<br>
+<br>
bool<br>
anv_instance_extension_<wbr>supported(const char *name)<br>
{<br>
<span class="HOEnZb"><font color="#888888">--<br>
2.13.5<br>
<br>
______________________________<wbr>_________________<br>
mesa-dev mailing list<br>
<a href="mailto:mesa-dev@lists.freedesktop.org">mesa-dev@lists.freedesktop.org</a><br>
<a href="https://lists.freedesktop.org/mailman/listinfo/mesa-dev" rel="noreferrer" target="_blank">https://lists.freedesktop.org/<wbr>mailman/listinfo/mesa-dev</a><br>
</font></span></blockquote></div><br></div></div>