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

Jason Ekstrand jason at jlekstrand.net
Wed Jun 20 00:44:59 UTC 2018


On Tue, Jun 19, 2018 at 5:11 PM, Keith Packard <keithp at keithp.com> wrote:

> 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).
>

C99 guarantees that, one one field is initialized with a designated
initializer then all fields not explicitly initialized get
zero-initialized.  I can add it if you'd like none the less.


> > +/* 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.
>

Sure.

--Jason
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/mesa-dev/attachments/20180619/9600e2a4/attachment.html>


More information about the mesa-dev mailing list