meta: Support GenerateMipmaps on 2DArray textures.
authorKenneth Graunke <kenneth@whitecape.org>
Thu, 6 Mar 2014 05:02:06 +0000 (21:02 -0800)
committerKenneth Graunke <kenneth@whitecape.org>
Sat, 8 Mar 2014 06:45:17 +0000 (22:45 -0800)
commitec23d5197e4573bc0b9b3c719251d08f9f21714f
tree82ec7486837ebf7a02bf492f0943ad3c1c53988b
parent15b2f69b9c7d573bc978241da50549be4d3f2aca
meta: Support GenerateMipmaps on 2DArray textures.

This is largely a matter of looping over the number of slices/layers,
and not minifying depth (presumably that code exists for the unfinished
3D texture support).

Normally, I would have made the loop over array slices the outermost
loop.  I suspect that would make it trickier to support 3D textures
someday, though, so I didn't.  The advantage is that we would only have
one BufferData call per slice, rather than one per miplevel and slice.

However, a GenerateMipmaps microbenchmark indicates that either way is
basically just as fast.  So I'm not sure it's worth bothering.

Improves performance in a GenerateMipmaps microbenchmark by nearly 5x.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
src/mesa/drivers/common/meta_generate_mipmap.c