15bd8deadSopenharmony_ciName 25bd8deadSopenharmony_ci 35bd8deadSopenharmony_ci NV_pack_subimage 45bd8deadSopenharmony_ci 55bd8deadSopenharmony_ciName Strings 65bd8deadSopenharmony_ci 75bd8deadSopenharmony_ci GL_NV_pack_subimage 85bd8deadSopenharmony_ci 95bd8deadSopenharmony_ciContact 105bd8deadSopenharmony_ci 115bd8deadSopenharmony_ci Peter Pipkorn, NVIDIA Corporation (ppipkorn 'at' nvidia.com) 125bd8deadSopenharmony_ci 135bd8deadSopenharmony_ciContributors 145bd8deadSopenharmony_ci 155bd8deadSopenharmony_ci Pat Brown, NVIDIA 165bd8deadSopenharmony_ci Nicolai de Haan, NVIDIA 175bd8deadSopenharmony_ci Greg Roth, NVIDIA 185bd8deadSopenharmony_ci 195bd8deadSopenharmony_ciStatus 205bd8deadSopenharmony_ci 215bd8deadSopenharmony_ci Complete. 225bd8deadSopenharmony_ci 235bd8deadSopenharmony_ciVersion 245bd8deadSopenharmony_ci 255bd8deadSopenharmony_ci Last Modifed Date: Oct 07, 2012 265bd8deadSopenharmony_ci Author Revision: 3 275bd8deadSopenharmony_ci 285bd8deadSopenharmony_ciNumber 295bd8deadSopenharmony_ci 305bd8deadSopenharmony_ci OpenGL ES Extension #132 315bd8deadSopenharmony_ci 325bd8deadSopenharmony_ciDependencies 335bd8deadSopenharmony_ci 345bd8deadSopenharmony_ci OpenGLES 2.0 is required. 355bd8deadSopenharmony_ci 365bd8deadSopenharmony_ci The extension is written against the OpenGL ES 2.0.25 specification. 375bd8deadSopenharmony_ci 385bd8deadSopenharmony_ci EXT_unpack_subimage is required. 395bd8deadSopenharmony_ci 405bd8deadSopenharmony_ciOverview 415bd8deadSopenharmony_ci 425bd8deadSopenharmony_ci This OpenGL ES 2.0 extension adds support for GL_PACK_ROW_LENGTH_NV, 435bd8deadSopenharmony_ci GL_PACK_SKIP_ROWS_NV and GL_PACK_SKIP_PIXELS_NV as valid enums to 445bd8deadSopenharmony_ci PixelStore. The functionality is the same as in OpenGL. These are 455bd8deadSopenharmony_ci useful to update a sub-rectangle in host memory with data that can 465bd8deadSopenharmony_ci be read from the framebuffer or a texture (using FBO and texture 475bd8deadSopenharmony_ci attachments). 485bd8deadSopenharmony_ci 495bd8deadSopenharmony_ciNew Procedures and Functions 505bd8deadSopenharmony_ci 515bd8deadSopenharmony_ci None 525bd8deadSopenharmony_ci 535bd8deadSopenharmony_ciNew Tokens 545bd8deadSopenharmony_ci 555bd8deadSopenharmony_ci Accepted by the <pname> parameters of PixelStorei, 565bd8deadSopenharmony_ci GetIntegerv, and GetFloatv: 575bd8deadSopenharmony_ci 585bd8deadSopenharmony_ci GL_PACK_ROW_LENGTH_NV 0x0D02 595bd8deadSopenharmony_ci GL_PACK_SKIP_ROWS_NV 0x0D03 605bd8deadSopenharmony_ci GL_PACK_SKIP_PIXELS_NV 0x0D04 615bd8deadSopenharmony_ci 625bd8deadSopenharmony_ciAdditions to the OpenGL ES 2.0 Specification 635bd8deadSopenharmony_ci 645bd8deadSopenharmony_ci Modifications to Table 3.4 (PixelStore parameters for ReadPixels) 655bd8deadSopenharmony_ci 665bd8deadSopenharmony_ci Add the following entries: 675bd8deadSopenharmony_ci 685bd8deadSopenharmony_ci Parameter Name Type Initial Value Valid Range 695bd8deadSopenharmony_ci ============== ==== ============= =========== 705bd8deadSopenharmony_ci PACK_ROW_LENGTH_NV integer 0 [0,Infinity) 715bd8deadSopenharmony_ci PACK_SKIP_ROWS_NV integer 0 [0,Infinity) 725bd8deadSopenharmony_ci PACK_SKIP_PIXELS_NV integer 0 [0,Infinity) 735bd8deadSopenharmony_ci 745bd8deadSopenharmony_ci 755bd8deadSopenharmony_ci Note: The description of the behavior of the added PACK* PixelStore 765bd8deadSopenharmony_ci parameters is covered by the following existing text from 4.3.1 775bd8deadSopenharmony_ci subsection "Placement in Client Memory": 785bd8deadSopenharmony_ci 795bd8deadSopenharmony_ci Groups of elements are placed in memory just as they are taken 805bd8deadSopenharmony_ci from memory for TexImage2D. That is, the ith group of the jth 815bd8deadSopenharmony_ci row (corresponding to the ith pixel in the jth row) is placed in 825bd8deadSopenharmony_ci memory just where the ith group of the jth row would be taken 835bd8deadSopenharmony_ci from for TexImage2D. See Unpacking under section 3.6.2. The only 845bd8deadSopenharmony_ci difference is that the storage mode parameters whose names begin 855bd8deadSopenharmony_ci with PACK_ are used instead of those whose names begin with 865bd8deadSopenharmony_ci UNPACK_. 875bd8deadSopenharmony_ci 885bd8deadSopenharmony_ci The equivalent UNPACK_ storage mode parametes are documented by the 895bd8deadSopenharmony_ci text added by EXT_unpack_subimage. As such, no additional 905bd8deadSopenharmony_ci documentation language is required here. 915bd8deadSopenharmony_ci 925bd8deadSopenharmony_ciErrors 935bd8deadSopenharmony_ci 945bd8deadSopenharmony_ci None 955bd8deadSopenharmony_ci 965bd8deadSopenharmony_ciNew State 975bd8deadSopenharmony_ci 985bd8deadSopenharmony_ci Modifications to Table 6.12 Pixels in section 6.2 State Tables: 995bd8deadSopenharmony_ci 1005bd8deadSopenharmony_ci Get Value Type Get Cmnd Initial Description Sec. Attribute 1015bd8deadSopenharmony_ci Value 1025bd8deadSopenharmony_ci ==================== ==== =========== ======= ============================ ===== =========== 1035bd8deadSopenharmony_ci PACK_ROW_LENGTH_NV Z+ GetIntegerv 0 Value of PACK_ROW_LENGTH_NV 4.3.1 pixel-store 1045bd8deadSopenharmony_ci PACK_SKIP_ROWS_NV Z+ GetIntegerv 0 Value of PACK_SKIP_ROWS_NV 4.3.1 pixel-store 1055bd8deadSopenharmony_ci PACK_SKIP_PIXELS_NV Z+ GetIntegerv 0 Value of PACK_SKIP_PIXELS_NV 4.3.1 pixel-store 1065bd8deadSopenharmony_ci 1075bd8deadSopenharmony_ci 1085bd8deadSopenharmony_ciIssues 1095bd8deadSopenharmony_ci 1105bd8deadSopenharmony_ci 1. Can't this be done with repeated calls to ReadPixels? 1115bd8deadSopenharmony_ci 1125bd8deadSopenharmony_ci RESOLVED: Yes, it is possible to pack pixels into a sub- 1135bd8deadSopenharmony_ci rectangle in host memory by by calling this function for one 1145bd8deadSopenharmony_ci line at a time with <height> of 1 advancing the <data> pointer 1155bd8deadSopenharmony_ci each time, but this could add unnecessary burden on the CPU 1165bd8deadSopenharmony_ci system. Specifying GL_PACK_ROW_LENGTH_NV makes it possible to 1175bd8deadSopenharmony_ci pack sub-rectangles of pixels with lower overhead. 1185bd8deadSopenharmony_ci 1195bd8deadSopenharmony_ci 2. Should the corresponding UNPACK enums be added? 1205bd8deadSopenharmony_ci 1215bd8deadSopenharmony_ci RESOLVED: No, it should be done in a separate extension. There 1225bd8deadSopenharmony_ci is no functional dependency between the PACK enums and the 1235bd8deadSopenharmony_ci UNPACK enums. However, there is a language dependency. This 1245bd8deadSopenharmony_ci extension extends the language added by EXT_unpack_subimage. 1255bd8deadSopenharmony_ci Since this is intended to ship on platforms that support both, 1265bd8deadSopenharmony_ci Nothing is lost by adding a dependency for this reason. 1275bd8deadSopenharmony_ci 1285bd8deadSopenharmony_ci 3. Are these PACK_SKIP_* tokens strictly necessary? 1295bd8deadSopenharmony_ci 1305bd8deadSopenharmony_ci RESOLVED: No. The same functionality can be achieved by 1315bd8deadSopenharmony_ci advancing the pixel pointer to host memory appropriately before 1325bd8deadSopenharmony_ci issuing an packing function call. They are included here for 1335bd8deadSopenharmony_ci both completeness and for convenience. 1345bd8deadSopenharmony_ci 1355bd8deadSopenharmony_ci 4. Should PACK_SKIP_IMAGES and PACK_IMAGE_HEIGHT be included? 1365bd8deadSopenharmony_ci 1375bd8deadSopenharmony_ci RESOLVED: No. Without support for GetTexImage, their inclusion 1385bd8deadSopenharmony_ci makes less sense. The UNPACK_* equivalents were also left out 1395bd8deadSopenharmony_ci of EXT_unpack_subimage, which makes adding them here more 1405bd8deadSopenharmony_ci complicated to do right. 1415bd8deadSopenharmony_ci 1425bd8deadSopenharmony_ciRevision History 1435bd8deadSopenharmony_ci Rev. Date Author Changes 1445bd8deadSopenharmony_ci ---- ------------ --------- ------------------------------------- 1455bd8deadSopenharmony_ci 3 07 Nov 2012 groth Added issue clarifications and a note 1465bd8deadSopenharmony_ci about existing spec language. 1475bd8deadSopenharmony_ci 2 23 Oct 2012 groth Removed references to 3D texture images. 1485bd8deadSopenharmony_ci 1 02 Oct 2009 ppipkorn Original draft. 1495bd8deadSopenharmony_ci 150