On 25 September 2013 10:18, Chad Versace <chad.vers...@linux.intel.com>wrote:

> On 07/22/2013 03:54 PM, Frank Henigman wrote:> Extend the fast texture
> upload from BGRA X-tiled to include RGBA,
> > diff --git a/src/mesa/drivers/dri/i965/intel_tex_subimage.c
> b/src/mesa/drivers/dri/i965/intel_tex_subimage.c
> > index 05e684c..6df7de1 100644
> > --- a/src/mesa/drivers/dri/i965/**intel_tex_subimage.c
> > +++ b/src/mesa/drivers/dri/i965/**intel_tex_subimage.c
> > @@ -43,6 +43,30 @@
> >
> >   #define FILE_DEBUG_FLAG DEBUG_TEXTURE
> >
> > +#define ALIGN_DOWN(a, b) ( (a) / (b) * (b) )
> > +#define ALIGN_UP(a, b) ALIGN_DOWN( (a)+(b)-1, b )
>
> There already exists a macro in Mesa to align-up, named ALIGN. Let's
> eliminate
> duplicate definitions by aliasing ALIGN_UP to ALIGN.
>
> #define ALIGN_UP(a, b) ALIGN(a, b)


There's also a macro to do ALIGN_DOWN, which is called ROUND_DOWN_TO().

Note that the existing ALIGN() and ROUND_DOWN_TO() macros only work when b
is a power of two.
_______________________________________________
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev

Reply via email to