[Mesa-dev] [PATCH 5/5] meta: Don't use integer handles for shaders or programs.

Kenneth Graunke kenneth at whitecape.org
Wed Mar 16 17:28:12 UTC 2016


On Wednesday, March 16, 2016 5:36:25 PM PDT Pohjolainen, Topi wrote:
> On Wed, Mar 16, 2016 at 12:13:02AM -0700, Kenneth Graunke wrote:
[snip]
> > @@ -265,22 +270,21 @@ setup_coord_coeff(GLuint prog, GLuint multiplier, 
GLuint offset,
> >   * destination rectangle is adjusted for possible msaa and Y-tiling.
> >   */
> >  static void
> > -setup_coord_transform(GLuint prog, const struct blit_dims *dims)
> > +setup_coord_transform(struct gl_shader_program *sh_prog,
> > +                      const struct blit_dims *dims)
> >  {
> > -   setup_coord_coeff(prog,
> > -                     _mesa_GetUniformLocation(prog, "src_x_scale"),
> > -                     _mesa_GetUniformLocation(prog, "src_x_off"),
> > +   setup_coord_coeff(get_uniform_loc(sh_prog, "src_x_scale"),
> > +                     get_uniform_loc(sh_prog, "src_x_off"),
> >                       dims->src_x0, dims->src_x1, dims->dst_x0, dims-
>dst_x1,
> >                       dims->mirror_x);
> >  
> > -   setup_coord_coeff(prog,
> > -                     _mesa_GetUniformLocation(prog, "src_y_scale"),
> > -                     _mesa_GetUniformLocation(prog, "src_y_off"),
> > +   setup_coord_coeff(get_uniform_loc(sh_prog, "src_y_scale"),
> > +                     get_uniform_loc(sh_prog, "src_y_off"),
> >                       dims->src_y0, dims->src_y1, dims->dst_y0, dims-
>dst_y1,
> >                       dims->mirror_y);
> >  }
> >  
> > -static GLuint
> > +static struct gl_shader_program *
> >  setup_program(struct brw_context *brw, bool msaa_tex)
> >  {
> >     struct gl_context *ctx = &brw->ctx;
> > @@ -291,21 +295,22 @@ setup_program(struct brw_context *brw, bool 
msaa_tex)
> >     _mesa_meta_setup_vertex_objects(&brw->ctx, &blit->VAO, &blit->buf_obj, 
true,
> >                                     2, 2, 0);
> >  
> > -   GLuint *prog_id = &brw->meta_stencil_blit_programs[msaa_tex];
> > +   struct gl_shader_program **sh_prog_p =
> 
> I think this could be 'shader_prog' just as you have it in the rest of
> patch. Either way:
> 
> Reviewed-by: Topi Pohjolainen <topi.pohjolainen at intel.com>

I put the extra "_p" (thought about "_ptr") because of the extra level
of indirection - it's a pointer to a shader_prog pointer.  I can't say
I find this bit of code pretty, though :)

--Ken
-------------- 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: <https://lists.freedesktop.org/archives/mesa-dev/attachments/20160316/cbff0dc1/attachment.sig>


More information about the mesa-dev mailing list