[Mesa-dev] [PATCH] i965: Use align1 mode for TCS barrier messages.
Kenneth Graunke
kenneth at whitecape.org
Mon Jan 16 00:03:19 UTC 2017
On Sunday, January 15, 2017 12:19:36 PM PST Jordan Justen wrote:
> Maybe you should drop 'TCS' from the subject? I think TCS is the
> reason for the change, but it doesn't only affect TCS barrier
> messages, right?
Well, scalar TCS and CS are already in align1 mode, so even though
this is common code, it really only affects vec4 TCS. Either way.
>
> On 2017-01-15 01:45:45, Kenneth Graunke wrote:
> > In commit 7428e6f86ab5 we switched the barrier SEND message's
> > destination type to UW to avoid problems in SIMD16 compute shaders.
> >
> > Tessellation control shaders also use barriers, and in vec4 mode, we
> > were emitting them in align16 mode. The simulator warns that only UD,
> > D, F, and DF are valid destination types - UW is technically illegal.
>
> UW is okay if using align1? This wording just makes it sound like it
> is illegal in all cases.
I believe so - the simulator's happy in align1 mode.
> >
> > So, switch to align1 mode. Either mode should work fine.
> >
> > Signed-off-by: Kenneth Graunke <kenneth at whitecape.org>
> > ---
> > src/mesa/drivers/dri/i965/brw_eu_emit.c | 4 ++++
> > 1 file changed, 4 insertions(+)
> >
> > diff --git a/src/mesa/drivers/dri/i965/brw_eu_emit.c b/src/mesa/drivers/dri/i965/brw_eu_emit.c
> > index 8536a130725..d79a8655c94 100644
> > --- a/src/mesa/drivers/dri/i965/brw_eu_emit.c
> > +++ b/src/mesa/drivers/dri/i965/brw_eu_emit.c
> > @@ -3587,6 +3587,8 @@ brw_barrier(struct brw_codegen *p, struct brw_reg src)
> >
> > assert(devinfo->gen >= 7);
> >
> > + brw_push_insn_state(p);
> > + brw_set_default_access_mode(p, BRW_ALIGN_1);
> > inst = next_insn(p, BRW_OPCODE_SEND);
> > brw_set_dest(p, inst, retype(brw_null_reg(), BRW_REGISTER_TYPE_UW));
> > brw_set_src0(p, inst, src);
> > @@ -3598,11 +3600,13 @@ brw_barrier(struct brw_codegen *p, struct brw_reg src)
> > false /* header_present */,
> > false /* end_of_thread */);
> >
> > +
>
> Bonus line?
Bonus line! Apparently. I'll remove it :)
> Reviewed-by: Jordan Justen <jordan.l.justen at intel.com>
Thanks!
> > brw_inst_set_gateway_notify(devinfo, inst, 1);
> > brw_inst_set_gateway_subfuncid(devinfo, inst,
> > BRW_MESSAGE_GATEWAY_SFID_BARRIER_MSG);
> >
> > brw_inst_set_mask_control(devinfo, inst, BRW_MASK_DISABLE);
> > + brw_pop_insn_state(p);
> > }
> >
> >
>
-------------- 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/20170115/5e6c3089/attachment-0001.sig>
More information about the mesa-dev
mailing list