On Friday, November 13, 2015 10:10:28 AM Pohjolainen, Topi wrote:
> On Thu, Nov 12, 2015 at 03:38:52PM -0800, Kenneth Graunke wrote:
> > This was getting pretty out of hand, and with compute partially in place
> > and tessellation on the way, it was only going to get worse.
> > 
> > This patch makes a "stage exists?" predicate and a "number of stages"
> > count and uses them to clean up a lot of calculations.  We can just
> > loop over shader stages and set things for the ones that exist.  For
> > combined counts, we can just multiply by the number of stages.
> > 
> > It also tries to organize a little bit.
> > 
> > We should probably use _mesa_has_geometry_shaders/tessellation/compute
> > here, but we can't because ctx->Version isn't initialized yet.  Perhaps
> > that could be fixed in the future.
> > 
> > No change in "glxinfo -l" on Broadwell.
> > 
> > Signed-off-by: Kenneth Graunke <kenn...@whitecape.org>
> > ---
> >  src/mesa/drivers/dri/i965/brw_context.c | 138 
> > ++++++++++++++------------------
> >  1 file changed, 58 insertions(+), 80 deletions(-)
> > 
> > diff --git a/src/mesa/drivers/dri/i965/brw_context.c 
> > b/src/mesa/drivers/dri/i965/brw_context.c
> > index 2db99c7..89533ae 100644
> > --- a/src/mesa/drivers/dri/i965/brw_context.c
> > +++ b/src/mesa/drivers/dri/i965/brw_context.c
> > @@ -322,64 +322,85 @@ static void
> >  brw_initialize_context_constants(struct brw_context *brw)
> >  {
> >     struct gl_context *ctx = &brw->ctx;
> > +   const struct brw_compiler *compiler = brw->intelScreen->compiler;
> > +
> > +   bool stage_exists[MESA_SHADER_STAGES] = {
> 
> This could be const.

Right...changed in v2.  Thanks.

Attachment: signature.asc
Description: This is a digitally signed message part.

_______________________________________________
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev

Reply via email to