[Mesa-dev] [PATCH 05/11] anv: Handle patch primitives.

Jason Ekstrand jason at jlekstrand.net
Mon Jan 9 18:32:43 UTC 2017


On Mon, Jan 9, 2017 at 10:07 AM, Kenneth Graunke <kenneth at whitecape.org>
wrote:

> On Monday, January 9, 2017 8:26:34 AM PST Jason Ekstrand wrote:
> > On Sun, Jan 8, 2017 at 9:26 PM, Kenneth Graunke <kenneth at whitecape.org>
> > wrote:
> >
> > > Signed-off-by: Kenneth Graunke <kenneth at whitecape.org>
> > > ---
> > >  src/intel/vulkan/anv_pipeline.c | 9 +++++++--
> > >  1 file changed, 7 insertions(+), 2 deletions(-)
> > >
> > > diff --git a/src/intel/vulkan/anv_pipeline.c b/src/intel/vulkan/anv_
> > > pipeline.c
> > > index 17491e34fc0..b34759a5406 100644
> > > --- a/src/intel/vulkan/anv_pipeline.c
> > > +++ b/src/intel/vulkan/anv_pipeline.c
> > > @@ -212,7 +212,6 @@ static const uint32_t vk_to_gen_primitive_type[] =
> {
> > >     [VK_PRIMITIVE_TOPOLOGY_LINE_STRIP_WITH_ADJACENCY]     =
> > > _3DPRIM_LINESTRIP_ADJ,
> > >     [VK_PRIMITIVE_TOPOLOGY_TRIANGLE_LIST_WITH_ADJACENCY]  =
> > > _3DPRIM_TRILIST_ADJ,
> > >     [VK_PRIMITIVE_TOPOLOGY_TRIANGLE_STRIP_WITH_ADJACENCY] =
> > > _3DPRIM_TRISTRIP_ADJ,
> > > -/*   [VK_PRIMITIVE_TOPOLOGY_PATCH_LIST]                =
> > > _3DPRIM_PATCHLIST_1 */
> > >  };
> > >
> > >  static void
> > > @@ -1086,8 +1085,14 @@ anv_pipeline_init(struct anv_pipeline *pipeline,
> > >
> > >     const VkPipelineInputAssemblyStateCreateInfo *ia_info =
> > >        pCreateInfo->pInputAssemblyState;
> > > +   const VkPipelineTessellationStateCreateInfo *tess_info =
> > > +      pCreateInfo->pTessellationState;
> > >     pipeline->primitive_restart = ia_info->primitiveRestartEnable;
> > > -   pipeline->topology = vk_to_gen_primitive_type[ia_info->topology];
> > > +
> > > +   if (tess_info)
> > > +      pipeline->topology = _3DPRIM_PATCHLIST(tess_info->
> > > patchControlPoints);
> > >
> >
> > I don't think this is what you want.  I think you want to key it off of
> > whether or not you have a tessellation shader (there's a has_stage helper
> > for this).  They can provide a pTessellationState without a tessellation
> > shader.
>
> Hmm.  I read:
>
> "pTessellationState is a pointer to an instance of the
>  VkPipelineTessellationStateCreateInfo structure, or NULL if the pipeline
>  does not include a tessellation control shader stage and tessellation
>  evaluation shader stage."
>
> and I suppose I interpreted it as "it'll be NULL unless there's both a
> TCS and TES".  It'd certainly be weird to pass one.
>

The valid usage section says that it has to be non-NULL if there are tess
stages but it says nothing about if they aren't.  So, even if the spec
seems to imply you have to pass NULL if you don't have tess, it's probably
not being validated.
--Jason
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/mesa-dev/attachments/20170109/3d9d2253/attachment.html>


More information about the mesa-dev mailing list