1Name 2 3 EXT_texture_storage_compression 4 5Name Strings 6 7 GL_EXT_texture_storage_compression 8 9 10Contact 11 12 Jan-Harald Fredriksen (jan-harald.fredriksen 'at' arm.com) 13 14Contributors 15 16 Jan-Harald Fredriksen, Arm 17 Lisa Wu, Arm 18 Anton Berko, Arm 19 Laurie Hedge, Imagination Technologies 20 21Status 22 23 Complete 24 25Version 26 27 Version 1 - November 15, 2021 28 29Number 30 31 OpenGL ES Extension #336 32 33Dependencies 34 35 Requires OpenGL ES 3.0. 36 37 This extension is written based on the wording of the OpenGL ES 3.2 38 Specification. 39 40Overview 41 42 Applications may wish to take advantage of framebuffer compression. Some 43 platforms may support framebuffer compression at fixed bitrates. Such 44 compression algorithms generally produce results that are visually lossless, 45 but the results are typically not bit-exact when compared to a non-compressed 46 result. 47 48 This extension enables applications to opt-in to compression for 49 immutable textures. 50 51New Types 52 53 None. 54 55New Procedures and Functions 56 57 void TexStorageAttribs2DEXT(enum target, sizei levels, enum internalformat, 58 sizei width, sizei height, const int *attrib_list); 59 60 void TexStorageAttribs3DEXT(enum target, sizei levels, enum internalformat, 61 sizei width, sizei height, sizei depth, const int *attrib_list); 62 63 64New Tokens 65 66 New attributes accepted by the <attrib_list> argument of 67 TexStorageAttribs2DEXT and TexStorageAttribs3DEXT, and as the <pname> 68 argument to GetTexParameter*: 69 SURFACE_COMPRESSION_EXT 0x96C0 70 71 New attributes accepted by the <pname> argument of 72 GetInternalformativ: 73 NUM_SURFACE_COMPRESSION_FIXED_RATES_EXT 0x8F6E 74 75 Accepted as attribute values for SURFACE_COMPRESSION_EXT by TexStorageAttribs2DEXT 76 and TexStorageAttribs3DEXT: 77 SURFACE_COMPRESSION_FIXED_RATE_NONE_EXT 0x96C1 78 SURFACE_COMPRESSION_FIXED_RATE_DEFAULT_EXT 0x96C2 79 80 SURFACE_COMPRESSION_FIXED_RATE_1BPC_EXT 0x96C4 81 SURFACE_COMPRESSION_FIXED_RATE_2BPC_EXT 0x96C5 82 SURFACE_COMPRESSION_FIXED_RATE_3BPC_EXT 0x96C6 83 SURFACE_COMPRESSION_FIXED_RATE_4BPC_EXT 0x96C7 84 SURFACE_COMPRESSION_FIXED_RATE_5BPC_EXT 0x96C8 85 SURFACE_COMPRESSION_FIXED_RATE_6BPC_EXT 0x96C9 86 SURFACE_COMPRESSION_FIXED_RATE_7BPC_EXT 0x96CA 87 SURFACE_COMPRESSION_FIXED_RATE_8BPC_EXT 0x96CB 88 SURFACE_COMPRESSION_FIXED_RATE_9BPC_EXT 0x96CC 89 SURFACE_COMPRESSION_FIXED_RATE_10BPC_EXT 0x96CD 90 SURFACE_COMPRESSION_FIXED_RATE_11BPC_EXT 0x96CE 91 SURFACE_COMPRESSION_FIXED_RATE_12BPC_EXT 0x96CF 92 93Additions to Chapter 8 of the OpenGL ES 3.2 Specification (Textures and 94Samplers) 95 96 Add to 8.11.2, "Texture Parameter Queries" 97 98 Add SURFACE_COMPRESSION_EXT to the values accepted by <pname>. 99 100 "Querying <pname> SURFACE_COMPRESSION_EXT returns the fixed-rate 101 compression rate that was actually applied to the texture." 102 103 Add to 8.18, "Immutable-Format Texture Images" section: 104 105 The command 106 107 void TexStorageAttribs2DEXT(enum target, sizei levels, enum internalformat, 108 sizei width, sizei height, const int *attrib_list); 109 110 behaves identically to TexStorage2D, except that additional flags can 111 specified in <attrib_list>. 112 113 Similarly, the command 114 115 void TexStorageAttribs3DEXT(enum target, sizei levels, enum internalformat, 116 sizei width, sizei height, sizei depth, const int *attrib_list); 117 118 behaves identically to TexStorage3D, except that additional flags can be 119 specified in <attrib_list>. 120 121 For TexStorageAttribs2DEXT and TexStorageAttribs3DEXT, <attrib_list> 122 specifies a list of attributes for the texture. 123 124 All attribute names in <attrib_list> are immediately followed by the 125 corresponding value. The list is terminated with GL_NONE. If an 126 attribute is not specified in <attrib_list>, then the default value 127 is used. 128 129 <attrib_list> may be NULL or empty (first attribute is GL_NONE), in which 130 case all attributes assume their default value as described below. 131 132 Attributes that can be specified in <attrib_list> include 133 SURFACE_COMPRESSION_EXT. 134 135 SURFACE_COMPRESSION_EXT specifies if fixed-rate compression can be 136 enabled for the texture. 137 If its value is SURFACE_COMPRESSION_FIXED_RATE_NONE_EXT then fixed-rate 138 compression is disabled. 139 If its value is SURFACE_COMPRESSION_FIXED_RATE_DEFAULT_EXT then the 140 implementation may enable compression at a default, implementation-defined, 141 rate. 142 If its value is SURFACE_COMPRESSION_FIXED_RATE_1BPC_EXT, then the 143 implementation may enable fixed-rate compression with a bitrate of at 144 least 1 bit and less than 2 bits per component. 145 If its value is SURFACE_COMPRESSION_FIXED_RATE_2BPC_EXT, then the 146 implementation may enable fixed-rate compression with a bitrate of at 147 least 2 bits and less than 3 bits per component. 148 If its value is SURFACE_COMPRESSION_FIXED_RATE_3BPC_EXT, then the 149 implementation may enable fixed-rate compression with a bitrate of at 150 least 3 bits and less than 4 bits per component. 151 If its value is SURFACE_COMPRESSION_FIXED_RATE_4BPC_EXT, then the 152 implementation may enable fixed-rate compression with a bitrate of at 153 least 4 bits and less than 5 bit per component. 154 If its value is SURFACE_COMPRESSION_FIXED_RATE_5BPC_EXT, then the 155 implementation may enable fixed-rate compression with a bitrate of at 156 least 5 bits and less than 6 bits per component. 157 If its value is SURFACE_COMPRESSION_FIXED_RATE_6BPC_EXT, then the 158 implementation may enable fixed-rate compression with a bitrate of at 159 least 6 bits and less than 7 bits per component. 160 If its value is SURFACE_COMPRESSION_FIXED_RATE_7BPC_EXT, then the 161 implementation may enable fixed-rate compression with a bitrate of at 162 least 7 bits and less than 8 bits per component. 163 If its value is SURFACE_COMPRESSION_FIXED_RATE_8BPC_EXT, then the 164 implementation may enable fixed-rate compression with a bitrate of at 165 least 8 bits and less than 9 bits per component. 166 If its value is SURFACE_COMPRESSION_FIXED_RATE_9BPC_EXT, then the 167 implementation may enable fixed-rate compression with a bitrate of at 168 least 9 bits and less than 10 bits per component. 169 If its value is SURFACE_COMPRESSION_FIXED_RATE_10BPC_EXT, then the 170 implementation may enable fixed-rate compression with a bitrate of at 171 least 10 bits and less than 11 bits per component. 172 If its value is SURFACE_COMPRESSION_FIXED_RATE_11BPC_EXT, then the 173 implementation may enable fixed-rate compression with a bitrate of at 174 least 11 bits and less than 12 bits per component. 175 If its value is SURFACE_COMPRESSION_FIXED_RATE_12BPC_EXT, then the 176 implementation may enable fixed-rate compression with a bitrate of at 177 least 12 bits per component. 178 179 The default value of SURFACE_COMPRESSION_EXT is 180 SURFACE_COMPRESSION_FIXED_RATE_NONE_EXT. 181 182 If <attrib_list> is neither NULL nor a value described above, the error 183 INVALID_VALUE is generated. 184 185 Fixed-rate compression is done in an implementation-defined manner and may 186 be applied at block granularity. In that case, a write to an individual 187 texel may modify the value of other texels in the same block. 188 189 Modify section 8.23, "Texture Image Loads and Stores": 190 191 Add to the list of errors for BindImageTexture: 192 193 "An INVALID_VALUE error is generated if the value of 194 SURFACE_COMPRESSION_EXT for <texture> is not 195 SURFACE_COMPRESSION_FIXED_RATE_NONE_EXT." 196 197 Add to the bullet list of conditions for when image access is considered invalid: 198 199 " * the value of SURFACE_COMPRESSION_EXT for the texture is not 200 SURFACE_COMPRESSION_FIXED_RATE_NONE_EXT;" 201 202Additions to Chapter 20 of the OpenGL ES 3.2 Specification (Context State Queries) 203 204 Add to the end of section 20.3.1 Internal Format Query Parameters describing 205 supported values for <pname>, their meanings, and their possible return values 206 for GetInternalformativ: 207 208 NUM_SURFACE_COMPRESSION_FIXED_RATES_EXT: The number of fixed-rate compression 209 rates that would be returned by querying SURFACE_COMPRESSION_EXT is returned 210 in <params>. If <internalformat> does not support any fixed-rate compression, 211 zero is returned. 212 213 SURFACE_COMPRESSION_EXT: The fixed-rate compression rates supported for 214 <internalformat> and <target> are written into <params>, in order of 215 ascending bitrates. 216 217Issues 218 219 1. Do we need to specify compression rates in this extension? 220 221 Resolved. Yes. The GL implementation allocates these resources and need to 222 know the compression ratio. 223 224Revision History 225 Version 1, 2021/11/15 226 - Internal revisions 227