[Mesa-dev] [PATCH 2/3] i965: Port 3DSTATE_VF to genxml and simplify the implementation.

Kenneth Graunke kenneth at whitecape.org
Sat May 6 00:46:06 UTC 2017


On Friday, May 5, 2017 4:06:01 AM PDT Emil Velikov wrote:
> On 4 May 2017 at 18:51, Kenneth Graunke <kenneth at whitecape.org> wrote:
> > On Thursday, May 4, 2017 8:51:43 AM PDT Emil Velikov wrote:
> >> Hi Ken,
> >>
> >> On 4 May 2017 at 16:13, Kenneth Graunke <kenneth at whitecape.org> wrote:
> >>
> >> > +#if GEN_IS_HASWELL || GEN_GEN >= 8
> >> > +static void
> >> > +genX(upload_cut_index)(struct brw_context *brw)
> >> > +{
> >> > +   const struct gl_context *ctx = &brw->ctx;
> >> > +
> >> > +   brw_batch_emit(brw, GENX(3DSTATE_VF), vf) {
> >> > +      if (ctx->Array._PrimitiveRestart && brw->ib.ib) {
> >> > +         vf.IndexedDrawCutIndexEnable = true;
> >> Original code explicitly disables the cut index, which is no longer done here.
> >> I take it that is was not required to begin with?
> >>
> >> -Emil
> >> P.S. Pardon if my question comes a bit silly.
> >
> > No, it's a good question.  There is a change in behavior, but I think
> > it should be equivalent in the case that matters.
> >
> > In the new code, we enable cutting for indexed draws and program a
> > meaningful cut index value draws when (a) there is an index buffer
> > and (b) primitive restart is enabled.  Otherwise, both fields are
> > zero filled, meaning cutting is disabled and the cut index is 0
> > (but unused, so it doesn't matter).
> >
> Sounds like I should have read the brw_batch_emit macro more
> carefully. I missed the zero fill part.

Cool, glad it makes sense now.  The macros used to take a C99-style
initializer list, in the old days, so it was more obvious that things
would be zero-initialized.  They still are, but it's not as clear.
On the plus side, it's more flexible...

--Ken
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: This is a digitally signed message part.
URL: <https://lists.freedesktop.org/archives/mesa-dev/attachments/20170505/14096a2b/attachment.sig>


More information about the mesa-dev mailing list