OSDN Git Service

meta: Allow GL_UN/PACK_IMAGE_HEIGHT in _mesa_meta_pbo_Get/TexSubImage
authorNeil Roberts <neil@linux.intel.com>
Thu, 26 Feb 2015 12:53:50 +0000 (12:53 +0000)
committerNeil Roberts <neil@linux.intel.com>
Thu, 5 Mar 2015 13:24:45 +0000 (13:24 +0000)
commita08bff1e98b8e630f8bdf341af1491cd99e7d104
tree9cb4bef04d41475fa2ebd30e5183aec5c3690cf3
parent7d10d2feee381739eef97f4720cbadbd65bb4fc6
meta: Allow GL_UN/PACK_IMAGE_HEIGHT in _mesa_meta_pbo_Get/TexSubImage

Now that a layered source PBO is interpreted as a single tall 2D image
it's quite easy to accept the image height packing option by just
creating an image that is tall enough to include the image padding.

I'm not sure whether the image height property should affect 1D_ARRAY
textures. My intuition and interpretation of the GL spec (which is a
bit vague) would be that it shouldn't. However the software fallback
path in Mesa uses the property for packing but not for unpacking. The
binary NVidia driver uses it for both. This patch doesn't use it for
either case so it is different from the software fallback. There is
some discussion about this here:

http://lists.freedesktop.org/archives/mesa-dev/2015-February/077925.html

This is tested by the texsubimage Piglit test with the array and pbo
arguments. Previously this test was skipping this code path because it
always sets the image height.

I've also tested it by modifying the getteximage-targets test. It
wasn't using this code path before because it was using the default
texture object so this code couldn't successfully create a frame
buffer. I also modified it to add some image padding with the image
height in the PBO.

Reviewed-by: Jason Ekstrand <jason.ekstrand@intel.com>
Cc: "10.5" <mesa-stable@lists.freedesktop.org>
src/mesa/drivers/common/meta_tex_subimage.c