[Mesa-dev] [PATCH 2/2] i965: Make a helper for emitting 3DSTATE_CONSTANT_XS packets.

Kenneth Graunke kenneth at whitecape.org
Thu Feb 16 06:10:40 UTC 2017


On Wednesday, February 15, 2017 3:23:14 PM PST Jordan Justen wrote:
> On 2017-02-14 13:45:49, Kenneth Graunke wrote:
[snip]
> > diff --git a/src/mesa/drivers/dri/i965/gen6_constant_state.c b/src/mesa/drivers/dri/i965/gen6_constant_state.c
> > index 6c0c32b26f7..7e6fa92ecf2 100644
> > --- a/src/mesa/drivers/dri/i965/gen6_constant_state.c
> > +++ b/src/mesa/drivers/dri/i965/gen6_constant_state.c
> > @@ -27,6 +27,97 @@
> >  #include "intel_batchbuffer.h"
> >  #include "program/prog_parameter.h"
> >  
> > +#define F(RELOC, BATCH, buf, x) \
> > +   if (buf) { \
> > +      RELOC(buf, I915_GEM_DOMAIN_RENDER, 0, x); \
> > +   } else { \
> > +      BATCH(x); \
> > +   }
> > +#define OUT_PTR64(buf, x) F(OUT_RELOC64, OUT_BATCH64, buf, x)
> > +#define OUT_PTR(buf, x)   F(OUT_RELOC,   OUT_BATCH,   buf, x)
> 
> Is there a better name than 'x'? Unfortunately, I couldn't think of a
> suggestion. :)

Probably...but I couldn't think of one.  It's some bits that get OR'd
in...and can be pretty arbitrary.  OUT_RELOC calls it "delta", but I'm
not sure that historical name makes much sense these days.  OUT_BATCH
uses "d" which is arguably not better.

[snip]

> I didn't see where the 'mocs' value usage moved to in the new code.
> 
> -Jordan

Good point.  It's zero on Gen6 and Gen8, but I accidentally dropped
GEN7_MOCS_L3 on Gen7-7.5.  I'll fix that and send a v2.

Thanks for reading carefully!
-------------- 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/20170215/abea76ed/attachment.sig>


More information about the mesa-dev mailing list