[Mesa-dev] [PATCH v3 19/34] intel/compiler: Add union types for prog_data and prog_key stages

Kenneth Graunke kenneth at whitecape.org
Tue Oct 24 18:32:04 UTC 2017


On Monday, October 23, 2017 11:33:44 PM PDT Jordan Justen wrote:
> On 2017-10-23 23:23:27, Kenneth Graunke wrote:
> > On Sunday, October 22, 2017 1:01:27 PM PDT Jordan Justen wrote:
> > > Signed-off-by: Jordan Justen <jordan.l.justen at intel.com>
> > > ---
> > >  src/intel/compiler/brw_compiler.h | 18 ++++++++++++++++++
> > >  1 file changed, 18 insertions(+)
> > > 
> > > diff --git a/src/intel/compiler/brw_compiler.h b/src/intel/compiler/brw_compiler.h
> > > index 701b4a80bf1..9359b767e35 100644
> > > --- a/src/intel/compiler/brw_compiler.h
> > > +++ b/src/intel/compiler/brw_compiler.h
> > > @@ -403,6 +403,15 @@ struct brw_cs_prog_key {
> > >     struct brw_sampler_prog_key_data tex;
> > >  };
> > >  
> > > +typedef union {
> > > +   struct brw_vs_prog_key vs;
> > > +   struct brw_tcs_prog_key tcs;
> > > +   struct brw_tes_prog_key tes;
> > > +   struct brw_gs_prog_key gs;
> > > +   struct brw_wm_prog_key wm;
> > > +   struct brw_cs_prog_key cs;
> > > +} brw_any_prog_key;
> > > +
> > >  /*
> > >   * Image metadata structure as laid out in the shader parameter
> > >   * buffer.  Entries have to be 16B-aligned for the vec4 back-end to be
> > > @@ -1066,6 +1075,15 @@ struct brw_clip_prog_data {
> > >     uint32_t total_grf;
> > >  };
> > >  
> > > +typedef union {
> > > +   struct brw_vs_prog_data vs;
> > > +   struct brw_tcs_prog_data tcs;
> > > +   struct brw_tes_prog_data tes;
> > > +   struct brw_gs_prog_data gs;
> > > +   struct brw_wm_prog_data wm;
> > > +   struct brw_cs_prog_data cs;
> > > +} brw_any_prog_data;
> > > +
> > >  #define DEFINE_PROG_DATA_DOWNCAST(stage)                       \
> > >  static inline struct brw_##stage##_prog_data *                 \
> > >  brw_##stage##_prog_data(struct brw_stage_prog_data *prog_data) \
> > > 
> > 
> > Might be worth leaving a comment that this aren't usable for SF, Clip,
> > BLORP blit, or BLORP clear programs.  It's...most any :)
> 
> Would brw_any_stage_prog_key and brw_any_stage_prog_data help, or just
> cause confusion with brw_stage_prog_data?
> 
> I not too happy with 'any' here as well. :\
> 
> -Jordan

I think 'any' is fine, with a comment.

--Ken
-------------- 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/20171024/1f67ac8f/attachment.sig>


More information about the mesa-dev mailing list