Hash :
3ecaa283
Author :
Date :
2020-05-22T13:52:41
Fix validation of PVRTC compressed texture sizes. The PVRTC format, as pointed out by Le Hoang Quyen and Geoff Lang, uses 4x4 or 8x4 blocks, but due to sampling from adjacent blocks, requires a minimum size of 2x2 blocks per the OpenGL extension: https://www.khronos.org/registry/OpenGL/extensions/IMG/IMG_texture_compression_pvrtc.txt . Thanks to Quyen and Geoff for pointing out the intricacies. Add a helper function to formatutils.cpp which returns the minimum number of blocks (width and height) for a given compressed texture format, and incorporate this into the compressed texture size computation. This patch makes WebKit on ANGLE pass WebGL's PVRTC compressed texture test on iOS hardware. Bug: angleproject:4652 No-Presubmit: True Change-Id: I1046a091321b7948d712d16686ee0cb8795b8c99 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2213676 Commit-Queue: Kenneth Russell <kbr@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org>
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288
{
"B5G6R5_UNORM": {
"fboImplementationInternalFormat": "GL_RGB565"
},
"B5G5R5A1_UNORM": {
"fboImplementationInternalFormat": "GL_RGB5_A1",
"channelStruct": "A1R5G5B5"
},
"B8G8R8X8_UNORM": {
"glInternalFormat": "GL_BGRA8_EXT",
"channelStruct": "B8G8R8X8"
},
"R9G9B9E5_SHAREDEXP": {
"componentType": "float",
"channelStruct": "R9G9B9E5"
},
"B4G4R4A4_UNORM": {
"fboImplementationInternalFormat": "GL_RGBA4",
"channelStruct": "A4R4G4B4"
},
"R8G8B8A8_UNORM_SRGB": {
"channelStruct": "R8G8B8A8SRGB"
},
"R8G8B8A8_TYPELESS": {
"glInternalFormat": "GL_RGBA8"
},
"R8G8B8A8_TYPELESS_SRGB": {
"glInternalFormat": "GL_SRGB8_ALPHA8"
},
"B8G8R8A8_TYPELESS": {
"glInternalFormat": "GL_BGRA8_EXT"
},
"B8G8R8A8_TYPELESS_SRGB": {
"glInternalFormat": "GL_BGRA8_SRGB_ANGLEX"
},
"ASTC_4x4_SRGB_BLOCK": {
"blockPixelBytes": "16"
},
"ASTC_4x4_UNORM_BLOCK": {
"blockPixelBytes": "16"
},
"ASTC_5x4_SRGB_BLOCK": {
"blockPixelBytes": "16"
},
"ASTC_5x4_UNORM_BLOCK": {
"blockPixelBytes": "16"
},
"ASTC_5x5_SRGB_BLOCK": {
"blockPixelBytes": "16"
},
"ASTC_5x5_UNORM_BLOCK": {
"blockPixelBytes": "16"
},
"ASTC_6x5_SRGB_BLOCK": {
"blockPixelBytes": "16"
},
"ASTC_6x5_UNORM_BLOCK": {
"blockPixelBytes": "16"
},
"ASTC_6x6_SRGB_BLOCK": {
"blockPixelBytes": "16"
},
"ASTC_6x6_UNORM_BLOCK": {
"blockPixelBytes": "16"
},
"ASTC_8x5_SRGB_BLOCK": {
"blockPixelBytes": "16"
},
"ASTC_8x5_UNORM_BLOCK": {
"blockPixelBytes": "16"
},
"ASTC_8x6_SRGB_BLOCK": {
"blockPixelBytes": "16"
},
"ASTC_8x6_UNORM_BLOCK": {
"blockPixelBytes": "16"
},
"ASTC_8x8_SRGB_BLOCK": {
"blockPixelBytes": "16"
},
"ASTC_8x8_UNORM_BLOCK": {
"blockPixelBytes": "16"
},
"ASTC_10x5_SRGB_BLOCK": {
"blockPixelBytes": "16"
},
"ASTC_10x5_UNORM_BLOCK": {
"blockPixelBytes": "16"
},
"ASTC_10x6_SRGB_BLOCK": {
"blockPixelBytes": "16"
},
"ASTC_10x6_UNORM_BLOCK": {
"blockPixelBytes": "16"
},
"ASTC_10x8_SRGB_BLOCK": {
"blockPixelBytes": "16"
},
"ASTC_10x8_UNORM_BLOCK": {
"blockPixelBytes": "16"
},
"ASTC_10x10_SRGB_BLOCK": {
"blockPixelBytes": "16"
},
"ASTC_10x10_UNORM_BLOCK": {
"blockPixelBytes": "16"
},
"ASTC_12x10_SRGB_BLOCK": {
"blockPixelBytes": "16"
},
"ASTC_12x10_UNORM_BLOCK": {
"blockPixelBytes": "16"
},
"ASTC_12x12_SRGB_BLOCK": {
"blockPixelBytes": "16"
},
"ASTC_12x12_UNORM_BLOCK": {
"blockPixelBytes": "16"
},
"ASTC_3x3x3_UNORM_BLOCK": {
"blockPixelBytes": "16"
},
"ASTC_4x3x3_UNORM_BLOCK": {
"blockPixelBytes": "16"
},
"ASTC_4x4x3_UNORM_BLOCK": {
"blockPixelBytes": "16"
},
"ASTC_4x4x4_UNORM_BLOCK": {
"blockPixelBytes": "16"
},
"ASTC_5x4x4_UNORM_BLOCK": {
"blockPixelBytes": "16"
},
"ASTC_5x5x4_UNORM_BLOCK": {
"blockPixelBytes": "16"
},
"ASTC_5x5x5_UNORM_BLOCK": {
"blockPixelBytes": "16"
},
"ASTC_6x5x5_UNORM_BLOCK": {
"blockPixelBytes": "16"
},
"ASTC_6x6x5_UNORM_BLOCK": {
"blockPixelBytes": "16"
},
"ASTC_6x6x6_UNORM_BLOCK": {
"blockPixelBytes": "16"
},
"ASTC_3x3x3_UNORM_SRGB_BLOCK": {
"blockPixelBytes": "16"
},
"ASTC_4x3x3_UNORM_SRGB_BLOCK": {
"blockPixelBytes": "16"
},
"ASTC_4x4x3_UNORM_SRGB_BLOCK": {
"blockPixelBytes": "16"
},
"ASTC_4x4x4_UNORM_SRGB_BLOCK": {
"blockPixelBytes": "16"
},
"ASTC_5x4x4_UNORM_SRGB_BLOCK": {
"blockPixelBytes": "16"
},
"ASTC_5x5x4_UNORM_SRGB_BLOCK": {
"blockPixelBytes": "16"
},
"ASTC_5x5x5_UNORM_SRGB_BLOCK": {
"blockPixelBytes": "16"
},
"ASTC_6x5x5_UNORM_SRGB_BLOCK": {
"blockPixelBytes": "16"
},
"ASTC_6x6x5_UNORM_SRGB_BLOCK": {
"blockPixelBytes": "16"
},
"ASTC_6x6x6_UNORM_SRGB_BLOCK": {
"blockPixelBytes": "16"
},
"BC1_RGB_UNORM_BLOCK": {
"blockPixelBytes": "8"
},
"BC1_RGBA_UNORM_BLOCK": {
"blockPixelBytes": "8"
},
"BC1_RGBA_UNORM_SRGB_BLOCK": {
"blockPixelBytes": "8"
},
"BC1_RGB_UNORM_SRGB_BLOCK": {
"blockPixelBytes": "8"
},
"BC2_RGBA_UNORM_BLOCK": {
"blockPixelBytes": "16"
},
"BC2_RGBA_UNORM_SRGB_BLOCK": {
"blockPixelBytes": "16"
},
"BC3_RGBA_UNORM_BLOCK": {
"blockPixelBytes": "16"
},
"BC3_RGBA_UNORM_SRGB_BLOCK": {
"blockPixelBytes": "16"
},
"BC4_RED_UNORM_BLOCK": {
"blockPixelBytes": "8"
},
"BC4_RED_SNORM_BLOCK": {
"blockPixelBytes": "8"
},
"BC5_RG_UNORM_BLOCK": {
"blockPixelBytes": "16"
},
"BC5_RG_SNORM_BLOCK": {
"blockPixelBytes": "16"
},
"BPTC_SRGB_ALPHA_UNORM_BLOCK": {
"blockPixelBytes": "16"
},
"BPTC_RGB_SIGNED_FLOAT_BLOCK": {
"blockPixelBytes": "16"
},
"BPTC_RGB_UNSIGNED_FLOAT_BLOCK": {
"blockPixelBytes": "16"
},
"BPTC_RGBA_UNORM_BLOCK": {
"blockPixelBytes": "16"
},
"EAC_R11_SNORM_BLOCK": {
"blockPixelBytes": "8"
},
"EAC_R11_UNORM_BLOCK": {
"blockPixelBytes": "8"
},
"EAC_R11G11_SNORM_BLOCK": {
"blockPixelBytes": "16"
},
"EAC_R11G11_UNORM_BLOCK": {
"blockPixelBytes": "16"
},
"ETC1_R8G8B8_UNORM_BLOCK": {
"blockPixelBytes": "8"
},
"ETC1_LOSSY_DECODE_R8G8B8_UNORM_BLOCK": {
"blockPixelBytes": "8"
},
"ETC2_R8G8B8_SRGB_BLOCK": {
"blockPixelBytes": "8"
},
"ETC2_R8G8B8_UNORM_BLOCK": {
"blockPixelBytes": "8"
},
"ETC2_R8G8B8A1_SRGB_BLOCK": {
"blockPixelBytes": "8"
},
"ETC2_R8G8B8A1_UNORM_BLOCK": {
"blockPixelBytes": "8"
},
"ETC2_R8G8B8A8_UNORM_BLOCK": {
"blockPixelBytes": "16"
},
"ETC2_R8G8B8A8_SRGB_BLOCK": {
"blockPixelBytes": "16"
},
"PVRTC1_RGB_4BPP_UNORM_BLOCK": {
"blockPixelBytes": "8"
},
"PVRTC1_RGB_2BPP_UNORM_BLOCK": {
"blockPixelBytes": "8"
},
"PVRTC1_RGBA_4BPP_UNORM_BLOCK": {
"blockPixelBytes": "8"
},
"PVRTC1_RGBA_2BPP_UNORM_BLOCK": {
"blockPixelBytes": "8"
},
"PVRTC1_RGB_2BPP_UNORM_SRGB_BLOCK": {
"blockPixelBytes": "8"
},
"PVRTC1_RGB_4BPP_UNORM_SRGB_BLOCK": {
"blockPixelBytes": "8"
},
"PVRTC1_RGBA_2BPP_UNORM_SRGB_BLOCK": {
"blockPixelBytes": "8"
},
"PVRTC1_RGBA_4BPP_UNORM_SRGB_BLOCK": {
"blockPixelBytes": "8"
}
}