On Wed 08 Mar 2017, Chad Versace wrote: > On Mon 06 Mar 2017, Jason Ekstrand wrote: > > On Mon, Mar 6, 2017 at 10:25 AM, Chad Versace <chadvers...@chromium.org> > > wrote: > > > > > anv_outarray is a wrapper for a Vulkan output array. A Vulkan output > > > array is one that follows the convention of the parameters to > > > vkGetPhysicalDeviceQueueFamilyProperties(). > > > > > > In the upcoming dma_buf extensions, anv_outarray will simplify the code > > > for querying the DRM format modifiers. > > > --- > > > src/intel/vulkan/anv_private.h | 140 ++++++++++++++++++++++++++++++ > > > +++++++++++ > > > 1 file changed, 140 insertions(+)
> > > +static inline bool > > > +__anv_outarray_is_incomplete(const struct __anv_outarray *a) > > > +{ > > > + return *a->filled_len < a->wanted_len; > > > > > > > We could implement this as > > > > return a->data && *a->filled_len < a->cap No. VK_INCOMPLETE means "overflow", not "underflow". Comparint to capacity can't tell you about overflow. With that realization, I kept the filled_len and wanted_len fields unchanged in v2. > > Or, better yet, we could add a "VkResult status" to the outarray struct and > > set that VK_INCOMPLETE in __anv_outarray_next. Then the status check is > > just "return out.status". How does that sound? > > When I rewrite the patch to remove 'wanted_len', I'll play around with > that, and see what results in the cleanest code. > > > > > Also, this looks like a really good candidate for common Vulkan code. > > Agreed. I'll resend this as a patch to vk_util.h. > > > Thanks for doing this by the way! I've been wanting someone to figure out > > how to make output arrays less painful and this seems like a very good way. > > Thanks :) _______________________________________________ mesa-dev mailing list mesa-dev@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/mesa-dev