[Mesa-dev] [PATCH] i965: add XRGB to fast texture upload
Courtney Goeltzenleuchter
courtney at lunarg.com
Mon Oct 14 00:37:03 CEST 2013
On Sun, Oct 13, 2013 at 1:41 PM, Ian Romanick <idr at freedesktop.org> wrote:
> On 10/11/2013 10:16 AM, Courtney Goeltzenleuchter wrote:
> > MESA_FORMAT_XRGB8888 is equivalent to MESA_FORMAT_ARGB8888 in terms
> > of storage on the device, so okay to use this optimized copy routine.
> > ---
> > src/mesa/drivers/dri/i965/intel_tex_subimage.c | 3 ++-
> > 1 file changed, 2 insertions(+), 1 deletion(-)
> >
> > diff --git a/src/mesa/drivers/dri/i965/intel_tex_subimage.c
> b/src/mesa/drivers/dri/i965/intel_tex_subimage.c
> > index 5cfdbd9..4aec05d 100644
> > --- a/src/mesa/drivers/dri/i965/intel_tex_subimage.c
> > +++ b/src/mesa/drivers/dri/i965/intel_tex_subimage.c
> > @@ -564,7 +564,8 @@ intel_texsubimage_tiled_memcpy(struct gl_context *
> ctx,
> > (texImage->TexFormat == MESA_FORMAT_A8 && format == GL_ALPHA)) {
> > cpp = 1;
> > mem_copy = memcpy;
> > - } else if (texImage->TexFormat == MESA_FORMAT_ARGB8888) {
> > + } else if ((texImage->TexFormat == MESA_FORMAT_ARGB8888) ||
> > + (texImage->TexFormat == MESA_FORMAT_XRGB8888)) {
> > cpp = 4;
> > if (format == GL_BGRA) {
> > mem_copy = memcpy;
> >
>
> Are there appropriate test cases that hit this path? I don't think
> piglit exercises a lot of different texture formats. I just want to be
> sure that some test now hits this fast path that didn't hit it before.
>
This path is exercised by the Smokin' Guns benchmark during it's
initialization but not during the measured part of the run.
I've also verified that the piglit test: glean -o -v -v -v -t +pixelFormats
--quick
exercises this path.
As for other benchmarks, I'd welcome suggestions. I couldn't find anything
beyond the Mesa demo that Frank used to test his patch.
On Smokin' Guns, with these patches combined (Franks, XRGB and all-levels),
using valgrind I measured a reduction in instruction count of intelTexImage
of 47.3% (from 2344404725 to 1235584087). Without all three patches, the
driver was falling back to a Mesa copy routine that copied one byte at a
time.
Does that help?
Courtney
--
Courtney Goeltzenleuchter
LunarG
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/mesa-dev/attachments/20131013/92252f08/attachment-0001.html>
More information about the mesa-dev
mailing list