[Mesa-dev] [PATCH] i965: Convert brw->*_program into a brw->programs[i] array.

Kenneth Graunke kenneth at whitecape.org
Tue Sep 26 15:54:43 UTC 2017


On Tuesday, September 26, 2017 1:13:18 AM PDT Alejandro Piñeiro wrote:
> On 26/09/17 09:39, Kenneth Graunke wrote:
> > diff --git a/src/mesa/drivers/dri/i965/genX_state_upload.c b/src/mesa/drivers/dri/i965/genX_state_upload.c
> > index 612761601a2..2a99376e3c2 100644
> > --- a/src/mesa/drivers/dri/i965/genX_state_upload.c
> > +++ b/src/mesa/drivers/dri/i965/genX_state_upload.c
> > @@ -1019,6 +1019,9 @@ genX(calculate_attr_overrides)(const struct brw_context *brw,
> >     /* _NEW_POINT */
> >     const struct gl_point_attrib *point = &ctx->Point;
> >  
> > +   /* BRW_NEW_FRAGMENT_PROGRAM */
> > +   const struct gl_program *fp = brw->programs[MESA_SHADER_FRAGMENT];
> > +
> >     /* BRW_NEW_FS_PROG_DATA */
> >     const struct brw_wm_prog_data *wm_prog_data =
> >        brw_wm_prog_data(brw->wm.base.prog_data);
> > @@ -1026,16 +1029,14 @@ genX(calculate_attr_overrides)(const struct brw_context *brw,
> >  
> >     *point_sprite_enables = 0;
> >  
> > -   /* BRW_NEW_FRAGMENT_PROGRAM
> 
> Was this header removed on purpose? Don't care too much about it,
> pointing just in case.

Yeah, I kept it with the use of brw->fragment_program (initializing fp).

> > -    *
> > -    * If the fragment shader reads VARYING_SLOT_LAYER, then we need to pass in
> > +   /* If the fragment shader reads VARYING_SLOT_LAYER, then we need to pass in
> >      * the full vertex header.  Otherwise, we can program the SF to start
> >      * reading at an offset of 1 (2 varying slots) to skip unnecessary data:
> >      * - VARYING_SLOT_PSIZ and BRW_VARYING_SLOT_NDC on gen4-5
> >      * - VARYING_SLOT_{PSIZ,LAYER} and VARYING_SLOT_POS on gen6+
> >      */
> >  
> > -   bool fs_needs_vue_header = brw->fragment_program->info.inputs_read &
> > +   bool fs_needs_vue_header = fp->info.inputs_read &
> >        (VARYING_BIT_LAYER | VARYING_BIT_VIEWPORT);
> >  
> >     *urb_entry_read_offset = fs_needs_vue_header ? 0 : 1;
[snip]
> As mentioned, my previous comment was a just-in-case. You can ignore it. So:
> Reviewed-by: Alejandro Piñeiro <apinheiro at igalia.com>

Thanks!
-------------- 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/20170926/a69d1fa7/attachment.sig>


More information about the mesa-dev mailing list