15bd8deadSopenharmony_ciName 25bd8deadSopenharmony_ci 35bd8deadSopenharmony_ci EXT_texture_storage_compression 45bd8deadSopenharmony_ci 55bd8deadSopenharmony_ciName Strings 65bd8deadSopenharmony_ci 75bd8deadSopenharmony_ci GL_EXT_texture_storage_compression 85bd8deadSopenharmony_ci 95bd8deadSopenharmony_ci 105bd8deadSopenharmony_ciContact 115bd8deadSopenharmony_ci 125bd8deadSopenharmony_ci Jan-Harald Fredriksen (jan-harald.fredriksen 'at' arm.com) 135bd8deadSopenharmony_ci 145bd8deadSopenharmony_ciContributors 155bd8deadSopenharmony_ci 165bd8deadSopenharmony_ci Jan-Harald Fredriksen, Arm 175bd8deadSopenharmony_ci Lisa Wu, Arm 185bd8deadSopenharmony_ci Anton Berko, Arm 195bd8deadSopenharmony_ci Laurie Hedge, Imagination Technologies 205bd8deadSopenharmony_ci 215bd8deadSopenharmony_ciStatus 225bd8deadSopenharmony_ci 235bd8deadSopenharmony_ci Complete 245bd8deadSopenharmony_ci 255bd8deadSopenharmony_ciVersion 265bd8deadSopenharmony_ci 275bd8deadSopenharmony_ci Version 1 - November 15, 2021 285bd8deadSopenharmony_ci 295bd8deadSopenharmony_ciNumber 305bd8deadSopenharmony_ci 315bd8deadSopenharmony_ci OpenGL ES Extension #336 325bd8deadSopenharmony_ci 335bd8deadSopenharmony_ciDependencies 345bd8deadSopenharmony_ci 355bd8deadSopenharmony_ci Requires OpenGL ES 3.0. 365bd8deadSopenharmony_ci 375bd8deadSopenharmony_ci This extension is written based on the wording of the OpenGL ES 3.2 385bd8deadSopenharmony_ci Specification. 395bd8deadSopenharmony_ci 405bd8deadSopenharmony_ciOverview 415bd8deadSopenharmony_ci 425bd8deadSopenharmony_ci Applications may wish to take advantage of framebuffer compression. Some 435bd8deadSopenharmony_ci platforms may support framebuffer compression at fixed bitrates. Such 445bd8deadSopenharmony_ci compression algorithms generally produce results that are visually lossless, 455bd8deadSopenharmony_ci but the results are typically not bit-exact when compared to a non-compressed 465bd8deadSopenharmony_ci result. 475bd8deadSopenharmony_ci 485bd8deadSopenharmony_ci This extension enables applications to opt-in to compression for 495bd8deadSopenharmony_ci immutable textures. 505bd8deadSopenharmony_ci 515bd8deadSopenharmony_ciNew Types 525bd8deadSopenharmony_ci 535bd8deadSopenharmony_ci None. 545bd8deadSopenharmony_ci 555bd8deadSopenharmony_ciNew Procedures and Functions 565bd8deadSopenharmony_ci 575bd8deadSopenharmony_ci void TexStorageAttribs2DEXT(enum target, sizei levels, enum internalformat, 585bd8deadSopenharmony_ci sizei width, sizei height, const int *attrib_list); 595bd8deadSopenharmony_ci 605bd8deadSopenharmony_ci void TexStorageAttribs3DEXT(enum target, sizei levels, enum internalformat, 615bd8deadSopenharmony_ci sizei width, sizei height, sizei depth, const int *attrib_list); 625bd8deadSopenharmony_ci 635bd8deadSopenharmony_ci 645bd8deadSopenharmony_ciNew Tokens 655bd8deadSopenharmony_ci 665bd8deadSopenharmony_ci New attributes accepted by the <attrib_list> argument of 675bd8deadSopenharmony_ci TexStorageAttribs2DEXT and TexStorageAttribs3DEXT, and as the <pname> 685bd8deadSopenharmony_ci argument to GetTexParameter*: 695bd8deadSopenharmony_ci SURFACE_COMPRESSION_EXT 0x96C0 705bd8deadSopenharmony_ci 715bd8deadSopenharmony_ci New attributes accepted by the <pname> argument of 725bd8deadSopenharmony_ci GetInternalformativ: 735bd8deadSopenharmony_ci NUM_SURFACE_COMPRESSION_FIXED_RATES_EXT 0x8F6E 745bd8deadSopenharmony_ci 755bd8deadSopenharmony_ci Accepted as attribute values for SURFACE_COMPRESSION_EXT by TexStorageAttribs2DEXT 765bd8deadSopenharmony_ci and TexStorageAttribs3DEXT: 775bd8deadSopenharmony_ci SURFACE_COMPRESSION_FIXED_RATE_NONE_EXT 0x96C1 785bd8deadSopenharmony_ci SURFACE_COMPRESSION_FIXED_RATE_DEFAULT_EXT 0x96C2 795bd8deadSopenharmony_ci 805bd8deadSopenharmony_ci SURFACE_COMPRESSION_FIXED_RATE_1BPC_EXT 0x96C4 815bd8deadSopenharmony_ci SURFACE_COMPRESSION_FIXED_RATE_2BPC_EXT 0x96C5 825bd8deadSopenharmony_ci SURFACE_COMPRESSION_FIXED_RATE_3BPC_EXT 0x96C6 835bd8deadSopenharmony_ci SURFACE_COMPRESSION_FIXED_RATE_4BPC_EXT 0x96C7 845bd8deadSopenharmony_ci SURFACE_COMPRESSION_FIXED_RATE_5BPC_EXT 0x96C8 855bd8deadSopenharmony_ci SURFACE_COMPRESSION_FIXED_RATE_6BPC_EXT 0x96C9 865bd8deadSopenharmony_ci SURFACE_COMPRESSION_FIXED_RATE_7BPC_EXT 0x96CA 875bd8deadSopenharmony_ci SURFACE_COMPRESSION_FIXED_RATE_8BPC_EXT 0x96CB 885bd8deadSopenharmony_ci SURFACE_COMPRESSION_FIXED_RATE_9BPC_EXT 0x96CC 895bd8deadSopenharmony_ci SURFACE_COMPRESSION_FIXED_RATE_10BPC_EXT 0x96CD 905bd8deadSopenharmony_ci SURFACE_COMPRESSION_FIXED_RATE_11BPC_EXT 0x96CE 915bd8deadSopenharmony_ci SURFACE_COMPRESSION_FIXED_RATE_12BPC_EXT 0x96CF 925bd8deadSopenharmony_ci 935bd8deadSopenharmony_ciAdditions to Chapter 8 of the OpenGL ES 3.2 Specification (Textures and 945bd8deadSopenharmony_ciSamplers) 955bd8deadSopenharmony_ci 965bd8deadSopenharmony_ci Add to 8.11.2, "Texture Parameter Queries" 975bd8deadSopenharmony_ci 985bd8deadSopenharmony_ci Add SURFACE_COMPRESSION_EXT to the values accepted by <pname>. 995bd8deadSopenharmony_ci 1005bd8deadSopenharmony_ci "Querying <pname> SURFACE_COMPRESSION_EXT returns the fixed-rate 1015bd8deadSopenharmony_ci compression rate that was actually applied to the texture." 1025bd8deadSopenharmony_ci 1035bd8deadSopenharmony_ci Add to 8.18, "Immutable-Format Texture Images" section: 1045bd8deadSopenharmony_ci 1055bd8deadSopenharmony_ci The command 1065bd8deadSopenharmony_ci 1075bd8deadSopenharmony_ci void TexStorageAttribs2DEXT(enum target, sizei levels, enum internalformat, 1085bd8deadSopenharmony_ci sizei width, sizei height, const int *attrib_list); 1095bd8deadSopenharmony_ci 1105bd8deadSopenharmony_ci behaves identically to TexStorage2D, except that additional flags can 1115bd8deadSopenharmony_ci specified in <attrib_list>. 1125bd8deadSopenharmony_ci 1135bd8deadSopenharmony_ci Similarly, the command 1145bd8deadSopenharmony_ci 1155bd8deadSopenharmony_ci void TexStorageAttribs3DEXT(enum target, sizei levels, enum internalformat, 1165bd8deadSopenharmony_ci sizei width, sizei height, sizei depth, const int *attrib_list); 1175bd8deadSopenharmony_ci 1185bd8deadSopenharmony_ci behaves identically to TexStorage3D, except that additional flags can be 1195bd8deadSopenharmony_ci specified in <attrib_list>. 1205bd8deadSopenharmony_ci 1215bd8deadSopenharmony_ci For TexStorageAttribs2DEXT and TexStorageAttribs3DEXT, <attrib_list> 1225bd8deadSopenharmony_ci specifies a list of attributes for the texture. 1235bd8deadSopenharmony_ci 1245bd8deadSopenharmony_ci All attribute names in <attrib_list> are immediately followed by the 1255bd8deadSopenharmony_ci corresponding value. The list is terminated with GL_NONE. If an 1265bd8deadSopenharmony_ci attribute is not specified in <attrib_list>, then the default value 1275bd8deadSopenharmony_ci is used. 1285bd8deadSopenharmony_ci 1295bd8deadSopenharmony_ci <attrib_list> may be NULL or empty (first attribute is GL_NONE), in which 1305bd8deadSopenharmony_ci case all attributes assume their default value as described below. 1315bd8deadSopenharmony_ci 1325bd8deadSopenharmony_ci Attributes that can be specified in <attrib_list> include 1335bd8deadSopenharmony_ci SURFACE_COMPRESSION_EXT. 1345bd8deadSopenharmony_ci 1355bd8deadSopenharmony_ci SURFACE_COMPRESSION_EXT specifies if fixed-rate compression can be 1365bd8deadSopenharmony_ci enabled for the texture. 1375bd8deadSopenharmony_ci If its value is SURFACE_COMPRESSION_FIXED_RATE_NONE_EXT then fixed-rate 1385bd8deadSopenharmony_ci compression is disabled. 1395bd8deadSopenharmony_ci If its value is SURFACE_COMPRESSION_FIXED_RATE_DEFAULT_EXT then the 1405bd8deadSopenharmony_ci implementation may enable compression at a default, implementation-defined, 1415bd8deadSopenharmony_ci rate. 1425bd8deadSopenharmony_ci If its value is SURFACE_COMPRESSION_FIXED_RATE_1BPC_EXT, then the 1435bd8deadSopenharmony_ci implementation may enable fixed-rate compression with a bitrate of at 1445bd8deadSopenharmony_ci least 1 bit and less than 2 bits per component. 1455bd8deadSopenharmony_ci If its value is SURFACE_COMPRESSION_FIXED_RATE_2BPC_EXT, then the 1465bd8deadSopenharmony_ci implementation may enable fixed-rate compression with a bitrate of at 1475bd8deadSopenharmony_ci least 2 bits and less than 3 bits per component. 1485bd8deadSopenharmony_ci If its value is SURFACE_COMPRESSION_FIXED_RATE_3BPC_EXT, then the 1495bd8deadSopenharmony_ci implementation may enable fixed-rate compression with a bitrate of at 1505bd8deadSopenharmony_ci least 3 bits and less than 4 bits per component. 1515bd8deadSopenharmony_ci If its value is SURFACE_COMPRESSION_FIXED_RATE_4BPC_EXT, then the 1525bd8deadSopenharmony_ci implementation may enable fixed-rate compression with a bitrate of at 1535bd8deadSopenharmony_ci least 4 bits and less than 5 bit per component. 1545bd8deadSopenharmony_ci If its value is SURFACE_COMPRESSION_FIXED_RATE_5BPC_EXT, then the 1555bd8deadSopenharmony_ci implementation may enable fixed-rate compression with a bitrate of at 1565bd8deadSopenharmony_ci least 5 bits and less than 6 bits per component. 1575bd8deadSopenharmony_ci If its value is SURFACE_COMPRESSION_FIXED_RATE_6BPC_EXT, then the 1585bd8deadSopenharmony_ci implementation may enable fixed-rate compression with a bitrate of at 1595bd8deadSopenharmony_ci least 6 bits and less than 7 bits per component. 1605bd8deadSopenharmony_ci If its value is SURFACE_COMPRESSION_FIXED_RATE_7BPC_EXT, then the 1615bd8deadSopenharmony_ci implementation may enable fixed-rate compression with a bitrate of at 1625bd8deadSopenharmony_ci least 7 bits and less than 8 bits per component. 1635bd8deadSopenharmony_ci If its value is SURFACE_COMPRESSION_FIXED_RATE_8BPC_EXT, then the 1645bd8deadSopenharmony_ci implementation may enable fixed-rate compression with a bitrate of at 1655bd8deadSopenharmony_ci least 8 bits and less than 9 bits per component. 1665bd8deadSopenharmony_ci If its value is SURFACE_COMPRESSION_FIXED_RATE_9BPC_EXT, then the 1675bd8deadSopenharmony_ci implementation may enable fixed-rate compression with a bitrate of at 1685bd8deadSopenharmony_ci least 9 bits and less than 10 bits per component. 1695bd8deadSopenharmony_ci If its value is SURFACE_COMPRESSION_FIXED_RATE_10BPC_EXT, then the 1705bd8deadSopenharmony_ci implementation may enable fixed-rate compression with a bitrate of at 1715bd8deadSopenharmony_ci least 10 bits and less than 11 bits per component. 1725bd8deadSopenharmony_ci If its value is SURFACE_COMPRESSION_FIXED_RATE_11BPC_EXT, then the 1735bd8deadSopenharmony_ci implementation may enable fixed-rate compression with a bitrate of at 1745bd8deadSopenharmony_ci least 11 bits and less than 12 bits per component. 1755bd8deadSopenharmony_ci If its value is SURFACE_COMPRESSION_FIXED_RATE_12BPC_EXT, then the 1765bd8deadSopenharmony_ci implementation may enable fixed-rate compression with a bitrate of at 1775bd8deadSopenharmony_ci least 12 bits per component. 1785bd8deadSopenharmony_ci 1795bd8deadSopenharmony_ci The default value of SURFACE_COMPRESSION_EXT is 1805bd8deadSopenharmony_ci SURFACE_COMPRESSION_FIXED_RATE_NONE_EXT. 1815bd8deadSopenharmony_ci 1825bd8deadSopenharmony_ci If <attrib_list> is neither NULL nor a value described above, the error 1835bd8deadSopenharmony_ci INVALID_VALUE is generated. 1845bd8deadSopenharmony_ci 1855bd8deadSopenharmony_ci Fixed-rate compression is done in an implementation-defined manner and may 1865bd8deadSopenharmony_ci be applied at block granularity. In that case, a write to an individual 1875bd8deadSopenharmony_ci texel may modify the value of other texels in the same block. 1885bd8deadSopenharmony_ci 1895bd8deadSopenharmony_ci Modify section 8.23, "Texture Image Loads and Stores": 1905bd8deadSopenharmony_ci 1915bd8deadSopenharmony_ci Add to the list of errors for BindImageTexture: 1925bd8deadSopenharmony_ci 1935bd8deadSopenharmony_ci "An INVALID_VALUE error is generated if the value of 1945bd8deadSopenharmony_ci SURFACE_COMPRESSION_EXT for <texture> is not 1955bd8deadSopenharmony_ci SURFACE_COMPRESSION_FIXED_RATE_NONE_EXT." 1965bd8deadSopenharmony_ci 1975bd8deadSopenharmony_ci Add to the bullet list of conditions for when image access is considered invalid: 1985bd8deadSopenharmony_ci 1995bd8deadSopenharmony_ci " * the value of SURFACE_COMPRESSION_EXT for the texture is not 2005bd8deadSopenharmony_ci SURFACE_COMPRESSION_FIXED_RATE_NONE_EXT;" 2015bd8deadSopenharmony_ci 2025bd8deadSopenharmony_ciAdditions to Chapter 20 of the OpenGL ES 3.2 Specification (Context State Queries) 2035bd8deadSopenharmony_ci 2045bd8deadSopenharmony_ci Add to the end of section 20.3.1 Internal Format Query Parameters describing 2055bd8deadSopenharmony_ci supported values for <pname>, their meanings, and their possible return values 2065bd8deadSopenharmony_ci for GetInternalformativ: 2075bd8deadSopenharmony_ci 2085bd8deadSopenharmony_ci NUM_SURFACE_COMPRESSION_FIXED_RATES_EXT: The number of fixed-rate compression 2095bd8deadSopenharmony_ci rates that would be returned by querying SURFACE_COMPRESSION_EXT is returned 2105bd8deadSopenharmony_ci in <params>. If <internalformat> does not support any fixed-rate compression, 2115bd8deadSopenharmony_ci zero is returned. 2125bd8deadSopenharmony_ci 2135bd8deadSopenharmony_ci SURFACE_COMPRESSION_EXT: The fixed-rate compression rates supported for 2145bd8deadSopenharmony_ci <internalformat> and <target> are written into <params>, in order of 2155bd8deadSopenharmony_ci ascending bitrates. 2165bd8deadSopenharmony_ci 2175bd8deadSopenharmony_ciIssues 2185bd8deadSopenharmony_ci 2195bd8deadSopenharmony_ci 1. Do we need to specify compression rates in this extension? 2205bd8deadSopenharmony_ci 2215bd8deadSopenharmony_ci Resolved. Yes. The GL implementation allocates these resources and need to 2225bd8deadSopenharmony_ci know the compression ratio. 2235bd8deadSopenharmony_ci 2245bd8deadSopenharmony_ciRevision History 2255bd8deadSopenharmony_ci Version 1, 2021/11/15 2265bd8deadSopenharmony_ci - Internal revisions 227