[Mesa-dev] [PATCH] i965: extend fast texture upload

Paul Berry stereotype441 at gmail.com
Wed Sep 25 10:40:39 PDT 2013


On 25 September 2013 10:18, Chad Versace <chad.versace at 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.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/mesa-dev/attachments/20130925/187d756b/attachment.html>


More information about the mesa-dev mailing list