[Mesa-dev] [PATCH 3/3] anv: Implement VK_EXT_vertex_attribute_divisor

Jason Ekstrand jason at jlekstrand.net
Mon Jul 2 22:41:11 UTC 2018


On Mon, Jul 2, 2018 at 3:26 PM, Caio Marcelo de Oliveira Filho <
caio.oliveira at intel.com> wrote:

> > > @@ -1430,6 +1431,18 @@ anv_pipeline_init(struct anv_pipeline *pipeline,
> > >           anv_subpass_view_count(pipeline->subpass);
> > >     }
> > >
> > > +   const VkPipelineVertexInputDivisorStateCreateInfoEXT
> *vi_div_state =
> > > +      vk_find_struct_const(pCreateInfo->pNext,
> > > +                           PIPELINE_VERTEX_INPUT_DIVISOR_
> STATE_CREATE_INFO_EXT);
> > > +   if (vi_div_state) {
> > > +      for (uint32_t i = 0; i < vi_div_state->vertexBindingDivisorCount;
> i++) {
> > > +         const VkVertexInputBindingDivisorDescriptionEXT *desc =
> > > +            &vi_div_state->pVertexBindingDivisors[i];
> > > +
> > > +         pipeline->vb[desc->binding].instance_divisor *=
> desc->divisor;
> > > +      }
> > > +   }
> >
> > I don't think the spec restricts the divisor descriptions to be unique
> > (i.e. only one description per binding), so to be slightly more robust
> > maybe do
> >
> >     pipeline->vb[desc->binding].instance_divisor *=
> anv_subpass_view_count(pipeline->subpass) * desc->divisor;
>
> I meant:
>
>     pipeline->vb[desc->binding].instance_divisor = anv_subpass_view_count(pipeline->subpass)
> * desc->divisor;
>

Ugh... You may be right.  That's a bit insane...

How about this version?
https://gitlab.freedesktop.org/jekstrand/mesa/commits/wip/VK_EXT_vertex_attribute_divisor

I've changed it to first grab the vertex divisors from the struct and then
the multiview handling is a *=.  This moves it to more of a "set a bunch of
stuff then compile" model.

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


More information about the mesa-dev mailing list