15bd8deadSopenharmony_ciName 25bd8deadSopenharmony_ci 35bd8deadSopenharmony_ci EXT_unpack_subimage 45bd8deadSopenharmony_ci 55bd8deadSopenharmony_ciName Strings 65bd8deadSopenharmony_ci 75bd8deadSopenharmony_ci GL_EXT_unpack_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 Daniel Kartch, NVIDIA Corporation (dkartch 'at' nvidia.com) 165bd8deadSopenharmony_ci Nicolai de Haan, NVIDIA Corporation (nicolaid 'at' nvidia.com) 175bd8deadSopenharmony_ci Daniel Koch, NVIDIA Corporation (dkoch 'at' nvidia.com) 185bd8deadSopenharmony_ci 195bd8deadSopenharmony_ciStatus 205bd8deadSopenharmony_ci 215bd8deadSopenharmony_ci Complete. 225bd8deadSopenharmony_ci 235bd8deadSopenharmony_ciVersion 245bd8deadSopenharmony_ci 255bd8deadSopenharmony_ci Last Modifed Date: Feb 8, 2013 265bd8deadSopenharmony_ci Author Revision: 2 275bd8deadSopenharmony_ci 285bd8deadSopenharmony_ciNumber 295bd8deadSopenharmony_ci 305bd8deadSopenharmony_ci OpenGL ES Extension #90 315bd8deadSopenharmony_ci 325bd8deadSopenharmony_ciDependencies 335bd8deadSopenharmony_ci 345bd8deadSopenharmony_ci The extension is written against the OpenGL ES 2.0 specification. 355bd8deadSopenharmony_ci The extension references the OpenGL 2.0 specification. 365bd8deadSopenharmony_ci 375bd8deadSopenharmony_ciOverview 385bd8deadSopenharmony_ci 395bd8deadSopenharmony_ci This OpenGL ES 2.0 extension adds support for GL_UNPACK_ROW_LENGTH, 405bd8deadSopenharmony_ci GL_UNPACK_SKIP_ROWS and GL_UNPACK_SKIP_PIXELS as valid enums to 415bd8deadSopenharmony_ci PixelStore. The functionality is the same as in OpenGL. These are 425bd8deadSopenharmony_ci useful for updating textures with a sub-rectangle of pixel data 435bd8deadSopenharmony_ci coming from a larger image in host memory. 445bd8deadSopenharmony_ci 455bd8deadSopenharmony_ciIP Status 465bd8deadSopenharmony_ci 475bd8deadSopenharmony_ci None 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, GetIntegerv, and 565bd8deadSopenharmony_ci GetFloatv: 575bd8deadSopenharmony_ci 585bd8deadSopenharmony_ci GL_UNPACK_ROW_LENGTH_EXT 0x0CF2 595bd8deadSopenharmony_ci GL_UNPACK_SKIP_ROWS_EXT 0x0CF3 605bd8deadSopenharmony_ci GL_UNPACK_SKIP_PIXELS_EXT 0x0CF4 615bd8deadSopenharmony_ci 625bd8deadSopenharmony_ciAdditions to the OpenGL ES 2.0 Specification 635bd8deadSopenharmony_ci 645bd8deadSopenharmony_ci Modifications to Table 3.1 (PixelStore parameters) 655bd8deadSopenharmony_ci 665bd8deadSopenharmony_ci Add the following entries: 675bd8deadSopenharmony_ci 685bd8deadSopenharmony_ci Parameter Name Type Initial Value Valid Range 695bd8deadSopenharmony_ci ============== ==== ============= =========== 705bd8deadSopenharmony_ci UNPACK_ROW_LENGTH_EXT integer 0 [0,Infinity) 715bd8deadSopenharmony_ci UNPACK_SKIP_ROWS_EXT integer 0 [0,Infinity) 725bd8deadSopenharmony_ci UNPACK_SKIP_PIXELS_EXT integer 0 [0,Infinity) 735bd8deadSopenharmony_ci 745bd8deadSopenharmony_ci Modifications to 3.6.2 Transfer of Pixel Rectangles, in the Unpacking 755bd8deadSopenharmony_ci section: 765bd8deadSopenharmony_ci 775bd8deadSopenharmony_ci Change 785bd8deadSopenharmony_ci 795bd8deadSopenharmony_ci "The number of groups in a row is width;" 805bd8deadSopenharmony_ci 815bd8deadSopenharmony_ci to 825bd8deadSopenharmony_ci 835bd8deadSopenharmony_ci "If the value of UNPACK_ROW_LENGTH_EXT is not positive, then the 845bd8deadSopenharmony_ci number of groups in a row is <width>; otherwise the number of 855bd8deadSopenharmony_ci groups is UNPACK_ROW_LENGTH_EXT." 865bd8deadSopenharmony_ci 875bd8deadSopenharmony_ci After the sentence 885bd8deadSopenharmony_ci 895bd8deadSopenharmony_ci "If the number of bits per element is not 1, 2, 4 or 8 times 905bd8deadSopenharmony_ci the number of bits in a GL ubyte, then k = nl for all values 915bd8deadSopenharmony_ci of a." 925bd8deadSopenharmony_ci 935bd8deadSopenharmony_ci insert: 945bd8deadSopenharmony_ci 955bd8deadSopenharmony_ci "There is a mechanism for selecting a sub-rectangle of groups 965bd8deadSopenharmony_ci from a larger containing rectangle. This mechanism relies on 975bd8deadSopenharmony_ci three integer parameters: UNPACK_ROW_LENGTH_EXT, UNPACK_SKIP_ROWS_EXT, 985bd8deadSopenharmony_ci and UNPACK_SKIP_PIXELS_EXT. Before obtaining the first group from 995bd8deadSopenharmony_ci memory, the pointer supplied to TexImage2D is effectively 1005bd8deadSopenharmony_ci advanced by (UNPACK_SKIP_PIXELS_EXT)n + (UNPACK_SKIP_ROWS_EXT)k 1015bd8deadSopenharmony_ci elements. Then <width> groups are obtained from contiguous 1025bd8deadSopenharmony_ci elements in memory (without advancing the pointer), after 1035bd8deadSopenharmony_ci which the pointer is advanced by k elements. <height> sets of 1045bd8deadSopenharmony_ci <width> groups of values are obtained this way. See figure 1055bd8deadSopenharmony_ci 3.6." 1065bd8deadSopenharmony_ci 1075bd8deadSopenharmony_ci Before Table 3.5 Packed pixel formats, insert 1085bd8deadSopenharmony_ci 1095bd8deadSopenharmony_ci Figure 3.8 from the OpenGL 2.0 specification (a visual 1105bd8deadSopenharmony_ci description of UNPACK_ROW_LENGTH_EXT, UNPACK_SKIP_ROWS_EXT, and 1115bd8deadSopenharmony_ci UNPACK_SKIP_PIXELS_EXT) 1125bd8deadSopenharmony_ci 1135bd8deadSopenharmony_ciErrors 1145bd8deadSopenharmony_ci 1155bd8deadSopenharmony_ci None 1165bd8deadSopenharmony_ci 1175bd8deadSopenharmony_ciNew State 1185bd8deadSopenharmony_ci 1195bd8deadSopenharmony_ci Modifications to Table 6.12 Pixels in section 6.2 State Tables: 1205bd8deadSopenharmony_ci 1215bd8deadSopenharmony_ci Get Value Type Get Cmnd Initial Description Sec. 1225bd8deadSopenharmony_ci Value 1235bd8deadSopenharmony_ci ==================== ==== =========== ======= =============================== ===== 1245bd8deadSopenharmony_ci UNPACK_ROW_LENGTH_EXT Z+ GetIntegerv 0 Value of UNPACK_ROW_LENGTH_EXT 3.6.1 1255bd8deadSopenharmony_ci UNPACK_SKIP_ROWS_EXT Z+ GetIntegerv 0 Value of UNPACK_SKIP_ROWS_EXT 3.6.1 1265bd8deadSopenharmony_ci UNPACK_SKIP_PIXELS_EXT Z+ GetIntegerv 0 Value of UNPACK_SKIP_PIXELS_EXT 3.6.1 1275bd8deadSopenharmony_ci 1285bd8deadSopenharmony_ciIssues 1295bd8deadSopenharmony_ci 1305bd8deadSopenharmony_ci 1. Can't this be done with repeated calls to 1315bd8deadSopenharmony_ci TexSubImage2D/TexSubImage3D? 1325bd8deadSopenharmony_ci 1335bd8deadSopenharmony_ci Yes, it is possible to unpack pixels from a sub-rectangle in 1345bd8deadSopenharmony_ci host memory by by calling these functions for one line at a 1355bd8deadSopenharmony_ci time, but this could add unnecessary burden on the CPU system. 1365bd8deadSopenharmony_ci Specifying GL_UNPACK_ROW_LENGTH_EXT makes it possible to unpack 1375bd8deadSopenharmony_ci sub-rectangles of pixels with lower overhead. 1385bd8deadSopenharmony_ci 1395bd8deadSopenharmony_ci 2. Should the corresponding PACK enums be added? 1405bd8deadSopenharmony_ci 1415bd8deadSopenharmony_ci No, it should be done in a separate extension. There is no 1425bd8deadSopenharmony_ci dependency between the PACK enums and the UNPACK enums. 1435bd8deadSopenharmony_ci 1445bd8deadSopenharmony_ci 3. Are these UNPACK_SKIP_* tokens strictly necessary? 1455bd8deadSopenharmony_ci 1465bd8deadSopenharmony_ci No. The same functionality can be achieved by advancing the 1475bd8deadSopenharmony_ci pixel pointer to host memory appropriately before issuing an 1485bd8deadSopenharmony_ci unpacking function call. They are included here for both 1495bd8deadSopenharmony_ci completeness and for convenience. 1505bd8deadSopenharmony_ci 1515bd8deadSopenharmony_ci 4. Should the new tokens be suffixed? 1525bd8deadSopenharmony_ci 1535bd8deadSopenharmony_ci Yes. This extension was originally drafted with unsuffixed tokens 1545bd8deadSopenharmony_ci since they provide the same functionality as in core Desktop GL. 1555bd8deadSopenharmony_ci However, the policy of the ES working group is that suffixes 1565bd8deadSopenharmony_ci must be used in extensions even for functionality that is core 1575bd8deadSopenharmony_ci in Desktop GL. 1585bd8deadSopenharmony_ci 1595bd8deadSopenharmony_ciRevision History 1605bd8deadSopenharmony_ci 1615bd8deadSopenharmony_ci Rev. Date Author Changes 1625bd8deadSopenharmony_ci ---- -------- --------- ------------------------------------ 1635bd8deadSopenharmony_ci 1 03/25/11 ppipkorn First revision. 1645bd8deadSopenharmony_ci 2 02/08/13 dgkoch add suffixes to tokens 1655bd8deadSopenharmony_ci remove unnecessary column from table 6.12 edits 166