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

Kenneth Graunke kenneth at whitecape.org
Thu May 4 17:51:05 UTC 2017


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).

In the old code, we enabled cutting for indexed draws when primitive
restart was enabled...but even if there was no index buffer.  With no
index buffer, indexed draws aren't happening, so no cutting should be
happening anyway.  We also used to set the cut index value
unconditionally - but if cutting isn't enabled, the value shouldn't
be used.

Does that make sense?
-------------- 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/20170504/e48ce88f/attachment.sig>


More information about the mesa-dev mailing list