On Thursday, May 4, 2017 8:51:43 AM PDT Emil Velikov wrote:
> Hi Ken,
> 
> On 4 May 2017 at 16:13, Kenneth Graunke <kenn...@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?

Attachment: signature.asc
Description: This is a digitally signed message part.

_______________________________________________
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev

Reply via email to