15bd8deadSopenharmony_ciName 25bd8deadSopenharmony_ci 35bd8deadSopenharmony_ci EXT_render_snorm 45bd8deadSopenharmony_ci 55bd8deadSopenharmony_ciName Strings 65bd8deadSopenharmony_ci 75bd8deadSopenharmony_ci GL_EXT_render_snorm 85bd8deadSopenharmony_ci 95bd8deadSopenharmony_ciContributors 105bd8deadSopenharmony_ci 115bd8deadSopenharmony_ci Daniel Koch, NVIDIA 125bd8deadSopenharmony_ci Jan-Harald Fredriksen, ARM 135bd8deadSopenharmony_ci Mathias Heyer, NVIDIA 145bd8deadSopenharmony_ci 155bd8deadSopenharmony_ciContact 165bd8deadSopenharmony_ci 175bd8deadSopenharmony_ci Mathias Heyer, NVIDIA (mheyer [at] nvidia.com) 185bd8deadSopenharmony_ci 195bd8deadSopenharmony_ciStatus 205bd8deadSopenharmony_ci 215bd8deadSopenharmony_ci Complete 225bd8deadSopenharmony_ci 235bd8deadSopenharmony_ciVersion 245bd8deadSopenharmony_ci 255bd8deadSopenharmony_ci Last Modified Date: 2014-10-24 265bd8deadSopenharmony_ci Revision: 4 275bd8deadSopenharmony_ci 285bd8deadSopenharmony_ciNumber 295bd8deadSopenharmony_ci 305bd8deadSopenharmony_ci OpenGL ES Extension #206 315bd8deadSopenharmony_ci 325bd8deadSopenharmony_ciDependencies 335bd8deadSopenharmony_ci 345bd8deadSopenharmony_ci OpenGL ES 3.1 is required. 355bd8deadSopenharmony_ci 365bd8deadSopenharmony_ci This extension is written against the OpenGL ES 3.1 (June 4, 2014) 375bd8deadSopenharmony_ci specification. 385bd8deadSopenharmony_ci 395bd8deadSopenharmony_ci This extension interacts with EXT_texture_norm16. 405bd8deadSopenharmony_ci 415bd8deadSopenharmony_ciOverview 425bd8deadSopenharmony_ci 435bd8deadSopenharmony_ci OpenGL ES 3.1 supports a variety of signed normalized texture and 445bd8deadSopenharmony_ci renderbuffer formats which are not color-renderable. 455bd8deadSopenharmony_ci 465bd8deadSopenharmony_ci This extension enables signed normalized texture and renderbuffer 475bd8deadSopenharmony_ci formats to be color-renderable. 485bd8deadSopenharmony_ci 495bd8deadSopenharmony_ciNew Procedures and Functions 505bd8deadSopenharmony_ci 515bd8deadSopenharmony_ci None 525bd8deadSopenharmony_ci 535bd8deadSopenharmony_ciNew Tokens 545bd8deadSopenharmony_ci 555bd8deadSopenharmony_ci Accepted by the <type> parameter of ReadPixels 565bd8deadSopenharmony_ci 575bd8deadSopenharmony_ci BYTE 0x1400 // core OpenGL ES 3.1 585bd8deadSopenharmony_ci SHORT 0x1402 // core OpenGL ES 3.1 595bd8deadSopenharmony_ci 605bd8deadSopenharmony_ci Accepted by the <internalFormat> parameter of RenderbufferStorage 615bd8deadSopenharmony_ci and RenderbufferStorageMultisample: 625bd8deadSopenharmony_ci 635bd8deadSopenharmony_ci R8_SNORM 0x8F94 // core OpenGL ES 3.1 645bd8deadSopenharmony_ci RG8_SNORM 0x8F95 // core OpenGL ES 3.1 655bd8deadSopenharmony_ci RGBA8_SNORM 0x8F97 // core OpenGL ES 3.1 665bd8deadSopenharmony_ci R16_SNORM_EXT 0x8F98 // EXT_texture_norm16 675bd8deadSopenharmony_ci RG16_SNORM_EXT 0x8F99 // EXT_texture_norm16 685bd8deadSopenharmony_ci RGBA16_SNORM_EXT 0x8F9B // EXT_texture_norm16 695bd8deadSopenharmony_ci 705bd8deadSopenharmony_ciAdditions to Chapter 8 of the OpenGL ES 3.1 Specification 715bd8deadSopenharmony_ci(Textures and Samplers) 725bd8deadSopenharmony_ci 735bd8deadSopenharmony_ci Changes to Section 8.6 "Alternate Texture ImageSpecification Commands": 745bd8deadSopenharmony_ci 755bd8deadSopenharmony_ci Modify INVALID_OPERATION errors section on CopyTexImage2D, 765bd8deadSopenharmony_ci first bullet point from: 775bd8deadSopenharmony_ci 785bd8deadSopenharmony_ci "if signed integer, unsigned integer, or fixed-point RGBA data is 795bd8deadSopenharmony_ci required and the format of the current color buffer does not match 805bd8deadSopenharmony_ci the required format." 815bd8deadSopenharmony_ci 825bd8deadSopenharmony_ci to 835bd8deadSopenharmony_ci 845bd8deadSopenharmony_ci "if FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE for the framebuffer 855bd8deadSopenharmony_ci attachment corresponding to the read buffer does not match 865bd8deadSopenharmony_ci the component type of the requested <internalformat>." 875bd8deadSopenharmony_ci 885bd8deadSopenharmony_ci 895bd8deadSopenharmony_ci Change Table 8.13 "Correspondence of sized internal formats to base 905bd8deadSopenharmony_ci internal formats,...": 915bd8deadSopenharmony_ci 925bd8deadSopenharmony_ci Sized Base Bits/component CR TF Req. Req. 935bd8deadSopenharmony_ci Internal Internal S are shared bits rend. tex. 945bd8deadSopenharmony_ci Format Format R G B A S 955bd8deadSopenharmony_ci ------------ ----------- ---- ---- ---- --- ---- --- --- ---- --- 965bd8deadSopenharmony_ci R8_SNORM RED s8 X X X X 975bd8deadSopenharmony_ci RG8_SNORM RG s8 s8 X X X X 985bd8deadSopenharmony_ci RGBA8_SNORM RGBA s8 s8 s8 s8 X X X X 995bd8deadSopenharmony_ci R16_SNORM_EXT RED s16 X X X X 1005bd8deadSopenharmony_ci RG16_SNORM_EXT RG s16 s16 X X X X 1015bd8deadSopenharmony_ci RGBA16_SNORM_EXT RGBA s16 s16 s16 s16 X X X X 1025bd8deadSopenharmony_ci 1035bd8deadSopenharmony_ci Change Table 8.15: "ReadPixels format and type used during CopyTex*." 1045bd8deadSopenharmony_ci 1055bd8deadSopenharmony_ci Replace the first row with the following: 1065bd8deadSopenharmony_ci 1075bd8deadSopenharmony_ci Read Buffer Format format type 1085bd8deadSopenharmony_ci ------------------------------------ ------ ------------- 1095bd8deadSopenharmony_ci 8bit Unsigned Normalized Fixed-point RGBA UNSIGNED_BYTE 1105bd8deadSopenharmony_ci 8bit Signed Normalized Fixed-point RGBA BYTE 1115bd8deadSopenharmony_ci 16bit Signed Normalized Fixed-point RGBA SHORT 1125bd8deadSopenharmony_ci 1135bd8deadSopenharmony_ci 1145bd8deadSopenharmony_ciAdditions to Chapter 15 of the OpenGL ES 3.1 Specification 1155bd8deadSopenharmony_ci(Writing Fragments and Samples to the Framebuffer) 1165bd8deadSopenharmony_ci 1175bd8deadSopenharmony_ci Changes to Section 15.1.7 "Blending": 1185bd8deadSopenharmony_ci 1195bd8deadSopenharmony_ci Replace 1205bd8deadSopenharmony_ci 1215bd8deadSopenharmony_ci "The components of the source and destination values and blend 1225bd8deadSopenharmony_ci factors are clamped to [0, 1] prior to evaluating the blend 1235bd8deadSopenharmony_ci equation." 1245bd8deadSopenharmony_ci 1255bd8deadSopenharmony_ci with 1265bd8deadSopenharmony_ci 1275bd8deadSopenharmony_ci "If the color buffer is fixed-point, the components of the 1285bd8deadSopenharmony_ci source and destination values and blend factors are each clamped 1295bd8deadSopenharmony_ci to [0, 1] or [-1, 1] respectively for an unsigned normalized or 1305bd8deadSopenharmony_ci signed normalized color buffer prior to evaluating the blend 1315bd8deadSopenharmony_ci equation." 1325bd8deadSopenharmony_ci 1335bd8deadSopenharmony_ci Changes to Section 15.1.7.1 "Blend Equation": 1345bd8deadSopenharmony_ci 1355bd8deadSopenharmony_ci Replace 1365bd8deadSopenharmony_ci 1375bd8deadSopenharmony_ci "Unsigned normalized fixed-point destination (framebuffer) 1385bd8deadSopenharmony_ci components are represented as described in section 2.3.4." 1395bd8deadSopenharmony_ci 1405bd8deadSopenharmony_ci with 1415bd8deadSopenharmony_ci 1425bd8deadSopenharmony_ci "Normalized fixed-point destination (framebuffer) components are 1435bd8deadSopenharmony_ci represented as described in section 2.3.4." 1445bd8deadSopenharmony_ci 1455bd8deadSopenharmony_ci Replace 1465bd8deadSopenharmony_ci 1475bd8deadSopenharmony_ci "Prior to blending, unsigned normalized fixed-point color 1485bd8deadSopenharmony_ci components undergo an implied conversion to floating-point using 1495bd8deadSopenharmony_ci equation 2.1." 1505bd8deadSopenharmony_ci 1515bd8deadSopenharmony_ci with 1525bd8deadSopenharmony_ci 1535bd8deadSopenharmony_ci "Prior to blending, unsigned and signed normalized fixed-point 1545bd8deadSopenharmony_ci color components undergo an implied conversion to floating-point 1555bd8deadSopenharmony_ci using equation 2.1 and 2.2, respectively." 1565bd8deadSopenharmony_ci 1575bd8deadSopenharmony_ci Changes to Section 15.1.7.3 "Blend Color" 1585bd8deadSopenharmony_ci 1595bd8deadSopenharmony_ci Replace 1605bd8deadSopenharmony_ci 1615bd8deadSopenharmony_ci "If destination framebuffer components use an unsigned 1625bd8deadSopenharmony_ci normalized fixed-point representation, the constant color 1635bd8deadSopenharmony_ci components are clamped to the range [0, 1] when computing blend 1645bd8deadSopenharmony_ci factors." 1655bd8deadSopenharmony_ci 1665bd8deadSopenharmony_ci with 1675bd8deadSopenharmony_ci 1685bd8deadSopenharmony_ci "If destination framebuffer components use an unsigned or 1695bd8deadSopenharmony_ci signed normalized fixed-point representation, the constant color 1705bd8deadSopenharmony_ci components are clamped to the range [0, 1] or [-1, 1], 1715bd8deadSopenharmony_ci respectively, when computing blend factors." 1725bd8deadSopenharmony_ci 1735bd8deadSopenharmony_ci Changes to Section 15.2.3 "Clearing the Buffers": 1745bd8deadSopenharmony_ci 1755bd8deadSopenharmony_ci Replace 1765bd8deadSopenharmony_ci 1775bd8deadSopenharmony_ci "Unsigned normalized fixed-point RGBA color buffers are cleared 1785bd8deadSopenharmony_ci to color values derived by clamping each component of the clear 1795bd8deadSopenharmony_ci color to the range [0, 1], then converting the (possibly sRGB 1805bd8deadSopenharmony_ci converted and/or dithered) color to fixed-point using equations 1815bd8deadSopenharmony_ci 2.3 or 2.4, respectively." 1825bd8deadSopenharmony_ci 1835bd8deadSopenharmony_ci with 1845bd8deadSopenharmony_ci 1855bd8deadSopenharmony_ci "Unsigned normalized fixed-point or signed normalized 1865bd8deadSopenharmony_ci fixed-point RGBA color buffers are cleared to color values 1875bd8deadSopenharmony_ci derived by clamping each component of the clear color to the 1885bd8deadSopenharmony_ci range [0, 1] or [-1, 1] respectively, then converting the 1895bd8deadSopenharmony_ci (possibly sRGB converted and/or dithered) color to fixed-point 1905bd8deadSopenharmony_ci using equations 2.3 or 2.4, respectively." 1915bd8deadSopenharmony_ci 1925bd8deadSopenharmony_ci Add to the second paragraph of Section 16.1.2 "ReadPixels": 1935bd8deadSopenharmony_ci 1945bd8deadSopenharmony_ci "For 8bit signed normalized fixed-point rendering surfaces, the 1955bd8deadSopenharmony_ci combination format RGBA and type BYTE is accepted. For a 16bit 1965bd8deadSopenharmony_ci signed normalized fixed point buffer, the combination RGBA and 1975bd8deadSopenharmony_ci SHORT is accepted." 1985bd8deadSopenharmony_ci 1995bd8deadSopenharmony_ci Add to Section 16.1.4 "Conversion of RGBA values": 2005bd8deadSopenharmony_ci 2015bd8deadSopenharmony_ci For signed normalized fixed-point color buffer, each element 2025bd8deadSopenharmony_ci is converted to floating-point using equation 2.2. 2035bd8deadSopenharmony_ci 2045bd8deadSopenharmony_ci 2055bd8deadSopenharmony_ciErrors 2065bd8deadSopenharmony_ci 2075bd8deadSopenharmony_ci No new errors. 2085bd8deadSopenharmony_ci 2095bd8deadSopenharmony_ci 2105bd8deadSopenharmony_ciInteractions with EXT_texture_norm16 2115bd8deadSopenharmony_ci 2125bd8deadSopenharmony_ci If EXT_texture_norm16 is not supported, remove references to R16_SNORM_EXT, 2135bd8deadSopenharmony_ci RG16_SNORM_EXT, RGB16_SNORM_EXT, RGBA16_SNORM_EXT. Remove language and 2145bd8deadSopenharmony_ci additions referring to 16bit (signed / unsigned) normalized fixed 2155bd8deadSopenharmony_ci point buffers. 2165bd8deadSopenharmony_ci 2175bd8deadSopenharmony_ci 2185bd8deadSopenharmony_ciIssues 2195bd8deadSopenharmony_ci 2205bd8deadSopenharmony_ci 1. How does this extension differ from the functionality offered by GL4.4? 2215bd8deadSopenharmony_ci 2225bd8deadSopenharmony_ci On GL, the affected formats are generally exposed as 'color 2235bd8deadSopenharmony_ci renderable' but not as 'required renderbuffer format', which 2245bd8deadSopenharmony_ci might be interpreted as 'optionally renderable'. EXT_render_snorm 2255bd8deadSopenharmony_ci tries to avoid this ambiguity by introducing formats as 'neither 2265bd8deadSopenharmony_ci color-renderable nor req. renderbuffer format' or as 2275bd8deadSopenharmony_ci 'color-renderable plus required renderbuffer format', but not a 2285bd8deadSopenharmony_ci mixture of both. DX 10.1 level hardware is expected to supported 2295bd8deadSopenharmony_ci these formats as being renderable. 3-component snorm formats were 2305bd8deadSopenharmony_ci left out as they are not expected to map well to native hardware 2315bd8deadSopenharmony_ci formats. 2325bd8deadSopenharmony_ci 2335bd8deadSopenharmony_ci 2. Are format conversions between UNORM and SNORM formats allowed 2345bd8deadSopenharmony_ci for CopyTexImage2D? 2355bd8deadSopenharmony_ci 2365bd8deadSopenharmony_ci The OpenGL ES specs describe the CopyTexImage2D operation in 2375bd8deadSopenharmony_ci terms of ReadPixels followed by TexImage2D. The ReadPixels 2385bd8deadSopenharmony_ci command will use the appropriate format/type combination from 2395bd8deadSopenharmony_ci Table 8.15. For an internal format of RGBA8_SNORM, this will be 2405bd8deadSopenharmony_ci GL_RGBA and GL_BYTE. (Special rules apply to framebuffer 2415bd8deadSopenharmony_ci attachments that have been created using unsized internalformats. 2425bd8deadSopenharmony_ci These rules don't apply to attachments of _SNORM formats as they 2435bd8deadSopenharmony_ci could only have been created using sized internalformats.) The 2445bd8deadSopenharmony_ci following 'virtual' TexImage2D call will use the same format/type 2455bd8deadSopenharmony_ci combination together with the provided internalformat. The 2465bd8deadSopenharmony_ci resulting combination of internalformat/format/type must be one 2475bd8deadSopenharmony_ci of those listed in Table 8.12. For signed fixed point formats it 2485bd8deadSopenharmony_ci is not possible to create them from unsigned fixed point data and 2495bd8deadSopenharmony_ci vice versa. Effectively this means, CopyTexImage2D cannot perform 2505bd8deadSopenharmony_ci any conversions that glTexImage could not do (except dropping 2515bd8deadSopenharmony_ci color components); in particular it cannot convert between 2525bd8deadSopenharmony_ci mismatching component types. 2535bd8deadSopenharmony_ci 2545bd8deadSopenharmony_ci Source Effective | Requested | CopyTexImage Supported 2555bd8deadSopenharmony_ci Internalformat | Internalformat | 2565bd8deadSopenharmony_ci -----------------+------------------------+------------------------------------ 2575bd8deadSopenharmony_ci sized SNORM | sized SNORM | yes (provided component sizes match 2585bd8deadSopenharmony_ci | | and the same or more components 2595bd8deadSopenharmony_ci | | are present in the source buffer) 2605bd8deadSopenharmony_ci sized SNORM | sized or unsized UNORM | no (conversions not supported) 2615bd8deadSopenharmony_ci 2625bd8deadSopenharmony_ci 2635bd8deadSopenharmony_ciRevision History: 2645bd8deadSopenharmony_ci 2655bd8deadSopenharmony_ci Revision: 1 2014-07-18 (mheyer) 2665bd8deadSopenharmony_ci initial revision 2675bd8deadSopenharmony_ci Revision: 2 2014-08-08 (mheyer) 2685bd8deadSopenharmony_ci rename extension to EXT_render_snorm 2695bd8deadSopenharmony_ci Revision: 3 2014-08-20 (mheyer) 2705bd8deadSopenharmony_ci clarify CopyTexImage2D behavior 2715bd8deadSopenharmony_ci Revision: 4 2014-10-24 (dkoch) 2725bd8deadSopenharmony_ci mark complete, publishing cleanup 273