15bd8deadSopenharmony_ciName 25bd8deadSopenharmony_ci 35bd8deadSopenharmony_ci NV_packed_depth_stencil 45bd8deadSopenharmony_ci 55bd8deadSopenharmony_ciName Strings 65bd8deadSopenharmony_ci 75bd8deadSopenharmony_ci GL_NV_packed_depth_stencil 85bd8deadSopenharmony_ci 95bd8deadSopenharmony_ciContact 105bd8deadSopenharmony_ci 115bd8deadSopenharmony_ci Matt Craighead, NVIDIA Corporation (mcraighead 'at' nvidia.com) 125bd8deadSopenharmony_ci 135bd8deadSopenharmony_ciNotice 145bd8deadSopenharmony_ci 155bd8deadSopenharmony_ci Copyright NVIDIA Corporation, 2000, 2001. 165bd8deadSopenharmony_ci 175bd8deadSopenharmony_ciIP Status 185bd8deadSopenharmony_ci 195bd8deadSopenharmony_ci NVIDIA Proprietary. 205bd8deadSopenharmony_ci 215bd8deadSopenharmony_ciStatus 225bd8deadSopenharmony_ci 235bd8deadSopenharmony_ci Shipping (version 1.1) 245bd8deadSopenharmony_ci 255bd8deadSopenharmony_ciVersion 265bd8deadSopenharmony_ci 275bd8deadSopenharmony_ci NVIDIA Date: August 22, 2001 (version 1.1) 285bd8deadSopenharmony_ci 295bd8deadSopenharmony_ciNumber 305bd8deadSopenharmony_ci 315bd8deadSopenharmony_ci 226 325bd8deadSopenharmony_ci 335bd8deadSopenharmony_ciDependencies 345bd8deadSopenharmony_ci 355bd8deadSopenharmony_ci Written based on the wording of the OpenGL 1.2.1 specification. 365bd8deadSopenharmony_ci 375bd8deadSopenharmony_ci SGIX_depth_texture affects the definition of this extension. 385bd8deadSopenharmony_ci 395bd8deadSopenharmony_ciOverview 405bd8deadSopenharmony_ci 415bd8deadSopenharmony_ci Many OpenGL implementations have chosen to interleave the depth and 425bd8deadSopenharmony_ci stencil buffers into one buffer, often with 24 bits of depth 435bd8deadSopenharmony_ci precision and 8 bits of stencil data. 32 bits is more than is needed 445bd8deadSopenharmony_ci for the depth buffer much of the time; a 24-bit depth buffer, on the 455bd8deadSopenharmony_ci other hand, requires that reads and writes of depth data be unaligned 465bd8deadSopenharmony_ci with respect to power-of-two boundaries. On the other hand, 8 bits 475bd8deadSopenharmony_ci of stencil data is more than sufficient for most applications, so it 485bd8deadSopenharmony_ci is only natural to pack the two buffers into a single buffer with 495bd8deadSopenharmony_ci both depth and stencil data. OpenGL never provides direct access to 505bd8deadSopenharmony_ci the buffers, so the OpenGL implementation can provide an interface to 515bd8deadSopenharmony_ci applications where it appears the one merged buffer is composed of 525bd8deadSopenharmony_ci two logical buffers. 535bd8deadSopenharmony_ci 545bd8deadSopenharmony_ci One disadvantage of this scheme is that OpenGL lacks any means by 555bd8deadSopenharmony_ci which this packed data can be handled efficiently. For example, when 565bd8deadSopenharmony_ci an application reads from the 24-bit depth buffer, using the type 575bd8deadSopenharmony_ci GL_UNSIGNED_SHORT will lose 8 bits of data, while GL_UNSIGNED_INT has 585bd8deadSopenharmony_ci 8 too many. Both require expensive format conversion operations. A 595bd8deadSopenharmony_ci 24-bit format would be no more suitable, because it would also suffer 605bd8deadSopenharmony_ci from the unaligned memory accesses that made the standalone 24-bit 615bd8deadSopenharmony_ci depth buffer an unattractive proposition in the first place. 625bd8deadSopenharmony_ci 635bd8deadSopenharmony_ci Many applications, such as parallel rendering applications, may also 645bd8deadSopenharmony_ci wish to draw to or read back from both the depth and stencil buffers 655bd8deadSopenharmony_ci at the same time. Currently this requires two separate operations, 665bd8deadSopenharmony_ci reducing performance. Since the buffers are interleaved, drawing to 675bd8deadSopenharmony_ci or reading from both should be no more expensive than using just one; 685bd8deadSopenharmony_ci in some cases, it may even be cheaper. 695bd8deadSopenharmony_ci 705bd8deadSopenharmony_ci This extension provides a new data format, GL_DEPTH_STENCIL_NV, that 715bd8deadSopenharmony_ci can be used with the glDrawPixels, glReadPixels, and glCopyPixels 725bd8deadSopenharmony_ci commands, as well as a packed data type, GL_UNSIGNED_INT_24_8_NV, 735bd8deadSopenharmony_ci that is meant to be used with GL_DEPTH_STENCIL_NV. No other formats 745bd8deadSopenharmony_ci are supported with GL_DEPTH_STENCIL_NV. If SGIX_depth_texture is 755bd8deadSopenharmony_ci supported, GL_DEPTH_STENCIL_NV/GL_UNSIGNED_INT_24_8_NV data can also 765bd8deadSopenharmony_ci be used for textures; this provides a more efficient way to supply 775bd8deadSopenharmony_ci data for a 24-bit depth texture. 785bd8deadSopenharmony_ci 795bd8deadSopenharmony_ci GL_DEPTH_STENCIL_NV data, when passed through the pixel path, 805bd8deadSopenharmony_ci undergoes both depth and stencil operations. The depth data is 815bd8deadSopenharmony_ci scaled and biased by the current GL_DEPTH_SCALE and GL_DEPTH_BIAS, 825bd8deadSopenharmony_ci while the stencil data is shifted and offset by the current 835bd8deadSopenharmony_ci GL_INDEX_SHIFT and GL_INDEX_OFFSET. The stencil data is also put 845bd8deadSopenharmony_ci through the stencil-to-stencil pixel map. 855bd8deadSopenharmony_ci 865bd8deadSopenharmony_ci glDrawPixels of GL_DEPTH_STENCIL_NV data operates similarly to that 875bd8deadSopenharmony_ci of GL_STENCIL_INDEX data, bypassing the OpenGL fragment pipeline 885bd8deadSopenharmony_ci entirely, unlike the treatment of GL_DEPTH_COMPONENT data. The 895bd8deadSopenharmony_ci stencil and depth masks are applied, as are the pixel ownership and 905bd8deadSopenharmony_ci scissor tests, but all other operations are skipped. 915bd8deadSopenharmony_ci 925bd8deadSopenharmony_ci glReadPixels of GL_DEPTH_STENCIL_NV data reads back a rectangle from 935bd8deadSopenharmony_ci both the depth and stencil buffers. 945bd8deadSopenharmony_ci 955bd8deadSopenharmony_ci glCopyPixels of GL_DEPTH_STENCIL_NV data copies a rectangle from 965bd8deadSopenharmony_ci both the depth and stencil buffers. Like glDrawPixels, it applies 975bd8deadSopenharmony_ci both the stencil and depth masks but skips the remainder of the 985bd8deadSopenharmony_ci OpenGL fragment pipeline. 995bd8deadSopenharmony_ci 1005bd8deadSopenharmony_ci glTex[Sub]Image[1,2,3]D of GL_DEPTH_STENCIL_NV data loads depth data 1015bd8deadSopenharmony_ci into a depth texture. glGetTexImage of GL_DEPTH_STENCIL_NV data can 1025bd8deadSopenharmony_ci be used to retrieve depth data from a depth texture. 1035bd8deadSopenharmony_ci 1045bd8deadSopenharmony_ciIssues 1055bd8deadSopenharmony_ci 1065bd8deadSopenharmony_ci * Depth data has a format of GL_DEPTH_COMPONENT, and stencil data 1075bd8deadSopenharmony_ci has a format of GL_STENCIL_INDEX. So shouldn't the enumerant be 1085bd8deadSopenharmony_ci called GL_DEPTH_COMPONENT_STENCIL_INDEX_NV? 1095bd8deadSopenharmony_ci 1105bd8deadSopenharmony_ci RESOLVED: No, this is fairly clumsy. 1115bd8deadSopenharmony_ci 1125bd8deadSopenharmony_ci * Should we support CopyPixels? 1135bd8deadSopenharmony_ci 1145bd8deadSopenharmony_ci RESOLVED: Yes. Right now copying stencil data means masking off 1155bd8deadSopenharmony_ci just the stencil bits, while copying depth data has strange 1165bd8deadSopenharmony_ci unintended consequences (fragment operations) and is difficult to 1175bd8deadSopenharmony_ci implement. It is easy and useful to add CopyPixels support. 1185bd8deadSopenharmony_ci 1195bd8deadSopenharmony_ci * Should we support textures? 1205bd8deadSopenharmony_ci 1215bd8deadSopenharmony_ci RESOLVED: Yes. 24-bit depth textures have no good format without 1225bd8deadSopenharmony_ci this extension. 1235bd8deadSopenharmony_ci 1245bd8deadSopenharmony_ci * Should the depth/stencil format support other standard types, 1255bd8deadSopenharmony_ci like GL_FLOAT or GL_UNSIGNED_INT? 1265bd8deadSopenharmony_ci 1275bd8deadSopenharmony_ci RESOLVED: No, this extension is designed to be minimalist. 1285bd8deadSopenharmony_ci Supporting more types gains little because the new types will 1295bd8deadSopenharmony_ci just require data format conversions. Our goal is to match the 1305bd8deadSopenharmony_ci native format of the buffer, not add broad new classes of 1315bd8deadSopenharmony_ci functionality. 1325bd8deadSopenharmony_ci 1335bd8deadSopenharmony_ci * Should the 24/8 format be supported for other formats, such as 1345bd8deadSopenharmony_ci LUMINANCE_ALPHA? Should we support an 8/24 reversed format as 1355bd8deadSopenharmony_ci well? 1365bd8deadSopenharmony_ci 1375bd8deadSopenharmony_ci RESOLVED: No and no, this adds implementation burden and gains us 1385bd8deadSopenharmony_ci little, if anything. 1395bd8deadSopenharmony_ci 1405bd8deadSopenharmony_ci * Does anything need to be written in the spec on the topic of 1415bd8deadSopenharmony_ci using GL_DEPTH_STENCIL_NV formats for glTexImage* or 1425bd8deadSopenharmony_ci glGetTexImage? 1435bd8deadSopenharmony_ci 1445bd8deadSopenharmony_ci RESOLVED: No. Since the SGIX_depth_texture extension spec was 1455bd8deadSopenharmony_ci never actually written (the additions to Section 3 are "XXX - 1465bd8deadSopenharmony_ci lots" and a few brief notes on how it's intended to work), it's 1475bd8deadSopenharmony_ci impossible to write what would essentially be amendments to that 1485bd8deadSopenharmony_ci spec. 1495bd8deadSopenharmony_ci 1505bd8deadSopenharmony_ci However, it is worthwhile to mention here the intended behavior. 1515bd8deadSopenharmony_ci When downloading into a depth component texture, the stencil 1525bd8deadSopenharmony_ci indices are ignored, and when retrieving a depth component 1535bd8deadSopenharmony_ci texture, the stencil indices obtained from the texture are 1545bd8deadSopenharmony_ci undefined. 1555bd8deadSopenharmony_ci 1565bd8deadSopenharmony_ci * Should anything be said about performance? 1575bd8deadSopenharmony_ci 1585bd8deadSopenharmony_ci RESOLVED: No, not in the spec. However, common sense should 1595bd8deadSopenharmony_ci apply. Apps should probably check that GL_DEPTH_BITS is 24 and 1605bd8deadSopenharmony_ci that GL_STENCIL_BITS is 8 before using either the new DrawPixels 1615bd8deadSopenharmony_ci or ReadPixels formats. CopyPixels is probably safe regardless of 1625bd8deadSopenharmony_ci the size of either buffer. The 24/8 format should probably only 1635bd8deadSopenharmony_ci be used with 24-bit depth textures. 1645bd8deadSopenharmony_ci 1655bd8deadSopenharmony_ciNew Procedures and Functions 1665bd8deadSopenharmony_ci 1675bd8deadSopenharmony_ci None. 1685bd8deadSopenharmony_ci 1695bd8deadSopenharmony_ciNew Tokens 1705bd8deadSopenharmony_ci 1715bd8deadSopenharmony_ci Accepted by the <format> parameter of DrawPixels, ReadPixels, 1725bd8deadSopenharmony_ci TexImage1D, TexImage2D, TexImage3D, TexSubImage1D, TexSubImage2D, 1735bd8deadSopenharmony_ci TexSubImage3D, and GetTexImage, and by the <type> parameter of 1745bd8deadSopenharmony_ci CopyPixels: 1755bd8deadSopenharmony_ci 1765bd8deadSopenharmony_ci DEPTH_STENCIL_NV 0x84F9 1775bd8deadSopenharmony_ci 1785bd8deadSopenharmony_ci Accepted by the <type> parameter of DrawPixels, ReadPixels, 1795bd8deadSopenharmony_ci TexImage1D, TexImage2D, TexImage3D, TexSubImage1D, TexSubImage2D, 1805bd8deadSopenharmony_ci TexSubImage3D, and GetTexImage: 1815bd8deadSopenharmony_ci 1825bd8deadSopenharmony_ci UNSIGNED_INT_24_8_NV 0x84FA 1835bd8deadSopenharmony_ci 1845bd8deadSopenharmony_ciAdditions to Chapter 2 of the OpenGL 1.2.1 Specification (OpenGL Operation) 1855bd8deadSopenharmony_ci 1865bd8deadSopenharmony_ci None. 1875bd8deadSopenharmony_ci 1885bd8deadSopenharmony_ciAdditions to Chapter 3 of the OpenGL 1.2.1 Specification (Rasterization) 1895bd8deadSopenharmony_ci 1905bd8deadSopenharmony_ci Update the first paragraph on page 90 to say: 1915bd8deadSopenharmony_ci 1925bd8deadSopenharmony_ci "... If the GL is in color index mode and <format> is not one of 1935bd8deadSopenharmony_ci COLOR_INDEX, STENCIL_INDEX, DEPTH_COMPONENT, or DEPTH_STENCIL_NV, 1945bd8deadSopenharmony_ci then the error INVALID_OPERATION occurs. If <type> is BITMAP and 1955bd8deadSopenharmony_ci <format> is not COLOR_INDEX or STENCIL_INDEX then the error 1965bd8deadSopenharmony_ci INVALID_ENUM occurs. If <format> is DEPTH_STENCIL_NV and <type> is 1975bd8deadSopenharmony_ci not UNSIGNED_INT_24_8_NV then the error INVALID_ENUM occurs. Some 1985bd8deadSopenharmony_ci additional constraints on the combinations of <format> and <type> 1995bd8deadSopenharmony_ci values that are accepted is discussed below." 2005bd8deadSopenharmony_ci 2015bd8deadSopenharmony_ci Add a row to Table 3.5 (page 91): 2025bd8deadSopenharmony_ci 2035bd8deadSopenharmony_ci type Parameter GL Type Special 2045bd8deadSopenharmony_ci ------------------------------------------------ 2055bd8deadSopenharmony_ci ... ... ... 2065bd8deadSopenharmony_ci UNSIGNED_INT_2_10_10_10_REV uint Yes 2075bd8deadSopenharmony_ci UNSIGNED_INT_24_8_NV uint Yes 2085bd8deadSopenharmony_ci 2095bd8deadSopenharmony_ci Add a row to Table 3.6 (page 92): 2105bd8deadSopenharmony_ci 2115bd8deadSopenharmony_ci Format Name Element Meaning and Order Target Buffer 2125bd8deadSopenharmony_ci ------------------------------------------------------------------ 2135bd8deadSopenharmony_ci ... ... ... 2145bd8deadSopenharmony_ci DEPTH_COMPONENT Depth Depth 2155bd8deadSopenharmony_ci DEPTH_STENCIL_NV Depth and Stencil Index Depth and Stencil 2165bd8deadSopenharmony_ci ... ... ... 2175bd8deadSopenharmony_ci 2185bd8deadSopenharmony_ci Add a row to Table 3.8 (page 94): 2195bd8deadSopenharmony_ci 2205bd8deadSopenharmony_ci type Parameter GL Type Components Pixel Formats 2215bd8deadSopenharmony_ci ------------------------------------------------------------------ 2225bd8deadSopenharmony_ci ... ... ... ... 2235bd8deadSopenharmony_ci UNSIGNED_INT_2_10_10_10_REV uint 4 RGBA,BGRA 2245bd8deadSopenharmony_ci UNSIGNED_INT_24_8_NV uint 2 DEPTH_STENCIL_NV 2255bd8deadSopenharmony_ci 2265bd8deadSopenharmony_ci Update the last paragraph on page 93 to say: 2275bd8deadSopenharmony_ci 2285bd8deadSopenharmony_ci "Calling DrawPixels with a <type> of UNSIGNED_BYTE_3_3_2, ..., 2295bd8deadSopenharmony_ci UNSIGNED_INT_2_10_10_10_REV, or UNSIGNED_INT_24_8_NV is a special 2305bd8deadSopenharmony_ci case in which all the components of each group are packed into a 2315bd8deadSopenharmony_ci single unsigned byte, unsigned short, or unsigned int, depending on 2325bd8deadSopenharmony_ci the type." 2335bd8deadSopenharmony_ci 2345bd8deadSopenharmony_ci Add the following diagram to Table 3.11 (page 97): 2355bd8deadSopenharmony_ci 2365bd8deadSopenharmony_ci UNSIGNED_INT_24_8_NV 2375bd8deadSopenharmony_ci 2385bd8deadSopenharmony_ci 31 30 29 28 27 26 ... 12 11 10 9 8 7 6 5 4 3 2 1 0 2395bd8deadSopenharmony_ci +----------------------------------+---------------+ 2405bd8deadSopenharmony_ci | 1st Component | 2nd Component | 2415bd8deadSopenharmony_ci +----------------------------------+---------------+ 2425bd8deadSopenharmony_ci 2435bd8deadSopenharmony_ci Add a row to Table 3.12 (page 98): 2445bd8deadSopenharmony_ci 2455bd8deadSopenharmony_ci Format | 1st 2nd 3rd 4th 2465bd8deadSopenharmony_ci -----------------+------------------------------- 2475bd8deadSopenharmony_ci ... | ... ... ... ... 2485bd8deadSopenharmony_ci BGRA | blue green red alpha 2495bd8deadSopenharmony_ci DEPTH_STENCIL_NV | depth stencil N/A N/A 2505bd8deadSopenharmony_ci 2515bd8deadSopenharmony_ci Add the following paragraph to the end of the section "Conversion to 2525bd8deadSopenharmony_ci floating-point" (page 99): 2535bd8deadSopenharmony_ci 2545bd8deadSopenharmony_ci "For groups of components that contain both standard components and 2555bd8deadSopenharmony_ci index elements, such as DEPTH_STENCIL_NV, the index elements are not 2565bd8deadSopenharmony_ci converted." 2575bd8deadSopenharmony_ci 2585bd8deadSopenharmony_ci Update the last paragraph in the section "Conversion to Fragments" 2595bd8deadSopenharmony_ci (page 100) to say: 2605bd8deadSopenharmony_ci 2615bd8deadSopenharmony_ci "... Groups arising from DrawPixels with a <format> of STENCIL_INDEX 2625bd8deadSopenharmony_ci or DEPTH_STENCIL_NV are treated specially and are described in 2635bd8deadSopenharmony_ci section 4.3.1." 2645bd8deadSopenharmony_ci 2655bd8deadSopenharmony_ci Update the first paragraph of section 3.6.5 "Pixel Transfer 2665bd8deadSopenharmony_ci Operations" (pages 100-101) to say: 2675bd8deadSopenharmony_ci 2685bd8deadSopenharmony_ci "The GL defines five kinds of pixel groups: 2695bd8deadSopenharmony_ci 2705bd8deadSopenharmony_ci 1. RGBA component: Each group comprises four color components: 2715bd8deadSopenharmony_ci red, green, blue, and alpha. 2725bd8deadSopenharmony_ci 2. Depth component: Each group comprises a single depth component. 2735bd8deadSopenharmony_ci 3. Color index: Each group comprises a single color index. 2745bd8deadSopenharmony_ci 4. Stencil index: Each group comprises a single stencil index. 2755bd8deadSopenharmony_ci 5. Depth/stencil: Each group comprises a depth component and a 2765bd8deadSopenharmony_ci stencil index." 2775bd8deadSopenharmony_ci 2785bd8deadSopenharmony_ci Update the first paragraph in the section "Arithmetic on Components" 2795bd8deadSopenharmony_ci (page 101) to say: 2805bd8deadSopenharmony_ci 2815bd8deadSopenharmony_ci "This step applies only to RGBA component and depth component groups 2825bd8deadSopenharmony_ci and the depth components in depth/stencil groups. ..." 2835bd8deadSopenharmony_ci 2845bd8deadSopenharmony_ci Update the first paragraph in the section "Arithmetic on Indices" 2855bd8deadSopenharmony_ci (page 101) to say: 2865bd8deadSopenharmony_ci 2875bd8deadSopenharmony_ci "This step applies only to color index and stencil index groups and 2885bd8deadSopenharmony_ci the stencil indices in depth/stencil groups. ..." 2895bd8deadSopenharmony_ci 2905bd8deadSopenharmony_ci Update the first paragraph in the section "Stencil Index Lookup" 2915bd8deadSopenharmony_ci (page 102) to say: 2925bd8deadSopenharmony_ci 2935bd8deadSopenharmony_ci "This step applies only to stencil index groups and the stencil 2945bd8deadSopenharmony_ci indices in depth/stencil groups. ..." 2955bd8deadSopenharmony_ci 2965bd8deadSopenharmony_ciAdditions to Chapter 4 of the OpenGL 1.2.1 Specification (Per-Fragment 2975bd8deadSopenharmony_ciOperations and the Frame Buffer) 2985bd8deadSopenharmony_ci 2995bd8deadSopenharmony_ci Replace section 4.3.1 "Writing to the Stencil Buffer" (page 156) with 3005bd8deadSopenharmony_ci the following: 3015bd8deadSopenharmony_ci 3025bd8deadSopenharmony_ci "4.3.1 Writing to the Stencil Buffer or to the Depth and Stencil 3035bd8deadSopenharmony_ci Buffers 3045bd8deadSopenharmony_ci 3055bd8deadSopenharmony_ci The operation of DrawPixels was described in section 3.6.4, except if 3065bd8deadSopenharmony_ci the <format> argument was STENCIL_INDEX or DEPTH_STENCIL_NV. In this 3075bd8deadSopenharmony_ci case, all operations described for DrawPixels take place, but window 3085bd8deadSopenharmony_ci (x,y) coordinates, each with the corresponding stencil index or depth 3095bd8deadSopenharmony_ci value and stencil index, are produced in lieu of fragments. Each 3105bd8deadSopenharmony_ci coordinate-data pair is sent directly to the per-fragment operations, 3115bd8deadSopenharmony_ci bypassing the texture, fog, and antialiasing application stages of 3125bd8deadSopenharmony_ci rasterization. Each pair is then treated as a fragment for purposes 3135bd8deadSopenharmony_ci of the pixel ownership and scissor tests; all other per-fragment 3145bd8deadSopenharmony_ci operations are bypassed. Finally, each stencil index is written to 3155bd8deadSopenharmony_ci its indicated location in the framebuffer, subject to the current 3165bd8deadSopenharmony_ci setting of StencilMask, and if a depth component is present, if the 3175bd8deadSopenharmony_ci setting of DepthMask is not FALSE, it is also written to the 3185bd8deadSopenharmony_ci framebuffer; the setting of DepthTest is ignored. 3195bd8deadSopenharmony_ci 3205bd8deadSopenharmony_ci The error INVALID_OPERATION results if there is no stencil buffer, or 3215bd8deadSopenharmony_ci if the <format> argument was DEPTH_STENCIL_NV, if there is no depth 3225bd8deadSopenharmony_ci buffer." 3235bd8deadSopenharmony_ci 3245bd8deadSopenharmony_ci Add the following paragraph after the second paragraph of the 3255bd8deadSopenharmony_ci section "Obtaining Pixels from the Framebuffer" (page 158): 3265bd8deadSopenharmony_ci 3275bd8deadSopenharmony_ci "If the <format> is DEPTH_STENCIL_NV, then values are taken from both 3285bd8deadSopenharmony_ci the depth buffer and the stencil buffer. If there is no depth buffer 3295bd8deadSopenharmony_ci or if there is no stencil buffer, the error INVALID_OPERATION 3305bd8deadSopenharmony_ci occurs. If the <type> parameter is not UNSIGNED_INT_24_8_NV, the 3315bd8deadSopenharmony_ci error INVALID_ENUM occurs." 3325bd8deadSopenharmony_ci 3335bd8deadSopenharmony_ci Update the third paragraph on page 159 to say: 3345bd8deadSopenharmony_ci 3355bd8deadSopenharmony_ci "If the GL is in RGBA mode, and <format> is one of RED, GREEN, BLUE, 3365bd8deadSopenharmony_ci ALPHA, RGB, RGBA, BGR, BGRA, LUMINANCE, or LUMINANCE_ALPHA, then red, 3375bd8deadSopenharmony_ci green, blue, and alpha values are obtained from the framebuffer 3385bd8deadSopenharmony_ci 3395bd8deadSopenharmony_ci Update the first sentence of the section "Conversion of RGBA values" 3405bd8deadSopenharmony_ci (page 159) to say: 3415bd8deadSopenharmony_ci 3425bd8deadSopenharmony_ci "This step applies only if the GL is in RGBA mode, and then only if 3435bd8deadSopenharmony_ci <format> is neither STENCIL_INDEX, DEPTH_COMPONENT, nor 3445bd8deadSopenharmony_ci DEPTH_STENCIL_NV." 3455bd8deadSopenharmony_ci 3465bd8deadSopenharmony_ci Update the section "Conversion of Depth values" (page 159) to say: 3475bd8deadSopenharmony_ci 3485bd8deadSopenharmony_ci "This step applies only if <format> is DEPTH_COMPONENT or 3495bd8deadSopenharmony_ci DEPTH_STENCIL_NV. Each element taken from the depth buffer is taken 3505bd8deadSopenharmony_ci to be a fixed-point value in [0,1] with m bits, where m is the number 3515bd8deadSopenharmony_ci of bits in the depth buffer (see section 2.10.1)." 3525bd8deadSopenharmony_ci 3535bd8deadSopenharmony_ci Add a row to Table 4.6 (page 160): 3545bd8deadSopenharmony_ci 3555bd8deadSopenharmony_ci type Parameter Index Mask 3565bd8deadSopenharmony_ci --------------------------------- 3575bd8deadSopenharmony_ci ... ... 3585bd8deadSopenharmony_ci INT 2^31-1 3595bd8deadSopenharmony_ci UNSIGNED_INT_24_8_NV 2^8-1 3605bd8deadSopenharmony_ci 3615bd8deadSopenharmony_ci Add the following paragraph to the end of the section "Final 3625bd8deadSopenharmony_ci Conversion" (page 160): 3635bd8deadSopenharmony_ci 3645bd8deadSopenharmony_ci "For a depth/stencil pair, first the depth component is clamped to 3655bd8deadSopenharmony_ci [0,1]. Then the appropriate conversion formula from Table 4.7 is 3665bd8deadSopenharmony_ci applied to the depth component, while the index is masked by the 3675bd8deadSopenharmony_ci value given in Table 4.6 or converted to a GL float data type if the 3685bd8deadSopenharmony_ci <type> is FLOAT." 3695bd8deadSopenharmony_ci 3705bd8deadSopenharmony_ci Add a row to Table 4.7 (page 161): 3715bd8deadSopenharmony_ci 3725bd8deadSopenharmony_ci type Parameter GL Type Component Conversion ... 3735bd8deadSopenharmony_ci ------------------------------------------------------------------ 3745bd8deadSopenharmony_ci ... ... ... 3755bd8deadSopenharmony_ci UNSIGNED_INT_2_10_10_10_REV uint c = (2^N - 1)f 3765bd8deadSopenharmony_ci UNSIGNED_INT_24_8_NV uint c = (2^N - 1)f (depth only) 3775bd8deadSopenharmony_ci 3785bd8deadSopenharmony_ci Update the second and third paragraphs of section 4.3.3 (page 162) to 3795bd8deadSopenharmony_ci say: 3805bd8deadSopenharmony_ci 3815bd8deadSopenharmony_ci "<type> is a symbolic constant that must be one of COLOR, STENCIL, 3825bd8deadSopenharmony_ci DEPTH, or DEPTH_STENCIL_NV, indicating that the values to be 3835bd8deadSopenharmony_ci transfered are colors, stencil values, depth values, or depth/stencil 3845bd8deadSopenharmony_ci pairs, respectively. The first four arguments have the same 3855bd8deadSopenharmony_ci interpretation as the corresponding arguments to ReadPixels. 3865bd8deadSopenharmony_ci 3875bd8deadSopenharmony_ci Values are obtained from the framebuffer, converted (if appropriate), 3885bd8deadSopenharmony_ci then subjected to the pixel transfer operations described in section 3895bd8deadSopenharmony_ci 3.6.5, just as if ReadPixels were called with the corresponding 3905bd8deadSopenharmony_ci arguments. If the <type> is STENCIL, DEPTH, or DEPTH_STENCIL_NV, 3915bd8deadSopenharmony_ci then it is as if the <format> for ReadPixels were STENCIL_INDEX, 3925bd8deadSopenharmony_ci DEPTH_COMPONENT, or DEPTH_STENCIL_NV, respectively. If the <type> is 3935bd8deadSopenharmony_ci COLOR, then if the GL is in RGBA mode, it is as if the <format> were 3945bd8deadSopenharmony_ci RGBA, while if the GL is in color index mode, it is as if the 3955bd8deadSopenharmony_ci <format> were COLOR_INDEX." 3965bd8deadSopenharmony_ci 3975bd8deadSopenharmony_ciAdditions to Chapter 5 of the OpenGL 1.2.1 Specification (Special Functions) 3985bd8deadSopenharmony_ci 3995bd8deadSopenharmony_ci None. 4005bd8deadSopenharmony_ci 4015bd8deadSopenharmony_ciAdditions to Chapter 6 of the OpenGL 1.2.1 Specification (State and 4025bd8deadSopenharmony_ciState Requests) 4035bd8deadSopenharmony_ci 4045bd8deadSopenharmony_ci None. 4055bd8deadSopenharmony_ci 4065bd8deadSopenharmony_ciGLX Protocol 4075bd8deadSopenharmony_ci 4085bd8deadSopenharmony_ci None. 4095bd8deadSopenharmony_ci 4105bd8deadSopenharmony_ciErrors 4115bd8deadSopenharmony_ci 4125bd8deadSopenharmony_ci The error INVALID_ENUM is generated if DrawPixels or ReadPixels is 4135bd8deadSopenharmony_ci called where format is DEPTH_STENCIL_NV and type is not 4145bd8deadSopenharmony_ci UNSIGNED_INT_24_8_NV. 4155bd8deadSopenharmony_ci 4165bd8deadSopenharmony_ci The error INVALID_OPERATION is generated if DrawPixels or ReadPixels 4175bd8deadSopenharmony_ci is called where type is UNSIGNED_INT_24_8_NV and format is not 4185bd8deadSopenharmony_ci DEPTH_STENCIL_NV. 4195bd8deadSopenharmony_ci 4205bd8deadSopenharmony_ci The error INVALID_OPERATION is generated if DrawPixels or ReadPixels 4215bd8deadSopenharmony_ci is called where format is DEPTH_STENCIL_NV and there is not both a 4225bd8deadSopenharmony_ci depth buffer and a stencil buffer. 4235bd8deadSopenharmony_ci 4245bd8deadSopenharmony_ci The error INVALID_OPERATION is generated if CopyPixels is called 4255bd8deadSopenharmony_ci where type is DEPTH_STENCIL_NV and there is not both a depth buffer 4265bd8deadSopenharmony_ci and a stencil buffer. 4275bd8deadSopenharmony_ci 4285bd8deadSopenharmony_ciNew State 4295bd8deadSopenharmony_ci 4305bd8deadSopenharmony_ci None. 4315bd8deadSopenharmony_ci 4325bd8deadSopenharmony_ciRevision History 4335bd8deadSopenharmony_ci 4345bd8deadSopenharmony_ci August 22, 2001 - Fixed a small typo in the updates to Section 4.3.3. 435