[Mesa-dev] [PATCH 3/4] intel: Use rb->Data and rb->RowStride to handle spans Y flipping.

Eric Anholt eric at anholt.net
Mon Jun 13 09:51:22 PDT 2011


On Sun, 12 Jun 2011 22:28:08 -0700, Chad Versace <chad at chad-versace.us> wrote:
> On Tue,  7 Jun 2011 11:47:13 -0700, Eric Anholt <eric at anholt.net> wrote:
> > This is already pointing at 0 or Height - 1 and with an appropriate
> > pitch, so no need to recompute those values per customization of the
> > spans code.  Cuts 3 out of 21kb of the compiled size.
> > ---
> >  src/mesa/drivers/dri/intel/intel_span.c |   11 ++++-------
> >  1 files changed, 4 insertions(+), 7 deletions(-)
> > 
> > diff --git a/src/mesa/drivers/dri/intel/intel_span.c b/src/mesa/drivers/dri/intel/intel_span.c
> > index 5290342..8978129 100644
> > --- a/src/mesa/drivers/dri/intel/intel_span.c
> > +++ b/src/mesa/drivers/dri/intel/intel_span.c
> > @@ -50,21 +50,18 @@ intel_set_span_functions(struct intel_context *intel,
> >  
> >  #define LOCAL_VARS							\
> >     struct intel_renderbuffer *irb = intel_renderbuffer(rb);		\
> > -   const GLint yScale = rb->Name ? 1 : -1;				\
> > -   const GLint yBias = rb->Name ? 0 : rb->Height - 1;			\
> >     int minx = 0, miny = 0;						\
> >     int maxx = rb->Width;						\
> >     int maxy = rb->Height;						\
> > -   int pitch = irb->region->pitch * irb->region->cpp;			\
> > -   void *buf = irb->region->buffer->virtual;				\
> > +   int pitch = rb->RowStride * irb->region->cpp;			\
> > +   void *buf = rb->Data;						\
> >     GLuint p;								\
> > -   (void) p;								\
> > -   (void)buf; (void)pitch; /* unused for non-gttmap. */			\
> > +   (void) p;
> 
> Since you immediately void out p, why even declare it?

It's used in half of the callers of this macro, but not the other half.
The "(void)" suppresses unused variable warnings.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 197 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/mesa-dev/attachments/20110613/f1071eb0/attachment.pgp>


More information about the mesa-dev mailing list