[Mesa-dev] [PATCH 3/3] i965: Use proper pitch for scalar GS pull constants and UBOs.

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


On Friday, May 29, 2015 03:59:32 PM Ben Widawsky wrote:
> On Fri, May 29, 2015 at 12:26:40PM -0700, Kenneth Graunke wrote:
> > See the corresponding code in brw_vs_surface_state.c.
> > 
> > Signed-off-by: Kenneth Graunke <kenneth at whitecape.org>
> > ---
> >  src/mesa/drivers/dri/i965/brw_gs_surface_state.c | 10 +++++++---
> >  1 file changed, 7 insertions(+), 3 deletions(-)
> > 
> > diff --git a/src/mesa/drivers/dri/i965/brw_gs_surface_state.c b/src/mesa/drivers/dri/i965/brw_gs_surface_state.c
> > index a323e4d..bfc4516 100644
> > --- a/src/mesa/drivers/dri/i965/brw_gs_surface_state.c
> > +++ b/src/mesa/drivers/dri/i965/brw_gs_surface_state.c
> > @@ -47,11 +47,12 @@ brw_upload_gs_pull_constants(struct brw_context *brw)
> >        return;
> >  
> >     /* BRW_NEW_GS_PROG_DATA */
> > -   const struct brw_stage_prog_data *prog_data = &brw->gs.prog_data->base.base;
> > +   struct brw_vue_prog_data *prog_data = &brw->gs.prog_data->base;
> > +   bool dword_pitch = prog_data->dispatch_mode == DISPATCH_MODE_SIMD8;
> >  
> >     /* _NEW_PROGRAM_CONSTANTS */
> >     brw_upload_pull_constants(brw, BRW_NEW_GS_CONSTBUF, &gp->program.Base,
> > -                             stage_state, prog_data, false);
> > +                             stage_state, &prog_data->base, dword_pitch);
> >  }
> >  
> >  const struct brw_tracked_state brw_gs_pull_constants = {
> > @@ -77,8 +78,11 @@ brw_upload_gs_ubo_surfaces(struct brw_context *brw)
> >        return;
> >  
> >     /* BRW_NEW_GS_PROG_DATA */
> > +   struct brw_vue_prog_data *prog_data = &brw->gs.prog_data->base;
> > +   bool dword_pitch = prog_data->dispatch_mode == DISPATCH_MODE_SIMD8;
> > +
> >     brw_upload_ubo_surfaces(brw, prog->_LinkedShaders[MESA_SHADER_GEOMETRY],
> > -			   &brw->gs.base, &brw->gs.prog_data->base.base, false);
> > +			   &brw->gs.base, &prog_data->base, dword_pitch);
> >  }
> >  
> >  const struct brw_tracked_state brw_gs_ubo_surfaces = {
> 
> See comment in the previous patch... but as you like:
> Reviewed-by: Ben Widawsky <ben at bwidawsk.net>

I think I'll skip adding an assertion here.  For GS, all values are
legal, so there's nothing to assert.  For VS, it's not really important:
all we want to know is if it's SIMD8 or vec4-of-some-sort.

The assertion I'm adding in gen8_vs_state.c should eventually catch
bogus dispatch_mode values.
-------------- 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/c76b1981/attachment.sig>


More information about the mesa-dev mailing list