On Friday, May 5, 2017 4:06:01 AM PDT Emil Velikov wrote: > On 4 May 2017 at 18:51, Kenneth Graunke <[email protected]> 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 <[email protected]> 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
signature.asc
Description: This is a digitally signed message part.
_______________________________________________ mesa-dev mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/mesa-dev
