Name
NV_pack_subimage
Name Strings
GL_NV_pack_subimage
Contact
Peter Pipkorn, NVIDIA Corporation (ppipkorn 'at' nvidia.com)
Contributors
Nicolai de Haan, NVIDIA Corporation (nicolaid 'at' nvidia.com)
Status
Draft
Version
Last Modifed Date: Dec 11, 2010
Author Revision: 0.3
Number
TBD
Dependencies
The extension is written against the OpenGL ES 2.0 specification.
The extension references the OpenGL 2.0 specification.
The extension references text in the NV_unpack_subimage
extension, although that extension does not need to be implemented.
The presence of OES_texture_3D affects the definition of this extension.
The presence of EXT_texture_array affects the definition of this extension.
The presence of NV_get_tex_image affects the definition of this extension.
Overview
This OpenGL ES 2.0 extension back support for GL_PACK_ROW_LENGTH_NV,
GL_PACK_SKIP_ROWS_NV and GL_PACK_SKIP_PIXELS_NV as valid enums to PixelStore.
The functionality is the same as in OpenGL. These are useful to update
a sub-rectangle in host memory with data that can be read from
the framebuffer or a texture (using FBO and texture attachments).
The extension also adds the support for GL_PACK_SKIP_IMAGES_NV and
GL_PACK_IMAGE_HEIGHT_NV for 3D textures or 2D array textures, if
either of the corresponding extensions are present along with
NV_get_tex_image.
IP Status
None
Issues
1. Can't this be done with repeated calls to ReadPixels?
Yes, it is possible to pack pixels into a sub-rectangle in host
memory by by calling this function for one line at a time, but
this could add unnecessary burden on the CPU system. Specifying
GL_PACK_ROW_LENGTH_NV or GL_PACK_IMAGE_HEIGHT_NV makes it possible to
pack sub-rectangles or sub-volumes of pixels with lower overhead.
2. Should the corresponding UNPACK enums be added?
No, it should be done in a separate extension. There is no dependency
between the PACK enums and the UNPACK enums.
3. Are these PACK_SKIP_* tokens strictly necessary?
No. The same functionality can be achieved by advancing the pixel
pointer to host memory appropriately before issuing an packing
function call. They are included here for both completeness and
for convenience.
New Procedures and Functions
None
New Tokens
Accepted by the <pname> parameters of PixelStorei,
GetIntegerv, and GetFloatv:
GL_PACK_ROW_LENGTH_NV 0x0D02
GL_PACK_SKIP_ROWS_NV 0x0D03
GL_PACK_SKIP_PIXELS_NV 0x0D04
If OES_texture_3D or EXT_texture_array is present, and NV_get_tex_image is
also present:
GL_PACK_SKIP_IMAGES_NV 0x806B
GL_PACK_IMAGE_HEIGHT_NV 0x806C
(These are the same values as the corresponding enums in OpenGL)
Additions to the OpenGL ES 2.0 Specification
Modifications to Table 4.3 (PixelStore parameters for ReadPixels)
Add the following entries:
Parameter Name Type Initial Value Valid Range
============== ==== ============= ===========
PACK_ROW_LENGTH_NV integer 0 [0,Infinity)
PACK_SKIP_ROWS_NV integer 0 [0,Infinity)
PACK_SKIP_PIXELS_NV integer 0 [0,Infinity)
When OES_texture_3D or EXT_texture_array is present, and NV_get_tex_image
is also present then add these entries to Table 4.3:
PACK_SKIP_IMAGES_NV integer 0 [0,Infinity)
PACK_IMAGE_HEIGHT_NV integer 0 [0,Infinity)
For section 4.3.1, in the "Placement in Client Memory" section,
the reference to section 3.6.2, should be read as if the modifications
described in extension NV_unpack_subimage is applied to the text.
Errors
None
New State
Modifications to Table 6.12 Pixels in section 6.2 State Tables:
Get Value Type Get Cmnd Initial Description Sec. Attribute
Value
==================== ==== =========== ======= ============================ ===== ===========
PACK_ROW_LENGTH_NV Z+ GetIntegerv 0 Value of PACK_ROW_LENGTH_NV 4.3.1 pixel-store
PACK_SKIP_ROWS_NV Z+ GetIntegerv 0 Value of PACK_SKIP_ROWS_NV 4.3.1 pixel-store
PACK_SKIP_PIXELS_NV Z+ GetIntegerv 0 Value of PACK_SKIP_PIXELS_NV 4.3.1 pixel-store
If OES_texture_3D or EXT_texture_array is present, and NV_get_tex_image
is also present then add to Table 6.12:
PACK_SKIP_IMAGES_NV Z+ GetIntegerv 0 Value of PACK_SKIP_IMAGES_NV 4.3.1 pixel-store
PACK_IMAGE_HEIGHT_NV Z+ GetIntegerv 0 Value of PACK_IMAGE_HEIGHT_NV 4.3.1 pixel-store
Revision History
12/11/2010 0.3
- PACK_SKIP_IMAGES_NV and PACK_IMAGE_HEIGHT_NV are now conditional on
the presence of NV_get_tex_image.
11/23/2010 0.2
- Corrected extension name. Covered EXT_texture_array. Expanded on
Issues section. Added PACK_SKIP_IMAGES_NV, PACK_IMAGE_HEIGHT_NV.
10/02/2009 0.1
- Original draft.