1Name 2 3 ANGLE_lossy_etc_decode 4 5Name Strings 6 7 GL_ANGLE_lossy_etc_decode 8 9Contributors 10 11 Minmin Gong (mgong 'at' microsoft.com) 12 13Contacts 14 15 Minmin Gong (mgong 'at' microsoft.com) 16 17Status 18 19 Draft 20 21Version 22 23 Last Modified Date: Nov 25, 2015 24 Author Revision: 1 25 26Number 27 28 TBD 29 30Dependencies 31 32 Requires OpenGL ES 3.0 for ETC2 and EAC formats, or OpenGL ES 2.0 and 33 OES_compressed_ETC1_RGB8_texture for ETC1 format. 34 The extension is written against the OpenGL ES 2.0 specification. 35 36Overview 37 38 Both the OpenGL ES 3.0 specification and OES_compressed_ETC1_RGB8_texture 39 specify that Ericsson Texture Compression (ETC) decoding must not be lossy. 40 The goal of this extension is to allow a lossy decode of 41 compressed textures in the ETC formats in OpenGL ES, for lower memory 42 and bandwidth consumption. 43 44 This extension uses the same ETC compression format as OpenGL ES 3.0 45 and OES_compressed_ETC1_RGB8_texture, with the restriction that the texture 46 dimensions must be a multiple of four (except for mip levels where the 47 dimensions are either 2 or 1). And the requirement that ETC decoding must 48 not be lossy is relaxed. 49 50 See OES_compressed_ETC1_RGB8_texture for a description of the ETC1 format. 51 Also see OpenGL ES 3.0 specification appendix C.2 (ETC Compressed Texture 52 ImageFormats) for a description of ETC2 and EAC formats. 53 54IP Status 55 56 See Ericsson's "IP Statement" 57 58New Procedures and Functions 59 60 None. 61 62New Types 63 64 None. 65 66New Tokens 67 68 Accepted by the <internalformat> parameter of CompressedTexImage2D 69 and the <format> parameter of CompressedTexSubImage2D: 70 71 ETC1_RGB8_LOSSY_DECODE_ANGLE 0x9690 72 COMPRESSED_R11_LOSSY_DECODE_EAC_ANGLE 0x9691 73 COMPRESSED_SIGNED_R11_LOSSY_DECODE_EAC_ANGLE 0x9692 74 COMPRESSED_RG11_LOSSY_DECODE_EAC_ANGLE 0x9693 75 COMPRESSED_SIGNED_RG11_LOSSY_DECODE_EAC_ANGLE 0x9694 76 COMPRESSED_RGB8_LOSSY_DECODE_ETC2_ANGLE 0x9695 77 COMPRESSED_SRGB8_LOSSY_DECODE_ETC2_ANGLE 0x9696 78 COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_LOSSY_DECODE_ETC2_ANGLE 0x9697 79 COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_LOSSY_DECODE_ETC2_ANGLE 0x9698 80 COMPRESSED_RGBA8_LOSSY_DECODE_ETC2_EAC_ANGLE 0x9699 81 COMPRESSED_SRGB8_ALPHA8_LOSSY_DECODE_ETC2_EAC_ANGLE 0x969A 82 83Additions to Chapter 3 of the OpenGL ES 2.0 Specification (Rasterization) 84 85 Add the following to Section 3.7.3 (Compressed Texture Images) 86 (at the end of the description of the CompressedTexImage2D command): 87 88 Compressed Internal Format Base Internal Format 89 ========================== ==================== 90 ETC1_RGB8_LOSSY_DECODE_ANGLE RGB 91 COMPRESSED_R11_LOSSY_DECODE_EAC_ANGLE R 92 COMPRESSED_SIGNED_R11_LOSSY_DECODE_EAC_ANGLE R 93 COMPRESSED_RG11_LOSSY_DECODE_EAC_ANGLE RG 94 COMPRESSED_SIGNED_RG11_LOSSY_DECODE_EAC_ANGLE RG 95 COMPRESSED_RGB8_LOSSY_DECODE_ETC2_ANGLE RGB 96 COMPRESSED_SRGB8_LOSSY_DECODE_ETC2_ANGLE RGB 97 COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_LOSSY_DECODE_ETC2_ANGLE RGBA 98 COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_LOSSY_DECODE_ETC2_ANGLE RGBA 99 COMPRESSED_RGBA8_LOSSY_DECODE_ETC2_EAC_ANGLE RGBA 100 COMPRESSED_SRGB8_ALPHA8_LOSSY_DECODE_ETC2_EAC_ANGLE RGBA 101 102 Table 3.x: Specific Compressed Internal Formats 103 104 If <internalformat> is one of the ETC lossy decode formats listed in 105 Table 3.x, the compressed texture is stored in an unspecified compressed 106 texture format, that may introduce losses of precision in the texture data. 107 The GL and the ETC texture compression algorithm support only 2D images 108 without borders. 109 110 CompressedTexImage2D will produce the INVALID_OPERATION error when 111 <internalformat> is one of the lossy decode ETC-format values from 112 Table 3.x under the following conditions: 113 114 * <border> is non-zero. 115 * <width> is not one, two, nor a multiple of four. 116 * <height> is not one, two, nor a multiple of four. 117 118 Add the following to Section 3.7.3 (Compressed Texture Images) 119 (at the end of the description of the CompressedTexSubImage2D command): 120 121 If the internal format of the texture image being modified is an ETC-format 122 listed in Table 3.x, the compressed texture is stored in an unspecified 123 compressed texture format. The xoffset and yoffset must also be aligned to 124 4x4 texel block boundaries, since ETC encoding makes it difficult to modify 125 non-aligned regions. CompressedTexSubImage2D will result in an 126 INVALID_OPERATION error only if one of the following conditions occurs: 127 128 * <width> is not a multiple of four nor equal to TEXTURE_WIDTH. 129 * <height> is not a multiple of four nor equal to TEXTURE_HEIGHT. 130 * <xoffset> or <yoffset> is not a multiple of four. 131 * <format> does not match the internal format of the texture image 132 being modified. 133 134Errors 135 136 INVALID_OPERATION is generated by CompressedTexImage2D if 137 lossy decode ETC-format is used and <internalformat> is one of the 138 compressed internal formats from Table 3.x and any of the following apply: 139 - <border> is not equal to zero. 140 - <width> is not one, two, nor a multiple of four. 141 - <height> is not one, two, nor a multiple of four. 142 143 INVALID_OPERATION is generated by CompressedTexSubImage2D if 144 lossy decode ETC-format is used and <format> is one of the compressed 145 interal formats from Table 3.x and any of the following apply: 146 - <width> is not a multiple of four nor equal to TEXTURE_WIDTH; 147 - <height> is not a multiple of four nor equal to TEXTURE_HEIGHT; 148 - <xoffset> or <yoffset> is not a multiple of four; 149 - <format> does not match the internal format of the texture image 150 being modified. 151 152New State 153 154 None. 155 156Revision History 157 158 Revision 1, 2015/11/25 - mgong 159 - Initial revision 160