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

Caio Marcelo de Oliveira Filho caio.oliveira at intel.com
Mon Jul 2 22:26:57 UTC 2018


> > @@ -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;



More information about the mesa-dev mailing list