[Mesa-dev] Should GL_UN/PACK_IMAGE_HEIGHT affect GL_TEXTURE_1D_ARRAY?

Neil Roberts neil at linux.intel.com
Fri Feb 27 05:28:57 PST 2015


Ian Romanick <idr at freedesktop.org> writes:

> IMAGE_HEIGHT is definitely used for glGetTexImage because that and
> IMAGE_WIDTH allow you to get a subimage (before ARB_get_texture_sub_image).
>
> I guess on glTexImage2D those could let you initialize a subregion of a
> larger texture... kind of like doing glTexImage2D(..., NULL) followed by
> glTexSubImage2D.  It does seem pretty weird.

No, that's not right. The packing properties are used to describe the
layout of the client-side image, not the texture, so they aren't a
replacement for glGetTexSubImage or glTexSubImage?D. You can use them to
download to or upload from a sub-region of a larger image in your
client-side malloc'd buffer, but not a subregion of the texture.

I don't think there's any question whether the IMAGE_HEIGHT property
should affect glGetTexImage or glTexImage3D in general but the question
I'm asking is specifically whether it should affect 1D array textures.
The IMAGE_HEIGHT property is normally only used to help specify a
subregion of a 3D image. Arguably you could say that a 1D array texture
is like a 3D image with a width and depth but the height fixed at 1,
however GL doesn't seem to treat it like that because you have to use
glTexImage2D to upload it. It seems more like it is treating it as a 2D
image and in that case IMAGE_HEIGHT doesn't make any sense because it is
only used to create padding between the multiple images of a 3D texture.
You can already use the ROW_LENGTH property to describe the padding
between the 1D images of your client-side representation of the 1D
texture.

Regards,
- Neil


More information about the mesa-dev mailing list