[Mesa-dev] [PATCH 1/3] i965: Drop "Vector Mask Enable" bit from 3DSTATE_GS on Gen8+.

Kenneth Graunke kenneth at whitecape.org
Sat May 30 11:27:48 PDT 2015

On Friday, May 29, 2015 03:04:30 PM Ben Widawsky wrote:
> On Fri, May 29, 2015 at 12:26:38PM -0700, Kenneth Graunke wrote:
> > The documentation makes it pretty clear that we shouldn't use this:
> > 
> >    "Under normal conditions SW shall specify DMask, as the GS stage
> >     will provide a Dispatch Mask appropriate to SIMD4x2 or SIMD8 thread
> >     execution (as a function of dispatch mode).  E.g., for SIMD4x2
> >     execution, the GS stage will generate a Dispatch Mask that is equal
> >     to what the EU would use as the Vector Mask.  For SIMD8 execution
> >     there is no known usage model for use of Vector Mask (as there is
> >     for PS shaders)."
> > 
> > I also managed to find descriptions of DMask and VMask, in the "State
> > Register" (sr0.2/3) field descriptions:
> > 
> >    "Dispatch Mask (DMask).  This 32-bit field specifies which channels
> >     are active at Dispatch time."
> > 
> >    "Vector Mask (VMask).  This 32-bit field contains, for each 4-bit
> >     group, the OR of the corresponding 4-bit group in the dispatch
> >     mask."
> > 
> > SIMD4x2 shaders process one or two vec4 values, with each 4-bit group
> > corresponding to xyzw channel enables (either all on, or all off).
> > Thus, DMask = VMask in SIMD4x2 mode.  But in SIMD8 mode, 4-bit groups
> > are meaningless, so it just messes up your values.
> Just making sure you're reading this the same way I am, DMask == VMask for
> SIMD4x2. VMask shouldn't be used for SIMD8.

Correct - for VS, GS, HS, and DS.

We actually want to use VMask for pixel shaders.  DMask contains the
mask of which pixels are actually lit.  VMask extends that to contain
the whole 2x2 block of pixels, including unlit "helper pixels" used
for derivative computations.

> While here, you've probably seen this before, but I just noticed for SIMD8 GS on
> BDW:
> "Not valid for objects with more than 6 vertices per object."

Yeah.  I think that prevents us from doing triangle strips with
adjacency in SIMD8 mode.  This is a crazy mode introduced in
ARB_geometry_shader4, which was actually removed in OpenGL 3.2.

Irritatingly, someone copy and pasted it into the GLES GS extension,
so we still have to deal with that mess and fall back to 4x2 mode. :/

Thankfully they fixed this on Skylake.

> Probably we don't care, but SPF might be effected by this patch, broken, or
> fixed by this - I can't quite tell which.

Yeah, I don't think we care too much.

> This seems fine to me though.
> Reviewed-by: Ben Widawsky <ben at bwidawsk.net>

Thanks Ben!
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: This is a digitally signed message part.
URL: <http://lists.freedesktop.org/archives/mesa-dev/attachments/20150530/3e1d40a7/attachment-0001.sig>

More information about the mesa-dev mailing list