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

Jason Ekstrand jason at jlekstrand.net
Wed Sep 6 20:15:39 UTC 2017


On Wed, Sep 6, 2017 at 1:09 PM, Chad Versace <chad at kiwitree.net> wrote:

> ---
>
> Jason, did you envision a cleanup like this?
>

Yes, this is better.  Eventually, I think we can make it better.

--Jason


>  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
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/mesa-dev/attachments/20170906/8b59b920/attachment.html>


More information about the mesa-dev mailing list