15bd8deadSopenharmony_ciName 25bd8deadSopenharmony_ci 35bd8deadSopenharmony_ci ARB_texture_compression_bptc 45bd8deadSopenharmony_ci 55bd8deadSopenharmony_ciName Strings 65bd8deadSopenharmony_ci 75bd8deadSopenharmony_ci GL_ARB_texture_compression_bptc 85bd8deadSopenharmony_ci 95bd8deadSopenharmony_ciContact 105bd8deadSopenharmony_ci 115bd8deadSopenharmony_ci Eric Werness, NVIDIA Corporation (ewerness 'at' nvidia.com) 125bd8deadSopenharmony_ci Piers Daniell, NVIDIA Corporation (pdaniell 'at' nvidia.com) 135bd8deadSopenharmony_ci 145bd8deadSopenharmony_ciContributors 155bd8deadSopenharmony_ci 165bd8deadSopenharmony_ci Barthold Lichtenbelt, NVIDIA 175bd8deadSopenharmony_ci Bill Licea-Kane, AMD 185bd8deadSopenharmony_ci Graham Sellers, AMD 195bd8deadSopenharmony_ci Greg Roth, NVIDIA 205bd8deadSopenharmony_ci Jeannot Breton, NVIDIA 215bd8deadSopenharmony_ci Jeff Bolz, NVIDIA 225bd8deadSopenharmony_ci Nick Haemel, AMD 235bd8deadSopenharmony_ci Pat Brown, NVIDIA 245bd8deadSopenharmony_ci Pierre Boudier, AMD 255bd8deadSopenharmony_ci Piers Daniell, NVIDIA 265bd8deadSopenharmony_ci 275bd8deadSopenharmony_ciNotice 285bd8deadSopenharmony_ci 295bd8deadSopenharmony_ci Copyright (c) 2010-2013 The Khronos Group Inc. Copyright terms at 305bd8deadSopenharmony_ci http://www.khronos.org/registry/speccopyright.html 315bd8deadSopenharmony_ci 325bd8deadSopenharmony_ciSpecification Update Policy 335bd8deadSopenharmony_ci 345bd8deadSopenharmony_ci Khronos-approved extension specifications are updated in response to 355bd8deadSopenharmony_ci issues and bugs prioritized by the Khronos OpenGL Working Group. For 365bd8deadSopenharmony_ci extensions which have been promoted to a core Specification, fixes will 375bd8deadSopenharmony_ci first appear in the latest version of that core Specification, and will 385bd8deadSopenharmony_ci eventually be backported to the extension document. This policy is 395bd8deadSopenharmony_ci described in more detail at 405bd8deadSopenharmony_ci https://www.khronos.org/registry/OpenGL/docs/update_policy.php 415bd8deadSopenharmony_ci 425bd8deadSopenharmony_ciStatus 435bd8deadSopenharmony_ci 445bd8deadSopenharmony_ci Complete. Approved by the ARB at the 2010/01/22 F2F meeting. 455bd8deadSopenharmony_ci Approved by the Khronos Board of Promoters on March 10, 2010. 465bd8deadSopenharmony_ci 475bd8deadSopenharmony_ciVersion 485bd8deadSopenharmony_ci 495bd8deadSopenharmony_ci Last Modified Date: October 30, 2019 505bd8deadSopenharmony_ci Revision: 9 515bd8deadSopenharmony_ci 525bd8deadSopenharmony_ciNumber 535bd8deadSopenharmony_ci 545bd8deadSopenharmony_ci ARB Extension #77 555bd8deadSopenharmony_ci 565bd8deadSopenharmony_ciDependencies 575bd8deadSopenharmony_ci 585bd8deadSopenharmony_ci OpenGL 1.3 or ARB_texture_compression is required. 595bd8deadSopenharmony_ci 605bd8deadSopenharmony_ci This extension is written against the OpenGL 3.2 Specification 615bd8deadSopenharmony_ci (Compatibility Profile). 625bd8deadSopenharmony_ci 635bd8deadSopenharmony_ciOverview 645bd8deadSopenharmony_ci 655bd8deadSopenharmony_ci This extension provides additional texture compression functionality 665bd8deadSopenharmony_ci specific to the BPTC and BPTC_FLOAT compressed texture formats (called BC7 675bd8deadSopenharmony_ci and BC6H respectively in Microsoft's DirectX API), subject to all the 685bd8deadSopenharmony_ci requirements and limitations described by the extension 695bd8deadSopenharmony_ci GL_ARB_texture_compression. 705bd8deadSopenharmony_ci 715bd8deadSopenharmony_ci Traditional block compression methods as typified by s3tc and latc 725bd8deadSopenharmony_ci compress a block of pixels into indicies along a gradient. This works well 735bd8deadSopenharmony_ci for smooth images, but can have quality issues along sharp edges and 745bd8deadSopenharmony_ci strong chrominance transitions. To improve quality in these problematic 755bd8deadSopenharmony_ci cases, the BPTC formats can divide each block into multiple partitions, 765bd8deadSopenharmony_ci each of which are compressed using an independent gradient. 775bd8deadSopenharmony_ci 785bd8deadSopenharmony_ci In addition, it is desirable to directly support high dynamic range 795bd8deadSopenharmony_ci imagery in compressed formats, which is accomplished by the BPTC_FLOAT 805bd8deadSopenharmony_ci formats. 815bd8deadSopenharmony_ci 825bd8deadSopenharmony_ciIP Status 835bd8deadSopenharmony_ci 845bd8deadSopenharmony_ci No known IP claims. 855bd8deadSopenharmony_ci 865bd8deadSopenharmony_ciNew Procedures and Functions 875bd8deadSopenharmony_ci 885bd8deadSopenharmony_ci None. 895bd8deadSopenharmony_ci 905bd8deadSopenharmony_ciNew Tokens 915bd8deadSopenharmony_ci 925bd8deadSopenharmony_ci Accepted by the <internalformat> parameter of TexImage2D, TexImage3D, 935bd8deadSopenharmony_ci CopyTexImage2D, CopyTexImage3D, CompressedTexImage2DARB, and 945bd8deadSopenharmony_ci CompressedTexImage3DARB and the <format> parameter of 955bd8deadSopenharmony_ci CompressedTexSubImage2DARB and CompressedTexSubImage3DARB: 965bd8deadSopenharmony_ci 975bd8deadSopenharmony_ci COMPRESSED_RGBA_BPTC_UNORM_ARB 0x8E8C 985bd8deadSopenharmony_ci COMPRESSED_SRGB_ALPHA_BPTC_UNORM_ARB 0x8E8D 995bd8deadSopenharmony_ci COMPRESSED_RGB_BPTC_SIGNED_FLOAT_ARB 0x8E8E 1005bd8deadSopenharmony_ci COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_ARB 0x8E8F 1015bd8deadSopenharmony_ci 1025bd8deadSopenharmony_ci 1035bd8deadSopenharmony_ciAdditions to Chapter 2 of the OpenGL 3.2 Specification (OpenGL Operation) 1045bd8deadSopenharmony_ci 1055bd8deadSopenharmony_ci None. 1065bd8deadSopenharmony_ci 1075bd8deadSopenharmony_ciAdditions to Chapter 3 of the OpenGL 3.2 Specification (Rasterization) 1085bd8deadSopenharmony_ci 1095bd8deadSopenharmony_ci Add to Table 3.20: Generic and specific compressed internal formats 1105bd8deadSopenharmony_ci 1115bd8deadSopenharmony_ci Compressed Internal Format Base Internal Format Type 1125bd8deadSopenharmony_ci ========================== ==================== ======== 1135bd8deadSopenharmony_ci COMPRESSED_RGBA_BPTC_UNORM_ARB RGBA Specific 1145bd8deadSopenharmony_ci COMPRESSED_SRGB_ALPHA_BPTC_UNORM_ARB RGBA Specific 1155bd8deadSopenharmony_ci COMPRESSED_RGB_BPTC_SIGNED_FLOAT_ARB RGB Specific 1165bd8deadSopenharmony_ci COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_ARB RGB Specific 1175bd8deadSopenharmony_ci 1185bd8deadSopenharmony_ci 1195bd8deadSopenharmony_ci Modify Section 3.9.2, Alternate Texture Image Specification Commands 1205bd8deadSopenharmony_ci 1215bd8deadSopenharmony_ci (add to end of TexSubImage discussion, p.231 -- after edit from the 1225bd8deadSopenharmony_ci ARB_texture_compression spec) 1235bd8deadSopenharmony_ci 1245bd8deadSopenharmony_ci If the internal format of the texture image being modified is 1255bd8deadSopenharmony_ci COMPRESSED_RGBA_BPTC_UNORM_ARB, COMPRESSED_SRGB_ALPHA_BPTC_UNORM_ARB, 1265bd8deadSopenharmony_ci COMPRESSED_RGB_BPTC_SIGNED_FLOAT_ARB, or 1275bd8deadSopenharmony_ci COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_ARB the texture is stored using the 1285bd8deadSopenharmony_ci specified BPTC compressed texture image format. Such images are easily 1295bd8deadSopenharmony_ci edited along 4x4 texel boundaries, so the limitations on TexSubImage2D, 1305bd8deadSopenharmony_ci TexSubImage3D, CopyTexSubImage2D, and CopyTexSubImage3D parameters are 1315bd8deadSopenharmony_ci relaxed. TexSubImage2D, TexSubImage3D, CopyTexSubImage2D, and 1325bd8deadSopenharmony_ci CopyTexSubImage3D will result in an INVALID_OPERATION error only if one of 1335bd8deadSopenharmony_ci the following conditions occurs: 1345bd8deadSopenharmony_ci 1355bd8deadSopenharmony_ci * <width> is not a multiple of four, <width> plus <xoffset> is not 1365bd8deadSopenharmony_ci equal to TEXTURE_WIDTH, and either <xoffset> or <yoffset> is 1375bd8deadSopenharmony_ci non-zero; 1385bd8deadSopenharmony_ci 1395bd8deadSopenharmony_ci * <height> is not a multiple of four, <height> plus <yoffset> is not 1405bd8deadSopenharmony_ci equal to TEXTURE_HEIGHT, and either <xoffset> or <yoffset> is 1415bd8deadSopenharmony_ci non-zero; or 1425bd8deadSopenharmony_ci 1435bd8deadSopenharmony_ci * <xoffset> or <yoffset> is not a multiple of four. 1445bd8deadSopenharmony_ci 1455bd8deadSopenharmony_ci The contents of any 4x4 block of texels of a BPTC compressed texture image 1465bd8deadSopenharmony_ci that does not intersect the area being modified are preserved during valid 1475bd8deadSopenharmony_ci TexSubImage2D, TexSubImage3D, CopyTexSubImage2D, and CopyTexSubImage3D 1485bd8deadSopenharmony_ci calls. 1495bd8deadSopenharmony_ci 1505bd8deadSopenharmony_ci 1515bd8deadSopenharmony_ci Add to Section 3.9.3, Compressed Texture Images (adding to the end of the 1525bd8deadSopenharmony_ci CompressedTexImage section introduced by the ARB_texture_compression spec) 1535bd8deadSopenharmony_ci 1545bd8deadSopenharmony_ci If <internalformat> is COMPRESSED_RGBA_BPTC_UNORM_ARB, 1555bd8deadSopenharmony_ci COMPRESSED_SRGB_ALPHA_BPTC_UNORM_ARB, 1565bd8deadSopenharmony_ci COMPRESSED_RGB_BPTC_SIGNED_FLOAT_ARB, or 1575bd8deadSopenharmony_ci COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_ARB the compressed texture is stored 1585bd8deadSopenharmony_ci using the specified BPTC compressed texture image format. The BPTC 1595bd8deadSopenharmony_ci texture compression algorithm supports only 2D images without borders, 1605bd8deadSopenharmony_ci though 3D images can be compressed as multiple slices of compressed 2D 1615bd8deadSopenharmony_ci images. CompressedTexImage1DARB produces an INVALID_ENUM error if 1625bd8deadSopenharmony_ci <internalformat> is a BPTC format. CompressedTexImage2DARB and 1635bd8deadSopenharmony_ci CompressedTexImage3DARB will produce an INVALID_OPERATION error if 1645bd8deadSopenharmony_ci <border> is non-zero. 1655bd8deadSopenharmony_ci 1665bd8deadSopenharmony_ci 1675bd8deadSopenharmony_ci Add to Section 3.9.3, Compressed Texture Images (adding to the end of the 1685bd8deadSopenharmony_ci CompressedTexSubImage section introduced by the ARB_texture_compression 1695bd8deadSopenharmony_ci spec) 1705bd8deadSopenharmony_ci 1715bd8deadSopenharmony_ci If the internal format of the texture image being modified is 1725bd8deadSopenharmony_ci COMPRESSED_RGBA_BPTC_UNORM_ARB, COMPRESSED_SRGB_ALPHA_BPTC_UNORM_ARB, 1735bd8deadSopenharmony_ci COMPRESSED_RGB_BPTC_SIGNED_FLOAT_ARB, or 1745bd8deadSopenharmony_ci COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_ARB the texture is stored using the 1755bd8deadSopenharmony_ci specified BPTC compressed texture image formats. Since the BPTC texture 1765bd8deadSopenharmony_ci compression algorithm supports only 2D images, CompressedTexSubImage1DARB 1775bd8deadSopenharmony_ci produces an INVALID_ENUM error if <format> is a BPTC format. Since BPTC 1785bd8deadSopenharmony_ci images are easily edited along 4x4 texel boundaries, the limitations on 1795bd8deadSopenharmony_ci CompressedTexSubImage2D and CompressedTexSubImage3D are relaxed. 1805bd8deadSopenharmony_ci CompressedTexSubImage2D and CompressedTexSubImage3D will result in an 1815bd8deadSopenharmony_ci INVALID_OPERATION error only if one of the following conditions occurs: 1825bd8deadSopenharmony_ci 1835bd8deadSopenharmony_ci * <width> is not a multiple of four, and <width> plus <xoffset> is not 1845bd8deadSopenharmony_ci equal to TEXTURE_WIDTH; 1855bd8deadSopenharmony_ci 1865bd8deadSopenharmony_ci * <height> is not a multiple of four, and <height> plus <yoffset> is 1875bd8deadSopenharmony_ci not equal to TEXTURE_HEIGHT; or 1885bd8deadSopenharmony_ci 1895bd8deadSopenharmony_ci * <xoffset> or <yoffset> is not a multiple of four. 1905bd8deadSopenharmony_ci 1915bd8deadSopenharmony_ci The contents of any 4x4 block of texels of a BPTC compressed texture image 1925bd8deadSopenharmony_ci that does not intersect the area being modified are preserved during valid 1935bd8deadSopenharmony_ci TexSubImage2D/3D and CopyTexSubImage2D/3D calls. 1945bd8deadSopenharmony_ci 1955bd8deadSopenharmony_ciAdditions to Chapter 4 of the OpenGL 3.2 Specification (Per-Fragment 1965bd8deadSopenharmony_ciOperations and the Frame Buffer) 1975bd8deadSopenharmony_ci 1985bd8deadSopenharmony_ci None. 1995bd8deadSopenharmony_ci 2005bd8deadSopenharmony_ciAdditions to Chapter 5 of the OpenGL 3.2 Specification (Special Functions) 2015bd8deadSopenharmony_ci 2025bd8deadSopenharmony_ci None. 2035bd8deadSopenharmony_ci 2045bd8deadSopenharmony_ciAdditions to Chapter 6 of the OpenGL 3.2 Specification (State and 2055bd8deadSopenharmony_ciState Requests) 2065bd8deadSopenharmony_ci 2075bd8deadSopenharmony_ci None. 2085bd8deadSopenharmony_ci 2095bd8deadSopenharmony_ciAdditions to Appendix A of the OpenGL 3.2 Specification (Invariance) 2105bd8deadSopenharmony_ci 2115bd8deadSopenharmony_ci None. 2125bd8deadSopenharmony_ci 2135bd8deadSopenharmony_ciAdditions to the AGL/GLX/WGL Specifications 2145bd8deadSopenharmony_ci 2155bd8deadSopenharmony_ci None. 2165bd8deadSopenharmony_ci 2175bd8deadSopenharmony_ciGLX Protocol 2185bd8deadSopenharmony_ci 2195bd8deadSopenharmony_ci None. 2205bd8deadSopenharmony_ci 2215bd8deadSopenharmony_ciErrors 2225bd8deadSopenharmony_ci 2235bd8deadSopenharmony_ci INVALID_ENUM is generated by CompressedTexImage1DARB if <internalformat> 2245bd8deadSopenharmony_ci is COMPRESSED_RGBA_BPTC_UNORM_ARB, COMPRESSED_SRGB_ALPHA_BPTC_UNORM_ARB, 2255bd8deadSopenharmony_ci COMPRESSED_RGB_BPTC_SIGNED_FLOAT_ARB, or 2265bd8deadSopenharmony_ci COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_ARB. 2275bd8deadSopenharmony_ci 2285bd8deadSopenharmony_ci INVALID_OPERATION is generated by CompressedTexImage2DARB if 2295bd8deadSopenharmony_ci <internalformat> is COMPRESSED_RGBA_BPTC_UNORM_ARB, 2305bd8deadSopenharmony_ci COMPRESSED_SRGB_ALPHA_BPTC_UNORM_ARB, 2315bd8deadSopenharmony_ci COMPRESSED_RGB_BPTC_SIGNED_FLOAT_ARB, or 2325bd8deadSopenharmony_ci COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_ARB and <border> is not equal to zero. 2335bd8deadSopenharmony_ci 2345bd8deadSopenharmony_ci INVALID_ENUM is generated by CompressedTexSubImage1DARB if <format> is 2355bd8deadSopenharmony_ci COMPRESSED_RGBA_BPTC_UNORM_ARB, COMPRESSED_SRGB_ALPHA_BPTC_UNORM_ARB, 2365bd8deadSopenharmony_ci COMPRESSED_RGB_BPTC_SIGNED_FLOAT_ARB, or 2375bd8deadSopenharmony_ci COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_ARB. 2385bd8deadSopenharmony_ci 2395bd8deadSopenharmony_ci INVALID_OPERATION is generated by TexSubImage2D or CopyTexSubImage2D if 2405bd8deadSopenharmony_ci TEXTURE_INTERNAL_FORMAT is COMPRESSED_RGBA_BPTC_UNORM_ARB, 2415bd8deadSopenharmony_ci COMPRESSED_SRGB_ALPHA_BPTC_UNORM_ARB, 2425bd8deadSopenharmony_ci COMPRESSED_RGB_BPTC_SIGNED_FLOAT_ARB, or 2435bd8deadSopenharmony_ci COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_ARB and any of the following apply: 2445bd8deadSopenharmony_ci 2455bd8deadSopenharmony_ci * <width> is not a multiple of four, <width> plus <xoffset> is not 2465bd8deadSopenharmony_ci equal to TEXTURE_WIDTH, and either <xoffset> or <yoffset> is 2475bd8deadSopenharmony_ci non-zero; 2485bd8deadSopenharmony_ci 2495bd8deadSopenharmony_ci * <height> is not a multiple of four, <height> plus <yoffset> is not 2505bd8deadSopenharmony_ci equal to TEXTURE_HEIGHT, and either <xoffset> or <yoffset> is 2515bd8deadSopenharmony_ci non-zero; or 2525bd8deadSopenharmony_ci 2535bd8deadSopenharmony_ci * <xoffset> or <yoffset> is not a multiple of four. 2545bd8deadSopenharmony_ci 2555bd8deadSopenharmony_ci INVALID_OPERATION is generated by CompressedTexSubImage2D if 2565bd8deadSopenharmony_ci TEXTURE_INTERNAL_FORMAT is COMPRESSED_RGBA_BPTC_UNORM_ARB, 2575bd8deadSopenharmony_ci COMPRESSED_SRGB_ALPHA_BPTC_UNORM_ARB, 2585bd8deadSopenharmony_ci COMPRESSED_RGB_BPTC_SIGNED_FLOAT_ARB, or 2595bd8deadSopenharmony_ci COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_ARB and any of the following apply: 2605bd8deadSopenharmony_ci 2615bd8deadSopenharmony_ci * <width> is not a multiple of four, and <width> plus <xoffset> is not 2625bd8deadSopenharmony_ci equal to TEXTURE_WIDTH; 2635bd8deadSopenharmony_ci 2645bd8deadSopenharmony_ci * <height> is not a multiple of four, and <height> plus <yoffset> is 2655bd8deadSopenharmony_ci not equal to TEXTURE_HEIGHT; or 2665bd8deadSopenharmony_ci 2675bd8deadSopenharmony_ci * <xoffset> or <yoffset> is not a multiple of four. 2685bd8deadSopenharmony_ci 2695bd8deadSopenharmony_ci The following restrictions from the ARB_texture_compression specification 2705bd8deadSopenharmony_ci do not apply to BPTC texture formats, since subimage modification is 2715bd8deadSopenharmony_ci straightforward as long as the subimage is properly aligned. 2725bd8deadSopenharmony_ci 2735bd8deadSopenharmony_ci DELETE: INVALID_OPERATION is generated by TexSubImage1D, TexSubImage2D, 2745bd8deadSopenharmony_ci DELETE: TexSubImage3D, CopyTexSubImage1D, CopyTexSubImage2D, or 2755bd8deadSopenharmony_ci DELETE: CopyTexSubImage3D if the internal format of the texture image is 2765bd8deadSopenharmony_ci DELETE: compressed and <xoffset>, <yoffset>, or <zoffset> does not equal 2775bd8deadSopenharmony_ci DELETE: -b, where b is value of TEXTURE_BORDER. 2785bd8deadSopenharmony_ci 2795bd8deadSopenharmony_ci DELETE: INVALID_VALUE is generated by CompressedTexSubImage1DARB, 2805bd8deadSopenharmony_ci DELETE: CompressedTexSubImage2DARB, or CompressedTexSubImage3DARB if the 2815bd8deadSopenharmony_ci DELETE: entire texture image is not being edited: if <xoffset>, 2825bd8deadSopenharmony_ci DELETE: <yoffset>, or <zoffset> is greater than -b, <xoffset> + <width> is 2835bd8deadSopenharmony_ci DELETE: less than w+b, <yoffset> + <height> is less than h+b, or <zoffset> 2845bd8deadSopenharmony_ci DELETE: + <depth> is less than d+b, where b is the value of 2855bd8deadSopenharmony_ci DELETE: TEXTURE_BORDER, w is the value of TEXTURE_WIDTH, h is the value of 2865bd8deadSopenharmony_ci DELETE: TEXTURE_HEIGHT, and d is the value of TEXTURE_DEPTH. 2875bd8deadSopenharmony_ci 2885bd8deadSopenharmony_ci See also errors in the GL_ARB_texture_compression specification. 2895bd8deadSopenharmony_ci 2905bd8deadSopenharmony_ciNew State 2915bd8deadSopenharmony_ci 2925bd8deadSopenharmony_ci In the "Textures" state table, increment the TEXTURE_INTERNAL_FORMAT 2935bd8deadSopenharmony_ci subscript for Z by 4 in the "Type" row. 2945bd8deadSopenharmony_ci 2955bd8deadSopenharmony_ciNew Implementation Dependent State 2965bd8deadSopenharmony_ci 2975bd8deadSopenharmony_ci None 2985bd8deadSopenharmony_ci 2995bd8deadSopenharmony_ciAppendix 3005bd8deadSopenharmony_ci 3015bd8deadSopenharmony_ci BPTC Compressed Texture Image Format 3025bd8deadSopenharmony_ci 3035bd8deadSopenharmony_ci Compressed texture images stored using the BPTC compressed image formats 3045bd8deadSopenharmony_ci are represented as a collection of 4x4 texel blocks, where each block 3055bd8deadSopenharmony_ci contains 128 bits of texel data. The image is encoded as a normal 2D 3065bd8deadSopenharmony_ci raster image in which each 4x4 block is treated as a single pixel. If a 3075bd8deadSopenharmony_ci BPTC image has a width or height that is not a multiple of four, the data 3085bd8deadSopenharmony_ci corresponding to texels outside the image are irrelevant and undefined. 3095bd8deadSopenharmony_ci 3105bd8deadSopenharmony_ci When a BPTC image with a width of <w>, height of <h>, and block size of 3115bd8deadSopenharmony_ci <blocksize> (16 bytes) is decoded, the corresponding image size (in bytes) 3125bd8deadSopenharmony_ci is: 3135bd8deadSopenharmony_ci 3145bd8deadSopenharmony_ci ceil(<w>/4) * ceil(<h>/4) * blocksize. 3155bd8deadSopenharmony_ci 3165bd8deadSopenharmony_ci When decoding a BPTC image, the block containing the texel at offset 3175bd8deadSopenharmony_ci (<x>, <y>) begins at an offset (in bytes) relative to the base of the 3185bd8deadSopenharmony_ci image of: 3195bd8deadSopenharmony_ci 3205bd8deadSopenharmony_ci blocksize * (ceil(<w>/4) * floor(<y>/4) + floor(<x>/4)). 3215bd8deadSopenharmony_ci 3225bd8deadSopenharmony_ci The data corresponding to a specific texel (<x>, <y>) are extracted from a 3235bd8deadSopenharmony_ci 4x4 texel block using a relative (x,y) value of 3245bd8deadSopenharmony_ci 3255bd8deadSopenharmony_ci (<x> modulo 4, <y> modulo 4). 3265bd8deadSopenharmony_ci 3275bd8deadSopenharmony_ci There are two distinct BPTC image formats each of which has two 3285bd8deadSopenharmony_ci variants. COMPRESSED_RGBA_BPTC_UNORM_ARB and 3295bd8deadSopenharmony_ci COMPRESSED_SRGB_ALPHA_BPTC_UNORM_ARB compress 8-bit fixed-point 3305bd8deadSopenharmony_ci data. COMPRESSED_RGB_BPTC_SIGNED_FLOAT_ARB and 3315bd8deadSopenharmony_ci COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_ARB compress high dynamic range 3325bd8deadSopenharmony_ci floating point values. The formats are similar, so the description of the 3335bd8deadSopenharmony_ci float format will reference significant sections of the UNORM description. 3345bd8deadSopenharmony_ci 3355bd8deadSopenharmony_ci COMPRESSED_RGBA_BPTC_UNORM_ARB (and the SRGB_ALPHA equivalent): Each 4x4 3365bd8deadSopenharmony_ci block of texels consists of 128 bits of RGBA or SRGB_ALPHA image data. 3375bd8deadSopenharmony_ci 3385bd8deadSopenharmony_ci Each block contains enough information to select and decode a pair of 3395bd8deadSopenharmony_ci colors called endpoints, interpolate between those endpoints in a variety 3405bd8deadSopenharmony_ci of ways, then remap the result into the final output. 3415bd8deadSopenharmony_ci 3425bd8deadSopenharmony_ci Each block can contain data in one of eight modes. The mode is identified 3435bd8deadSopenharmony_ci by the lowest bits of the lowest byte. It is encoded as zero or more zeros 3445bd8deadSopenharmony_ci followed by a one. For example, using x to indicate a bit not included in 3455bd8deadSopenharmony_ci the mode number, mode 0 is encoded as xxxxxxx1 in the low byte in binary, 3465bd8deadSopenharmony_ci mode 5 is xx100000, and mode 7 is 10000000. Encoding the low byte as zero 3475bd8deadSopenharmony_ci is reserved and should not be used when encoding a BPTC texture. 3485bd8deadSopenharmony_ci 3495bd8deadSopenharmony_ci All further decoding is driven by the values derived from the mode listed 3505bd8deadSopenharmony_ci in Table.M below. The fields in the block are always in the same order for 3515bd8deadSopenharmony_ci all modes. Starting at the lowest bit after the mode and going up from LSB 3525bd8deadSopenharmony_ci to MSB in byte stream order, these fields are: partition number, rotation, 3535bd8deadSopenharmony_ci index selection, color, alpha, per-endpoint P-bit, shared P-bit, primary 3545bd8deadSopenharmony_ci indices, and secondary indices. The number of bits to be read in each 3555bd8deadSopenharmony_ci field is determined directly from the table. 3565bd8deadSopenharmony_ci 3575bd8deadSopenharmony_ci Each block can be divided into between 1 and 3 groups of pixels with 3585bd8deadSopenharmony_ci independent compression parameters called subsets. A texel in a block with 3595bd8deadSopenharmony_ci one subset is always considered to be in subset zero. Otherwise, a number 3605bd8deadSopenharmony_ci determined by the number of partition bits is used to look up in the 3615bd8deadSopenharmony_ci partition tables Table.P2 or Table.P3 for 2 and 3 subsets 3625bd8deadSopenharmony_ci respectively. This partitioning is indexed by the X and Y within the block 3635bd8deadSopenharmony_ci to generate the subset index. 3645bd8deadSopenharmony_ci 3655bd8deadSopenharmony_ci Each block has two colors for each subset, stored first by endpoint, then 3665bd8deadSopenharmony_ci by subset, then by color. For example, a format with two subsets and five 3675bd8deadSopenharmony_ci color bits would have five bits of red for endpoint 0 of the first subset, 3685bd8deadSopenharmony_ci then five bits of red for endpoint 1, then the two ends of the second 3695bd8deadSopenharmony_ci subset, then green and blue stored similarly. If a block has non-zero 3705bd8deadSopenharmony_ci alpha bits, the alpha data follows the color data with the same 3715bd8deadSopenharmony_ci organization. If not, alpha is overridden to 1.0. These bits are treated 3725bd8deadSopenharmony_ci as the high bits of a fixed-point value in a byte. If the format has 3735bd8deadSopenharmony_ci shared P-bits, there are two endpoint bits, the lower of which applies to 3745bd8deadSopenharmony_ci both endpoints of subset 0 and the upper of which applies to both 3755bd8deadSopenharmony_ci endpoints of subset 1. If the format has a per-endpoint P-bits, then there 3765bd8deadSopenharmony_ci are 2*subsets P-bits stored in the same order as color and alpha. Both 3775bd8deadSopenharmony_ci kinds of P-bits are added as a bit below the color data stored in the 3785bd8deadSopenharmony_ci byte. So, for a format with 5 red bits, the P-bit ends up in bit 2. For 3795bd8deadSopenharmony_ci final scaling, the top bits of the value are replicated into any remaining 3805bd8deadSopenharmony_ci bits in the byte. For the preceding example, bits 6 and 7 would be written 3815bd8deadSopenharmony_ci to bits 0 and 1. 3825bd8deadSopenharmony_ci 3835bd8deadSopenharmony_ci The endpoint colors are interpolated using index values stored in the 3845bd8deadSopenharmony_ci block. The index bits are stored in x-major order. Each index has the 3855bd8deadSopenharmony_ci number of bits indicated by the mode except for one special index per 3865bd8deadSopenharmony_ci subset called the anchor index. Since the ordering of the endpoints is 3875bd8deadSopenharmony_ci unimportant, we can save one bit on one index per subset by ordering the 3885bd8deadSopenharmony_ci endpoints such that the highest bit is guaranteed to be zero. In partition 3895bd8deadSopenharmony_ci zero, the anchor index is always index zero. In other partitions, the 3905bd8deadSopenharmony_ci anchor index is specified by tables Table.A2 and Table.A3. If secondary 3915bd8deadSopenharmony_ci index bits are present, they are read in the same manner. The anchor index 3925bd8deadSopenharmony_ci information is only used to determine the number of bits each index has 3935bd8deadSopenharmony_ci when it's read from the block data. 3945bd8deadSopenharmony_ci 3955bd8deadSopenharmony_ci The endpoint color and alpha values used for final interpolation are the 3965bd8deadSopenharmony_ci decoded values corresponding to the applicable subset as selected 3975bd8deadSopenharmony_ci above. The index value for interpolating color comes from the secondary 3985bd8deadSopenharmony_ci index for the texel if the format has an index selection bit and its value 3995bd8deadSopenharmony_ci is one and from the primary index otherwise. The alpha index comes from 4005bd8deadSopenharmony_ci the secondary index if the block has a secondary index and the block 4015bd8deadSopenharmony_ci either doesn't have an index selection bit or that bit is zero and the 4025bd8deadSopenharmony_ci primary index otherwise. 4035bd8deadSopenharmony_ci 4045bd8deadSopenharmony_ci Interpolation is always performed using a 6-bit interpolation factor. The 4055bd8deadSopenharmony_ci effective interpolation factors for 2, 3, and 4 bit indices are given 4065bd8deadSopenharmony_ci below: 4075bd8deadSopenharmony_ci 4085bd8deadSopenharmony_ci 2: 0, 21, 43, 64 4095bd8deadSopenharmony_ci 3: 0, 9, 18, 27, 37, 46, 55, 64 4105bd8deadSopenharmony_ci 4: 0, 4, 9, 13, 17, 21, 26, 30, 34, 38, 43, 47, 51, 55, 60, 64 4115bd8deadSopenharmony_ci 4125bd8deadSopenharmony_ci The interpolation results in an RGBA color. If rotation bits are present, 4135bd8deadSopenharmony_ci this color is remapped according to: 4145bd8deadSopenharmony_ci 4155bd8deadSopenharmony_ci 0: no change 4165bd8deadSopenharmony_ci 1: swap(a,r) 4175bd8deadSopenharmony_ci 2: swap(a,g) 4185bd8deadSopenharmony_ci 3: swap(a,b) 4195bd8deadSopenharmony_ci 4205bd8deadSopenharmony_ci These 8-bit values show up in the shader interpreted as either RGBA8 or 4215bd8deadSopenharmony_ci SRGB8_ALPHA8 for COMPRESSED_RGBA_BPTC_UNORM_ARB and 4225bd8deadSopenharmony_ci COMPRESSED_SRGB_ALPHA_BPTC_UNORM_ARB respectively. 4235bd8deadSopenharmony_ci 4245bd8deadSopenharmony_ci 4255bd8deadSopenharmony_ci Table.M 4265bd8deadSopenharmony_ci 4275bd8deadSopenharmony_ci Mode NS PB RB ISB CB AB EPB SPB IB IB2 4285bd8deadSopenharmony_ci ---- -- -- -- --- -- -- --- --- -- --- 4295bd8deadSopenharmony_ci 0 3 4 0 0 4 0 1 0 3 0 4305bd8deadSopenharmony_ci 1 2 6 0 0 6 0 0 1 3 0 4315bd8deadSopenharmony_ci 2 3 6 0 0 5 0 0 0 2 0 4325bd8deadSopenharmony_ci 3 2 6 0 0 7 0 1 0 2 0 4335bd8deadSopenharmony_ci 4 1 0 2 1 5 6 0 0 2 3 4345bd8deadSopenharmony_ci 5 1 0 2 0 7 8 0 0 2 2 4355bd8deadSopenharmony_ci 6 1 0 0 0 7 7 1 0 4 0 4365bd8deadSopenharmony_ci 7 2 6 0 0 5 5 1 0 2 0 4375bd8deadSopenharmony_ci 4385bd8deadSopenharmony_ci The columns are as as follows: 4395bd8deadSopenharmony_ci 4405bd8deadSopenharmony_ci Mode: As described above 4415bd8deadSopenharmony_ci 4425bd8deadSopenharmony_ci NS: Number of subsets in each partition 4435bd8deadSopenharmony_ci 4445bd8deadSopenharmony_ci PB: Partition bits 4455bd8deadSopenharmony_ci 4465bd8deadSopenharmony_ci RB: Rotation bits 4475bd8deadSopenharmony_ci 4485bd8deadSopenharmony_ci ISB: Index selection bits 4495bd8deadSopenharmony_ci 4505bd8deadSopenharmony_ci CB: Color bits 4515bd8deadSopenharmony_ci 4525bd8deadSopenharmony_ci AB: Alpha bits 4535bd8deadSopenharmony_ci 4545bd8deadSopenharmony_ci EPB: Endpoint P-bits 4555bd8deadSopenharmony_ci 4565bd8deadSopenharmony_ci SPB: Shared P-bits 4575bd8deadSopenharmony_ci 4585bd8deadSopenharmony_ci IB: Index bits per element 4595bd8deadSopenharmony_ci 4605bd8deadSopenharmony_ci IB2: Secondary index bits per element 4615bd8deadSopenharmony_ci 4625bd8deadSopenharmony_ci 4635bd8deadSopenharmony_ci Table.P2 4645bd8deadSopenharmony_ci 4655bd8deadSopenharmony_ci (each row is one 4x4 block) 4665bd8deadSopenharmony_ci 4675bd8deadSopenharmony_ci 4685bd8deadSopenharmony_ci 0,0,1,1,0,0,1,1,0,0,1,1,0,0,1,1 4695bd8deadSopenharmony_ci 0,0,0,1,0,0,0,1,0,0,0,1,0,0,0,1 4705bd8deadSopenharmony_ci 0,1,1,1,0,1,1,1,0,1,1,1,0,1,1,1 4715bd8deadSopenharmony_ci 0,0,0,1,0,0,1,1,0,0,1,1,0,1,1,1 4725bd8deadSopenharmony_ci 0,0,0,0,0,0,0,1,0,0,0,1,0,0,1,1 4735bd8deadSopenharmony_ci 0,0,1,1,0,1,1,1,0,1,1,1,1,1,1,1 4745bd8deadSopenharmony_ci 0,0,0,1,0,0,1,1,0,1,1,1,1,1,1,1 4755bd8deadSopenharmony_ci 0,0,0,0,0,0,0,1,0,0,1,1,0,1,1,1 4765bd8deadSopenharmony_ci 0,0,0,0,0,0,0,0,0,0,0,1,0,0,1,1 4775bd8deadSopenharmony_ci 0,0,1,1,0,1,1,1,1,1,1,1,1,1,1,1 4785bd8deadSopenharmony_ci 0,0,0,0,0,0,0,1,0,1,1,1,1,1,1,1 4795bd8deadSopenharmony_ci 0,0,0,0,0,0,0,0,0,0,0,1,0,1,1,1 4805bd8deadSopenharmony_ci 0,0,0,1,0,1,1,1,1,1,1,1,1,1,1,1 4815bd8deadSopenharmony_ci 0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1 4825bd8deadSopenharmony_ci 0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1 4835bd8deadSopenharmony_ci 0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1 4845bd8deadSopenharmony_ci 0,0,0,0,1,0,0,0,1,1,1,0,1,1,1,1 4855bd8deadSopenharmony_ci 0,1,1,1,0,0,0,1,0,0,0,0,0,0,0,0 4865bd8deadSopenharmony_ci 0,0,0,0,0,0,0,0,1,0,0,0,1,1,1,0 4875bd8deadSopenharmony_ci 0,1,1,1,0,0,1,1,0,0,0,1,0,0,0,0 4885bd8deadSopenharmony_ci 0,0,1,1,0,0,0,1,0,0,0,0,0,0,0,0 4895bd8deadSopenharmony_ci 0,0,0,0,1,0,0,0,1,1,0,0,1,1,1,0 4905bd8deadSopenharmony_ci 0,0,0,0,0,0,0,0,1,0,0,0,1,1,0,0 4915bd8deadSopenharmony_ci 0,1,1,1,0,0,1,1,0,0,1,1,0,0,0,1 4925bd8deadSopenharmony_ci 0,0,1,1,0,0,0,1,0,0,0,1,0,0,0,0 4935bd8deadSopenharmony_ci 0,0,0,0,1,0,0,0,1,0,0,0,1,1,0,0 4945bd8deadSopenharmony_ci 0,1,1,0,0,1,1,0,0,1,1,0,0,1,1,0 4955bd8deadSopenharmony_ci 0,0,1,1,0,1,1,0,0,1,1,0,1,1,0,0 4965bd8deadSopenharmony_ci 0,0,0,1,0,1,1,1,1,1,1,0,1,0,0,0 4975bd8deadSopenharmony_ci 0,0,0,0,1,1,1,1,1,1,1,1,0,0,0,0 4985bd8deadSopenharmony_ci 0,1,1,1,0,0,0,1,1,0,0,0,1,1,1,0 4995bd8deadSopenharmony_ci 0,0,1,1,1,0,0,1,1,0,0,1,1,1,0,0 5005bd8deadSopenharmony_ci 0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1 5015bd8deadSopenharmony_ci 0,0,0,0,1,1,1,1,0,0,0,0,1,1,1,1 5025bd8deadSopenharmony_ci 0,1,0,1,1,0,1,0,0,1,0,1,1,0,1,0 5035bd8deadSopenharmony_ci 0,0,1,1,0,0,1,1,1,1,0,0,1,1,0,0 5045bd8deadSopenharmony_ci 0,0,1,1,1,1,0,0,0,0,1,1,1,1,0,0 5055bd8deadSopenharmony_ci 0,1,0,1,0,1,0,1,1,0,1,0,1,0,1,0 5065bd8deadSopenharmony_ci 0,1,1,0,1,0,0,1,0,1,1,0,1,0,0,1 5075bd8deadSopenharmony_ci 0,1,0,1,1,0,1,0,1,0,1,0,0,1,0,1 5085bd8deadSopenharmony_ci 0,1,1,1,0,0,1,1,1,1,0,0,1,1,1,0 5095bd8deadSopenharmony_ci 0,0,0,1,0,0,1,1,1,1,0,0,1,0,0,0 5105bd8deadSopenharmony_ci 0,0,1,1,0,0,1,0,0,1,0,0,1,1,0,0 5115bd8deadSopenharmony_ci 0,0,1,1,1,0,1,1,1,1,0,1,1,1,0,0 5125bd8deadSopenharmony_ci 0,1,1,0,1,0,0,1,1,0,0,1,0,1,1,0 5135bd8deadSopenharmony_ci 0,0,1,1,1,1,0,0,1,1,0,0,0,0,1,1 5145bd8deadSopenharmony_ci 0,1,1,0,0,1,1,0,1,0,0,1,1,0,0,1 5155bd8deadSopenharmony_ci 0,0,0,0,0,1,1,0,0,1,1,0,0,0,0,0 5165bd8deadSopenharmony_ci 0,1,0,0,1,1,1,0,0,1,0,0,0,0,0,0 5175bd8deadSopenharmony_ci 0,0,1,0,0,1,1,1,0,0,1,0,0,0,0,0 5185bd8deadSopenharmony_ci 0,0,0,0,0,0,1,0,0,1,1,1,0,0,1,0 5195bd8deadSopenharmony_ci 0,0,0,0,0,1,0,0,1,1,1,0,0,1,0,0 5205bd8deadSopenharmony_ci 0,1,1,0,1,1,0,0,1,0,0,1,0,0,1,1 5215bd8deadSopenharmony_ci 0,0,1,1,0,1,1,0,1,1,0,0,1,0,0,1 5225bd8deadSopenharmony_ci 0,1,1,0,0,0,1,1,1,0,0,1,1,1,0,0 5235bd8deadSopenharmony_ci 0,0,1,1,1,0,0,1,1,1,0,0,0,1,1,0 5245bd8deadSopenharmony_ci 0,1,1,0,1,1,0,0,1,1,0,0,1,0,0,1 5255bd8deadSopenharmony_ci 0,1,1,0,0,0,1,1,0,0,1,1,1,0,0,1 5265bd8deadSopenharmony_ci 0,1,1,1,1,1,1,0,1,0,0,0,0,0,0,1 5275bd8deadSopenharmony_ci 0,0,0,1,1,0,0,0,1,1,1,0,0,1,1,1 5285bd8deadSopenharmony_ci 0,0,0,0,1,1,1,1,0,0,1,1,0,0,1,1 5295bd8deadSopenharmony_ci 0,0,1,1,0,0,1,1,1,1,1,1,0,0,0,0 5305bd8deadSopenharmony_ci 0,0,1,0,0,0,1,0,1,1,1,0,1,1,1,0 5315bd8deadSopenharmony_ci 0,1,0,0,0,1,0,0,0,1,1,1,0,1,1,1 5325bd8deadSopenharmony_ci 5335bd8deadSopenharmony_ci Table.P3 5345bd8deadSopenharmony_ci 5355bd8deadSopenharmony_ci 0,0,1,1,0,0,1,1,0,2,2,1,2,2,2,2 5365bd8deadSopenharmony_ci 0,0,0,1,0,0,1,1,2,2,1,1,2,2,2,1 5375bd8deadSopenharmony_ci 0,0,0,0,2,0,0,1,2,2,1,1,2,2,1,1 5385bd8deadSopenharmony_ci 0,2,2,2,0,0,2,2,0,0,1,1,0,1,1,1 5395bd8deadSopenharmony_ci 0,0,0,0,0,0,0,0,1,1,2,2,1,1,2,2 5405bd8deadSopenharmony_ci 0,0,1,1,0,0,1,1,0,0,2,2,0,0,2,2 5415bd8deadSopenharmony_ci 0,0,2,2,0,0,2,2,1,1,1,1,1,1,1,1 5425bd8deadSopenharmony_ci 0,0,1,1,0,0,1,1,2,2,1,1,2,2,1,1 5435bd8deadSopenharmony_ci 0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2 5445bd8deadSopenharmony_ci 0,0,0,0,1,1,1,1,1,1,1,1,2,2,2,2 5455bd8deadSopenharmony_ci 0,0,0,0,1,1,1,1,2,2,2,2,2,2,2,2 5465bd8deadSopenharmony_ci 0,0,1,2,0,0,1,2,0,0,1,2,0,0,1,2 5475bd8deadSopenharmony_ci 0,1,1,2,0,1,1,2,0,1,1,2,0,1,1,2 5485bd8deadSopenharmony_ci 0,1,2,2,0,1,2,2,0,1,2,2,0,1,2,2 5495bd8deadSopenharmony_ci 0,0,1,1,0,1,1,2,1,1,2,2,1,2,2,2 5505bd8deadSopenharmony_ci 0,0,1,1,2,0,0,1,2,2,0,0,2,2,2,0 5515bd8deadSopenharmony_ci 0,0,0,1,0,0,1,1,0,1,1,2,1,1,2,2 5525bd8deadSopenharmony_ci 0,1,1,1,0,0,1,1,2,0,0,1,2,2,0,0 5535bd8deadSopenharmony_ci 0,0,0,0,1,1,2,2,1,1,2,2,1,1,2,2 5545bd8deadSopenharmony_ci 0,0,2,2,0,0,2,2,0,0,2,2,1,1,1,1 5555bd8deadSopenharmony_ci 0,1,1,1,0,1,1,1,0,2,2,2,0,2,2,2 5565bd8deadSopenharmony_ci 0,0,0,1,0,0,0,1,2,2,2,1,2,2,2,1 5575bd8deadSopenharmony_ci 0,0,0,0,0,0,1,1,0,1,2,2,0,1,2,2 5585bd8deadSopenharmony_ci 0,0,0,0,1,1,0,0,2,2,1,0,2,2,1,0 5595bd8deadSopenharmony_ci 0,1,2,2,0,1,2,2,0,0,1,1,0,0,0,0 5605bd8deadSopenharmony_ci 0,0,1,2,0,0,1,2,1,1,2,2,2,2,2,2 5615bd8deadSopenharmony_ci 0,1,1,0,1,2,2,1,1,2,2,1,0,1,1,0 5625bd8deadSopenharmony_ci 0,0,0,0,0,1,1,0,1,2,2,1,1,2,2,1 5635bd8deadSopenharmony_ci 0,0,2,2,1,1,0,2,1,1,0,2,0,0,2,2 5645bd8deadSopenharmony_ci 0,1,1,0,0,1,1,0,2,0,0,2,2,2,2,2 5655bd8deadSopenharmony_ci 0,0,1,1,0,1,2,2,0,1,2,2,0,0,1,1 5665bd8deadSopenharmony_ci 0,0,0,0,2,0,0,0,2,2,1,1,2,2,2,1 5675bd8deadSopenharmony_ci 0,0,0,0,0,0,0,2,1,1,2,2,1,2,2,2 5685bd8deadSopenharmony_ci 0,2,2,2,0,0,2,2,0,0,1,2,0,0,1,1 5695bd8deadSopenharmony_ci 0,0,1,1,0,0,1,2,0,0,2,2,0,2,2,2 5705bd8deadSopenharmony_ci 0,1,2,0,0,1,2,0,0,1,2,0,0,1,2,0 5715bd8deadSopenharmony_ci 0,0,0,0,1,1,1,1,2,2,2,2,0,0,0,0 5725bd8deadSopenharmony_ci 0,1,2,0,1,2,0,1,2,0,1,2,0,1,2,0 5735bd8deadSopenharmony_ci 0,1,2,0,2,0,1,2,1,2,0,1,0,1,2,0 5745bd8deadSopenharmony_ci 0,0,1,1,2,2,0,0,1,1,2,2,0,0,1,1 5755bd8deadSopenharmony_ci 0,0,1,1,1,1,2,2,2,2,0,0,0,0,1,1 5765bd8deadSopenharmony_ci 0,1,0,1,0,1,0,1,2,2,2,2,2,2,2,2 5775bd8deadSopenharmony_ci 0,0,0,0,0,0,0,0,2,1,2,1,2,1,2,1 5785bd8deadSopenharmony_ci 0,0,2,2,1,1,2,2,0,0,2,2,1,1,2,2 5795bd8deadSopenharmony_ci 0,0,2,2,0,0,1,1,0,0,2,2,0,0,1,1 5805bd8deadSopenharmony_ci 0,2,2,0,1,2,2,1,0,2,2,0,1,2,2,1 5815bd8deadSopenharmony_ci 0,1,0,1,2,2,2,2,2,2,2,2,0,1,0,1 5825bd8deadSopenharmony_ci 0,0,0,0,2,1,2,1,2,1,2,1,2,1,2,1 5835bd8deadSopenharmony_ci 0,1,0,1,0,1,0,1,0,1,0,1,2,2,2,2 5845bd8deadSopenharmony_ci 0,2,2,2,0,1,1,1,0,2,2,2,0,1,1,1 5855bd8deadSopenharmony_ci 0,0,0,2,1,1,1,2,0,0,0,2,1,1,1,2 5865bd8deadSopenharmony_ci 0,0,0,0,2,1,1,2,2,1,1,2,2,1,1,2 5875bd8deadSopenharmony_ci 0,2,2,2,0,1,1,1,0,1,1,1,0,2,2,2 5885bd8deadSopenharmony_ci 0,0,0,2,1,1,1,2,1,1,1,2,0,0,0,2 5895bd8deadSopenharmony_ci 0,1,1,0,0,1,1,0,0,1,1,0,2,2,2,2 5905bd8deadSopenharmony_ci 0,0,0,0,0,0,0,0,2,1,1,2,2,1,1,2 5915bd8deadSopenharmony_ci 0,1,1,0,0,1,1,0,2,2,2,2,2,2,2,2 5925bd8deadSopenharmony_ci 0,0,2,2,0,0,1,1,0,0,1,1,0,0,2,2 5935bd8deadSopenharmony_ci 0,0,2,2,1,1,2,2,1,1,2,2,0,0,2,2 5945bd8deadSopenharmony_ci 0,0,0,0,0,0,0,0,0,0,0,0,2,1,1,2 5955bd8deadSopenharmony_ci 0,0,0,2,0,0,0,1,0,0,0,2,0,0,0,1 5965bd8deadSopenharmony_ci 0,2,2,2,1,2,2,2,0,2,2,2,1,2,2,2 5975bd8deadSopenharmony_ci 0,1,0,1,2,2,2,2,2,2,2,2,2,2,2,2 5985bd8deadSopenharmony_ci 0,1,1,1,2,0,1,1,2,2,0,1,2,2,2,0 5995bd8deadSopenharmony_ci 6005bd8deadSopenharmony_ci Table.A2 (Anchor index values for the second subset of two-subset 6015bd8deadSopenharmony_ci partitioning) 6025bd8deadSopenharmony_ci 6035bd8deadSopenharmony_ci (wrapped for readability - values run right then down) 6045bd8deadSopenharmony_ci 6055bd8deadSopenharmony_ci 15,15,15,15,15,15,15,15, 6065bd8deadSopenharmony_ci 15,15,15,15,15,15,15,15, 6075bd8deadSopenharmony_ci 15, 2, 8, 2, 2, 8, 8,15, 6085bd8deadSopenharmony_ci 2, 8, 2, 2, 8, 8, 2, 2, 6095bd8deadSopenharmony_ci 15,15, 6, 8, 2, 8,15,15, 6105bd8deadSopenharmony_ci 2, 8, 2, 2, 2,15,15, 6, 6115bd8deadSopenharmony_ci 6, 2, 6, 8,15,15, 2, 2, 6125bd8deadSopenharmony_ci 15,15,15,15,15, 2, 2,15, 6135bd8deadSopenharmony_ci 6145bd8deadSopenharmony_ci Table.A3a (Anchor index values for the second subset of three-subset 6155bd8deadSopenharmony_ci partitioning) 6165bd8deadSopenharmony_ci 6175bd8deadSopenharmony_ci (wrapped for readability - values run right then down) 6185bd8deadSopenharmony_ci 6195bd8deadSopenharmony_ci 3, 3,15,15, 8, 3,15,15, 6205bd8deadSopenharmony_ci 8, 8, 6, 6, 6, 5, 3, 3, 6215bd8deadSopenharmony_ci 3, 3, 8,15, 3, 3, 6,10, 6225bd8deadSopenharmony_ci 5, 8, 8, 6, 8, 5,15,15, 6235bd8deadSopenharmony_ci 8,15, 3, 5, 6,10, 8,15, 6245bd8deadSopenharmony_ci 15, 3,15, 5,15,15,15,15, 6255bd8deadSopenharmony_ci 3,15, 5, 5, 5, 8, 5,10, 6265bd8deadSopenharmony_ci 5,10, 8,13,15,12, 3, 3, 6275bd8deadSopenharmony_ci 6285bd8deadSopenharmony_ci Table.A3b (Anchor index values for the third subset of three-subset 6295bd8deadSopenharmony_ci partitioning) 6305bd8deadSopenharmony_ci 6315bd8deadSopenharmony_ci (wrapped for readability - values run right then down) 6325bd8deadSopenharmony_ci 6335bd8deadSopenharmony_ci 15, 8, 8, 3,15,15, 3, 8, 6345bd8deadSopenharmony_ci 15,15,15,15,15,15,15, 8, 6355bd8deadSopenharmony_ci 15, 8,15, 3,15, 8,15, 8, 6365bd8deadSopenharmony_ci 3,15, 6,10,15,15,10, 8, 6375bd8deadSopenharmony_ci 15, 3,15,10,10, 8, 9,10, 6385bd8deadSopenharmony_ci 6,15, 8,15, 3, 6, 6, 8, 6395bd8deadSopenharmony_ci 15, 3,15,15,15,15,15,15, 6405bd8deadSopenharmony_ci 15,15,15,15, 3,15,15, 8, 6415bd8deadSopenharmony_ci 6425bd8deadSopenharmony_ci COMPRESSED_RGB_BPTC_SIGNED_FLOAT_ARB and 6435bd8deadSopenharmony_ci COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_ARB: Each 4x4 block of texels consists 6445bd8deadSopenharmony_ci of 128 bits of RGB data. These formats are very similar and will be 6455bd8deadSopenharmony_ci described together. In the description and pseudocode below, <signed> will 6465bd8deadSopenharmony_ci be used as a condition which is true for the SIGNED format and false for 6475bd8deadSopenharmony_ci the UNSIGNED format. Both formats only contain RGB data, so the returned 6485bd8deadSopenharmony_ci alpha value is 1.0. If a block uses a reserved or invalid encoding, the 6495bd8deadSopenharmony_ci return value is (0,0,0,1). 6505bd8deadSopenharmony_ci 6515bd8deadSopenharmony_ci Each block can contain data in one of 14 modes. The mode number is encoded 6525bd8deadSopenharmony_ci in either the low two bits or the low five bits. If the low two bits are 6535bd8deadSopenharmony_ci less than two, that is the mode number, otherwise the low five bits the 6545bd8deadSopenharmony_ci mode number. Mode numbers not listed in Table.MF are reserved (19, 23, 27, 6555bd8deadSopenharmony_ci and 31). 6565bd8deadSopenharmony_ci 6575bd8deadSopenharmony_ci The data for the compressed blocks is stored in a different format for 6585bd8deadSopenharmony_ci each mode. The formats are specified in Table.F. The format strings are 6595bd8deadSopenharmony_ci intended to be read from left to right with the LSB on the left. Each 6605bd8deadSopenharmony_ci element is of the form v[a:b]. If a>=b, this indicates to extract b-a+1 6615bd8deadSopenharmony_ci bits from the block at that location and put it in the corresponding bits 6625bd8deadSopenharmony_ci of the variable v. If a<b, then the bits are reversed. v[a] is used as a 6635bd8deadSopenharmony_ci shorthand for the one bit v[a:a]. As an example, m[1:0],g2[4] would move 6645bd8deadSopenharmony_ci the low two bits from the block into the low two bits of m then the next 6655bd8deadSopenharmony_ci bit of the block into bit 4 of g2. The variable names given in the table 6665bd8deadSopenharmony_ci will be referred to in the language below. 6675bd8deadSopenharmony_ci 6685bd8deadSopenharmony_ci Subsets and indices work in much the same way as described for the 6695bd8deadSopenharmony_ci fixed-point formats above. If a float block has no partition bits, then it 6705bd8deadSopenharmony_ci is a single-subset block. If it has partition bits, then it is a 2 subset 6715bd8deadSopenharmony_ci block. The partition index references the first half of Table.P2. Indices 6725bd8deadSopenharmony_ci are read in the same way as the fixed-point formats including obeying the 6735bd8deadSopenharmony_ci anchor values for index 0 and as needed by Table.A2. 6745bd8deadSopenharmony_ci 6755bd8deadSopenharmony_ci In a single-subset blocks, the two endpoints are contained in r0,g0,b0 6765bd8deadSopenharmony_ci (hence e0) and r1,g1,b1 (hence e1). In a two-subset block, the endpoints 6775bd8deadSopenharmony_ci for the second subset are in r2,g2,b2 and r3,g3,b3. The value in e0 is 6785bd8deadSopenharmony_ci sign-extended if the format of the texture is signed. The values in e1 and 6795bd8deadSopenharmony_ci e2 and e3 if the block is two-subset are sign-extended if the format of 6805bd8deadSopenharmony_ci the texture is signed or if the block mode has transformed endpoints. If 6815bd8deadSopenharmony_ci the mode has transformed endpoints, the values from e0 are used as a base 6825bd8deadSopenharmony_ci to offset all other endpoints, wrapped at the number of endpoint bits. For 6835bd8deadSopenharmony_ci example, r1 = (r0+r1) & ((1<<EPB)-1). 6845bd8deadSopenharmony_ci 6855bd8deadSopenharmony_ci Next, the endpoints are unquantized to maximize the usage of the bits and 6865bd8deadSopenharmony_ci to ensure that the negative ranges are oriented properly to interpolate as 6875bd8deadSopenharmony_ci a two's complement value. The following pseudocode assumes the computation 6885bd8deadSopenharmony_ci is being done using sufficiently large intermediate values to avoid 6895bd8deadSopenharmony_ci overflow. For the unsigned float format, we unquantize a value x to unq 6905bd8deadSopenharmony_ci by: 6915bd8deadSopenharmony_ci 6925bd8deadSopenharmony_ci if (EPB >= 15) 6935bd8deadSopenharmony_ci unq = x; 6945bd8deadSopenharmony_ci else if (x == 0) 6955bd8deadSopenharmony_ci unq = 0; 6965bd8deadSopenharmony_ci else if (x == ((1<<EPB)-1)) 6975bd8deadSopenharmony_ci unq = 0xFFFF; 6985bd8deadSopenharmony_ci else 6995bd8deadSopenharmony_ci unq = ((x << 15) + 0x4000) >> (EPB-1); 7005bd8deadSopenharmony_ci 7015bd8deadSopenharmony_ci The signed float unquantization is similar, but needs to worry about 7025bd8deadSopenharmony_ci orienting the negative range: 7035bd8deadSopenharmony_ci 7045bd8deadSopenharmony_ci s = 0; 7055bd8deadSopenharmony_ci if (EPB >= 16) 7065bd8deadSopenharmony_ci unq = x; 7075bd8deadSopenharmony_ci else { 7085bd8deadSopenharmony_ci if (x < 0) { 7095bd8deadSopenharmony_ci s = 1; 7105bd8deadSopenharmony_ci x = -x; 7115bd8deadSopenharmony_ci } 7125bd8deadSopenharmony_ci 7135bd8deadSopenharmony_ci if (x == 0) 7145bd8deadSopenharmony_ci unq = 0; 7155bd8deadSopenharmony_ci else if (x >= ((1<<(EPB-1))-1)) 7165bd8deadSopenharmony_ci unq = 0x7FFF; 7175bd8deadSopenharmony_ci else 7185bd8deadSopenharmony_ci unq = ((x << 15) + 0x4000) >> (EPB-1); 7195bd8deadSopenharmony_ci 7205bd8deadSopenharmony_ci if (s) 7215bd8deadSopenharmony_ci unq = -unq; 7225bd8deadSopenharmony_ci } 7235bd8deadSopenharmony_ci 7245bd8deadSopenharmony_ci After the endpoints are unquantized, interpolation proceeds as in the 7255bd8deadSopenharmony_ci fixed-point formats above including the interpolation weight table. 7265bd8deadSopenharmony_ci 7275bd8deadSopenharmony_ci The interpolated values are passed through a final unquantization 7285bd8deadSopenharmony_ci step. For the unsigned format, this step simply multiplies by 31/64. The 7295bd8deadSopenharmony_ci signed format negates negative components, multiplies by 31/32, then or's 7305bd8deadSopenharmony_ci in the sign bit if the original value was negative. 7315bd8deadSopenharmony_ci 7325bd8deadSopenharmony_ci The resultant value should be a legal 16-bit half float which is then 7335bd8deadSopenharmony_ci returned as a float to the shader. 7345bd8deadSopenharmony_ci 7355bd8deadSopenharmony_ci Table.MF 7365bd8deadSopenharmony_ci 7375bd8deadSopenharmony_ci MN Tr PB EPB Delta Bits 7385bd8deadSopenharmony_ci -- -- -- --- ---------- 7395bd8deadSopenharmony_ci 0 1 5 10 {5, 5, 5} 7405bd8deadSopenharmony_ci 1 1 5 7 {6, 6, 6} 7415bd8deadSopenharmony_ci 2 1 5 11 {5, 4, 4} 7425bd8deadSopenharmony_ci 6 1 5 11 {4, 5, 4} 7435bd8deadSopenharmony_ci 10 1 5 11 {4, 4, 5} 7445bd8deadSopenharmony_ci 14 1 5 9 {5, 5, 5} 7455bd8deadSopenharmony_ci 18 1 5 8 {6, 5, 5} 7465bd8deadSopenharmony_ci 22 1 5 8 {5, 6, 5} 7475bd8deadSopenharmony_ci 26 1 5 8 {5, 5, 6} 7485bd8deadSopenharmony_ci 30 0 5 6 {6, 6, 6} 7495bd8deadSopenharmony_ci 3 0 0 10 {10, 10, 10} 7505bd8deadSopenharmony_ci 7 1 0 11 {9, 9, 9} 7515bd8deadSopenharmony_ci 11 1 0 12 {8, 8, 8} 7525bd8deadSopenharmony_ci 15 1 0 16 {4, 4, 4} 7535bd8deadSopenharmony_ci 7545bd8deadSopenharmony_ci MN: Mode number 7555bd8deadSopenharmony_ci Tr: Transformed endpoints 7565bd8deadSopenharmony_ci PB: Partition bits 7575bd8deadSopenharmony_ci EPB: Endpoint bits 7585bd8deadSopenharmony_ci 7595bd8deadSopenharmony_ci 7605bd8deadSopenharmony_ci Table.F 7615bd8deadSopenharmony_ci 7625bd8deadSopenharmony_ci MN Format 7635bd8deadSopenharmony_ci -- ------------------------------------------------------------------------ 7645bd8deadSopenharmony_ci 0 m[1:0],g2[4],b2[4],b3[4],r0[9:0],g0[9:0],b0[9:0],r1[4:0],g3[4],g2[3:0], 7655bd8deadSopenharmony_ci g1[4:0],b3[0],g3[3:0],b1[4:0],b3[1],b2[3:0],r2[4:0],b3[2],r3[4:0],b3[3] 7665bd8deadSopenharmony_ci 7675bd8deadSopenharmony_ci 1 m[1:0],g2[5],g3[4],g3[5],r0[6:0],b3[0],b3[1],b2[4],g0[6:0],b2[5],b3[2], 7685bd8deadSopenharmony_ci g2[4],b0[6:0],b3[3],b3[5],b3[4],r1[5:0],g2[3:0],g1[5:0],g3[3:0],b1[5:0], 7695bd8deadSopenharmony_ci b2[3:0],r2[5:0],r3[5:0] 7705bd8deadSopenharmony_ci 7715bd8deadSopenharmony_ci 2 m[4:0],r0[9:0],g0[9:0],b0[9:0],r1[4:0],r0[10],g2[3:0],g1[3:0],g0[10], 7725bd8deadSopenharmony_ci b3[0],g3[3:0],b1[3:0],b0[10],b3[1],b2[3:0],r2[4:0],b3[2],r3[4:0],b3[3] 7735bd8deadSopenharmony_ci 7745bd8deadSopenharmony_ci 6 m[4:0],r0[9:0],g0[9:0],b0[9:0],r1[3:0],r0[10],g3[4],g2[3:0],g1[4:0], 7755bd8deadSopenharmony_ci g0[10],g3[3:0],b1[3:0],b0[10],b3[1],b2[3:0],r2[3:0],b3[0],b3[2],r3[3:0], 7765bd8deadSopenharmony_ci g2[4],b3[3] 7775bd8deadSopenharmony_ci 7785bd8deadSopenharmony_ci 10 m[4:0],r0[9:0],g0[9:0],b0[9:0],r1[3:0],r0[10],b2[4],g2[3:0],g1[3:0], 7795bd8deadSopenharmony_ci g0[10],b3[0],g3[3:0],b1[4:0],b0[10],b2[3:0],r2[3:0],b3[1],b3[2],r3[3:0], 7805bd8deadSopenharmony_ci b3[4],b3[3] 7815bd8deadSopenharmony_ci 7825bd8deadSopenharmony_ci 14 m[4:0],r0[8:0],b2[4],g0[8:0],g2[4],b0[8:0],b3[4],r1[4:0],g3[4],g2[3:0], 7835bd8deadSopenharmony_ci g1[4:0],b3[0],g3[3:0],b1[4:0],b3[1],b2[3:0],r2[4:0],b3[2],r3[4:0],b3[3] 7845bd8deadSopenharmony_ci 7855bd8deadSopenharmony_ci 18 m[4:0],r0[7:0],g3[4],b2[4],g0[7:0],b3[2],g2[4],b0[7:0],b3[3],b3[4], 7865bd8deadSopenharmony_ci r1[5:0],g2[3:0],g1[4:0],b3[0],g3[3:0],b1[4:0],b3[1],b2[3:0],r2[5:0], 7875bd8deadSopenharmony_ci r3[5:0] 7885bd8deadSopenharmony_ci 7895bd8deadSopenharmony_ci 22 m[4:0],r0[7:0],b3[0],b2[4],g0[7:0],g2[5],g2[4],b0[7:0],g3[5],b3[4], 7905bd8deadSopenharmony_ci r1[4:0],g3[4],g2[3:0],g1[5:0],g3[3:0],b1[4:0],b3[1],b2[3:0],r2[4:0], 7915bd8deadSopenharmony_ci b3[2],r3[4:0],b3[3] 7925bd8deadSopenharmony_ci 7935bd8deadSopenharmony_ci 26 m[4:0],r0[7:0],b3[1],b2[4],g0[7:0],b2[5],g2[4],b0[7:0],b3[5],b3[4], 7945bd8deadSopenharmony_ci r1[4:0],g3[4],g2[3:0],g1[4:0],b3[0],g3[3:0],b1[5:0],b2[3:0],r2[4:0], 7955bd8deadSopenharmony_ci b3[2],r3[4:0],b3[3] 7965bd8deadSopenharmony_ci 7975bd8deadSopenharmony_ci 30 m[4:0],r0[5:0],g3[4],b3[0],b3[1],b2[4],g0[5:0],g2[5],b2[5],b3[2], 7985bd8deadSopenharmony_ci g2[4],b0[5:0],g3[5],b3[3],b3[5],b3[4],r1[5:0],g2[3:0],g1[5:0],g3[3:0], 7995bd8deadSopenharmony_ci b1[5:0],b2[3:0],r2[5:0],r3[5:0] 8005bd8deadSopenharmony_ci 8015bd8deadSopenharmony_ci 3 m[4:0],r0[9:0],g0[9:0],b0[9:0],r1[9:0],g1[9:0],b1[9:0] 8025bd8deadSopenharmony_ci 8035bd8deadSopenharmony_ci 7 m[4:0],r0[9:0],g0[9:0],b0[9:0],r1[8:0],r0[10],g1[8:0],g0[10],b1[8:0], 8045bd8deadSopenharmony_ci b0[10] 8055bd8deadSopenharmony_ci 8065bd8deadSopenharmony_ci 11 m[4:0],r0[9:0],g0[9:0],b0[9:0],r1[7:0],r0[10:11],g1[7:0],g0[10:11], 8075bd8deadSopenharmony_ci b1[7:0],b0[10:11] 8085bd8deadSopenharmony_ci 8095bd8deadSopenharmony_ci 15 m[4:0],r0[9:0],g0[9:0],b0[9:0],r1[3:0],r0[10:15],g1[3:0],g0[10:15], 8105bd8deadSopenharmony_ci b1[3:0],b0[10:15] 8115bd8deadSopenharmony_ci 8125bd8deadSopenharmony_ci 8135bd8deadSopenharmony_ciIssues 8145bd8deadSopenharmony_ci 8155bd8deadSopenharmony_ci (1) Are both RGB and RGBA versions interesting? 8165bd8deadSopenharmony_ci 8175bd8deadSopenharmony_ci RESOLVED. Not for the unorm formats. Every BPTC mode has a defined 8185bd8deadSopenharmony_ci alpha, so an RGB mode isn't needed. Also, since modes are per-block, a 8195bd8deadSopenharmony_ci given texture can have both RGB1 and RGBA portions. 8205bd8deadSopenharmony_ci 8215bd8deadSopenharmony_ci The float formats don't compress alpha at all, so they only have RGB 8225bd8deadSopenharmony_ci variants, not RGBA. 8235bd8deadSopenharmony_ci 8245bd8deadSopenharmony_ci (2) Put both BC7 and BC6H in the same spec? 8255bd8deadSopenharmony_ci 8265bd8deadSopenharmony_ci RESOLVED. Yes. They share enough that it's worthwhile to amortize the 8275bd8deadSopenharmony_ci "overhead". 8285bd8deadSopenharmony_ci 8295bd8deadSopenharmony_ci (3) Why are there two versions of the float BPTC formats for signed and 8305bd8deadSopenharmony_ci unsigned? Do they pass through the GL differently? 8315bd8deadSopenharmony_ci 8325bd8deadSopenharmony_ci RESOLVED. The unsigned formats are decoded distinctly from signed 8335bd8deadSopenharmony_ci formats, so it is necessary to distinguish between them. 8345bd8deadSopenharmony_ci 8355bd8deadSopenharmony_ci The values still pass through the shader and the pixel path as signed 8365bd8deadSopenharmony_ci floats, but the interpretation of the compressed block changes as 8375bd8deadSopenharmony_ci described. 8385bd8deadSopenharmony_ci 8395bd8deadSopenharmony_ci (4) Should the result of the compressed float formats be half floats or 8405bd8deadSopenharmony_ci single floats? 8415bd8deadSopenharmony_ci 8425bd8deadSopenharmony_ci RESOLVED. The expansion from packed to half to float will be specified 8435bd8deadSopenharmony_ci as part of the decompression process. 8445bd8deadSopenharmony_ci 8455bd8deadSopenharmony_ci (5) What should be expected for a driver compressor for these formats? 8465bd8deadSopenharmony_ci 8475bd8deadSopenharmony_ci RESOLVED: The current best known compression algorithms have to 8485bd8deadSopenharmony_ci exhaustively test all partitionings across all modes. The compressor in 8495bd8deadSopenharmony_ci the GL will have to make a tradeoff between performance and 8505bd8deadSopenharmony_ci quality. Compressing offline is highly recommended. 8515bd8deadSopenharmony_ci 8525bd8deadSopenharmony_ci (6) How should floating point specials (Inf and NaN) be handled in the 8535bd8deadSopenharmony_ci float formats? 8545bd8deadSopenharmony_ci 8555bd8deadSopenharmony_ci RESOLVED: Decompressor will never generate them. Compressor should 8565bd8deadSopenharmony_ci flush to max half float. 8575bd8deadSopenharmony_ci 8585bd8deadSopenharmony_ci (7) Does this spec require bit-exact decompression? 8595bd8deadSopenharmony_ci 8605bd8deadSopenharmony_ci RESOLVED: Yes. 8615bd8deadSopenharmony_ci 8625bd8deadSopenharmony_ci (8) Does the data format depend on the endianness of the system? 8635bd8deadSopenharmony_ci 8645bd8deadSopenharmony_ci RESOLVED: No. The data is interpeted as an endian-independent 8655bd8deadSopenharmony_ci byte stream. 8665bd8deadSopenharmony_ci 8675bd8deadSopenharmony_ci (9) What should be the internal format of the floating-point BPTC format? 8685bd8deadSopenharmony_ci 8695bd8deadSopenharmony_ci RESOLVED: The format has three components, with the alpha component 8705bd8deadSopenharmony_ci mapped to 1.0, just like RGB textures. So we should call it RGB. 8715bd8deadSopenharmony_ci 8725bd8deadSopenharmony_ci In the originally ratified version of this extension (and all versions 8735bd8deadSopenharmony_ci prior to January 20, 2011), such textures were treated as having a base 8745bd8deadSopenharmony_ci internal format of RGBA, where the alpha component was not present in 8755bd8deadSopenharmony_ci the texture and instead is just set to the constant 1.0. Some 8765bd8deadSopenharmony_ci implementations of this extension may also use a base internal format 8775bd8deadSopenharmony_ci of RGBA. 8785bd8deadSopenharmony_ci 8795bd8deadSopenharmony_ci There are very few places where there is a difference between an RGB 8805bd8deadSopenharmony_ci texture and an RGBA texture where alpha is always 1.0. Two known 8815bd8deadSopenharmony_ci differences: 8825bd8deadSopenharmony_ci 8835bd8deadSopenharmony_ci * A compressed "RGB" texture could be used for the generic 8845bd8deadSopenharmony_ci COMPRESSED_RGB format, but an "RGBA" texture should not be. 8855bd8deadSopenharmony_ci However, it seems unlikely that implementations would choose the 8865bd8deadSopenharmony_ci floating-point BPTC format as its generic COMPRESSED_RGB format. 8875bd8deadSopenharmony_ci 8885bd8deadSopenharmony_ci * Using fixed-function fragment shading in the compatibility profile, 8895bd8deadSopenharmony_ci a texture environment mode of REPLACE would leave alpha unmodified 8905bd8deadSopenharmony_ci for RGB base formats but would replace the fragment alpha with the 8915bd8deadSopenharmony_ci texture alpha (constant 1.0 here) for RGBA base formats. 8925bd8deadSopenharmony_ci 8935bd8deadSopenharmony_ciRevision History 8945bd8deadSopenharmony_ci 8955bd8deadSopenharmony_ci Rev. Date Author Changes 8965bd8deadSopenharmony_ci ---- -------- ----------- -------------------------------------------- 8975bd8deadSopenharmony_ci 9 30/10/19 pdaniell Fix shared p-bits specification to match 8985bd8deadSopenharmony_ci DX and the Khronos Data Format spec. 8995bd8deadSopenharmony_ci 9005bd8deadSopenharmony_ci 8 06/06/16 Nanley Chery Reduce the requirements to the minimal set. 9015bd8deadSopenharmony_ci 9025bd8deadSopenharmony_ci 7 01/20/11 pbrown Change the base internal format of the floating- 9035bd8deadSopenharmony_ci point BPTC formats from "RGBA" to "RGB" (bug 9045bd8deadSopenharmony_ci 7231). 9055bd8deadSopenharmony_ci 9065bd8deadSopenharmony_ci 6 01/19/11 Jon Leech Fix state table modification for 9075bd8deadSopenharmony_ci TEXTURE_INTERNAL_FORMAT (Bug 7239). 9085bd8deadSopenharmony_ci 9095bd8deadSopenharmony_ci 5 05/20/10 ewerness Finalize some UNRESOLVED issues 9105bd8deadSopenharmony_ci 9115bd8deadSopenharmony_ci 4 04/09/10 pdaniell Modify for inclusion into OpenGL 4.1. 9125bd8deadSopenharmony_ci 9135bd8deadSopenharmony_ci 3 12/07/09 pdaniell ARBify. 9145bd8deadSopenharmony_ci 9155bd8deadSopenharmony_ci 2 10/13/09 ewerness Fix errors in the anchor index tables caused 9165bd8deadSopenharmony_ci by incorrect conversion scripts and a couple 9175bd8deadSopenharmony_ci typos in the input. 9185bd8deadSopenharmony_ci 9195bd8deadSopenharmony_ci 1 ewerness Internal revisions. 9205bd8deadSopenharmony_ci 921