[Mesa-dev] [PATCH] vbo: introduce vbo_get_minmax_indices function

Yuanhan Liu yuanhan.liu at linux.intel.com
Wed Jan 11 00:17:52 PST 2012


On Tue, Jan 10, 2012 at 08:43:18PM -0700, Brian Paul wrote:
> On Tue, Jan 3, 2012 at 8:59 PM, Yuanhan Liu <yuanhan.liu at linux.intel.com> wrote:
> > On Wed, Jan 04, 2012 at 11:20:07AM +0800, Yuanhan Liu wrote:
> >> On Tue, Jan 03, 2012 at 08:25:31PM +0100, Roland Scheidegger wrote:
> >> > Ah index scanning...
> >> > I don't like that this will map/unmap the ib once for each prim,
> >> Me either :)
> >>
> >> > though
[snip]..
> > +vbo_get_minmax_indices(struct gl_context *ctx,
> > +                       const struct _mesa_prim *prims,
> > +                       const struct _mesa_index_buffer *ib,
> > +                       GLuint *min_index,
> > +                       GLuint *max_index,
> > +                       GLuint nr_prims)
> > +{
> > +   struct _mesa_prim start_prim;
> 
> I think you could use a pointer for start_prim:
> 
> const struct _mesa_prim *start_prim;
> 
> to avoid copying 20 bytes per loop iteration below.  The declaration
> could also be moved inside the loop.

Aha, yes. I should do this. Thanks, here is the updated patch:



More information about the mesa-dev mailing list