[Mesa-dev] [counter-PATCH 2/2] Vulkan/wsi: Implement VK_EXT_display_surface_counter

Keith Packard keithp at keithp.com
Wed Jun 20 00:11:16 UTC 2018


Jason Ekstrand <jason at jlekstrand.net> writes:

> Sometimes the best way to review a patch is with another patch. :-)  I'm
> not sure what you think of this approach but I didn't really relish the
> idea of having 3 get_capabilities entrypoints.  With these two patches,
> we're now down to one.  In order to implement VK_EXT_display_control, all
> you have to do is add support in wsi_display_surface_get_capabilities2 for
> the little chain-in struct and off we go.

I like this plan. Some comments below.

> +   VkSurfaceCapabilities2KHR caps2 = {
> +      .sType = VK_STRUCTURE_TYPE_SURFACE_CAPABILITIES_2_KHR,
> +      .pNext = &counters,
> +   };

I'd like to see an explicit initialization of the
supported_surface_counters field here to make it clear that a WSI layer
that doesn't look for this structure will end up using the right value (0).

> +/* This is guaranteed to not collide with anything because it's in the
> + * VK_KHR_swapchain namespace but not actually used by the extension.
> + */
> +#define VK_STRUCTURE_TYPE_WSI_SURFACE_SUPPORTED_COUNTERS_MESA \
> +   (VkStructureType)1000001005

This should probably be at the top of wsi_common.h with the other
structure type values so we don't accidentally re-use this value.

-- 
-keith
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 832 bytes
Desc: not available
URL: <https://lists.freedesktop.org/archives/mesa-dev/attachments/20180619/f86bb6fc/attachment.sig>


More information about the mesa-dev mailing list