• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 // GENERATED FILE - DO NOT EDIT.
2 // Generated by gen_load_functions_table.py using data from load_functions_data.json
3 //
4 // Copyright 2020 The ANGLE Project Authors. All rights reserved.
5 // Use of this source code is governed by a BSD-style license that can be
6 // found in the LICENSE file.
7 //
8 // load_functions_table:
9 //   Contains the GetLoadFunctionsMap for texture_format_util.h
10 //
11 
12 #include "libANGLE/renderer/load_functions_table.h"
13 
14 #include "image_util/copyimage.h"
15 #include "image_util/generatemip.h"
16 #include "image_util/loadimage.h"
17 
18 using namespace rx;
19 
20 namespace angle
21 {
22 
23 namespace
24 {
25 
26 // ES3 image loading functions vary based on:
27 //    - the GL internal format (supplied to glTex*Image*D)
28 //    - the GL data type given (supplied to glTex*Image*D)
29 //    - the target DXGI_FORMAT that the image will be loaded into (which is chosen based on the D3D
30 //    device's capabilities)
31 // This map type determines which loading function to use, based on these three parameters.
32 // Source formats and types are taken from Tables 3.2 and 3.3 of the ES 3 spec.
UnimplementedLoadFunction(size_t width,size_t height,size_t depth,const uint8_t * input,size_t inputRowPitch,size_t inputDepthPitch,uint8_t * output,size_t outputRowPitch,size_t outputDepthPitch)33 void UnimplementedLoadFunction(size_t width,
34                                size_t height,
35                                size_t depth,
36                                const uint8_t *input,
37                                size_t inputRowPitch,
38                                size_t inputDepthPitch,
39                                uint8_t *output,
40                                size_t outputRowPitch,
41                                size_t outputDepthPitch)
42 {
43     UNIMPLEMENTED();
44 }
45 
UnreachableLoadFunction(size_t width,size_t height,size_t depth,const uint8_t * input,size_t inputRowPitch,size_t inputDepthPitch,uint8_t * output,size_t outputRowPitch,size_t outputDepthPitch)46 void UnreachableLoadFunction(size_t width,
47                              size_t height,
48                              size_t depth,
49                              const uint8_t *input,
50                              size_t inputRowPitch,
51                              size_t inputDepthPitch,
52                              uint8_t *output,
53                              size_t outputRowPitch,
54                              size_t outputDepthPitch)
55 {
56     UNREACHABLE();
57 }
58 
A1RGB5_ANGLEX_to_A1R5G5B5_UNORM(GLenum type)59 LoadImageFunctionInfo A1RGB5_ANGLEX_to_A1R5G5B5_UNORM(GLenum type)
60 {
61     switch (type)
62     {
63         case GL_UNSIGNED_BYTE:
64             return LoadImageFunctionInfo(LoadRGB5A1ToRGBA8, true);
65         case GL_UNSIGNED_SHORT_1_5_5_5_REV_EXT:
66             return LoadImageFunctionInfo(LoadToNative<GLushort, 1>, false);
67         default:
68             UNREACHABLE();
69             return LoadImageFunctionInfo(UnreachableLoadFunction, true);
70     }
71 }
72 
ALPHA_to_R16G16B16A16_FLOAT(GLenum type)73 LoadImageFunctionInfo ALPHA_to_R16G16B16A16_FLOAT(GLenum type)
74 {
75     switch (type)
76     {
77         case GL_HALF_FLOAT:
78             return LoadImageFunctionInfo(LoadA16FToRGBA16F, true);
79         case GL_HALF_FLOAT_OES:
80             return LoadImageFunctionInfo(LoadA16FToRGBA16F, true);
81         case GL_UNSIGNED_BYTE:
82             return LoadImageFunctionInfo(UnreachableLoadFunction, true);
83         default:
84             UNREACHABLE();
85             return LoadImageFunctionInfo(UnreachableLoadFunction, true);
86     }
87 }
88 
ALPHA_to_R32G32B32A32_FLOAT(GLenum type)89 LoadImageFunctionInfo ALPHA_to_R32G32B32A32_FLOAT(GLenum type)
90 {
91     switch (type)
92     {
93         case GL_FLOAT:
94             return LoadImageFunctionInfo(LoadA32FToRGBA32F, true);
95         case GL_UNSIGNED_BYTE:
96             return LoadImageFunctionInfo(UnreachableLoadFunction, true);
97         default:
98             UNREACHABLE();
99             return LoadImageFunctionInfo(UnreachableLoadFunction, true);
100     }
101 }
102 
ALPHA_to_default(GLenum type)103 LoadImageFunctionInfo ALPHA_to_default(GLenum type)
104 {
105     switch (type)
106     {
107         case GL_UNSIGNED_BYTE:
108             return LoadImageFunctionInfo(UnreachableLoadFunction, true);
109         default:
110             UNREACHABLE();
111             return LoadImageFunctionInfo(UnreachableLoadFunction, true);
112     }
113 }
114 
ALPHA16F_EXT_to_R16_FLOAT(GLenum type)115 LoadImageFunctionInfo ALPHA16F_EXT_to_R16_FLOAT(GLenum type)
116 {
117     switch (type)
118     {
119         case GL_HALF_FLOAT:
120             return LoadImageFunctionInfo(LoadToNative<GLhalf, 1>, false);
121         case GL_HALF_FLOAT_OES:
122             return LoadImageFunctionInfo(LoadToNative<GLhalf, 1>, false);
123         default:
124             UNREACHABLE();
125             return LoadImageFunctionInfo(UnreachableLoadFunction, true);
126     }
127 }
128 
ALPHA16F_EXT_to_default(GLenum type)129 LoadImageFunctionInfo ALPHA16F_EXT_to_default(GLenum type)
130 {
131     switch (type)
132     {
133         case GL_HALF_FLOAT:
134             return LoadImageFunctionInfo(LoadA16FToRGBA16F, true);
135         case GL_HALF_FLOAT_OES:
136             return LoadImageFunctionInfo(LoadA16FToRGBA16F, true);
137         default:
138             UNREACHABLE();
139             return LoadImageFunctionInfo(UnreachableLoadFunction, true);
140     }
141 }
142 
ALPHA32F_EXT_to_R32_FLOAT(GLenum type)143 LoadImageFunctionInfo ALPHA32F_EXT_to_R32_FLOAT(GLenum type)
144 {
145     switch (type)
146     {
147         case GL_FLOAT:
148             return LoadImageFunctionInfo(LoadToNative<GLfloat, 1>, false);
149         default:
150             UNREACHABLE();
151             return LoadImageFunctionInfo(UnreachableLoadFunction, true);
152     }
153 }
154 
ALPHA32F_EXT_to_default(GLenum type)155 LoadImageFunctionInfo ALPHA32F_EXT_to_default(GLenum type)
156 {
157     switch (type)
158     {
159         case GL_FLOAT:
160             return LoadImageFunctionInfo(LoadA32FToRGBA32F, true);
161         default:
162             UNREACHABLE();
163             return LoadImageFunctionInfo(UnreachableLoadFunction, true);
164     }
165 }
166 
ALPHA8_EXT_to_A8_UNORM(GLenum type)167 LoadImageFunctionInfo ALPHA8_EXT_to_A8_UNORM(GLenum type)
168 {
169     switch (type)
170     {
171         case GL_UNSIGNED_BYTE:
172             return LoadImageFunctionInfo(LoadToNative<GLubyte, 1>, false);
173         default:
174             UNREACHABLE();
175             return LoadImageFunctionInfo(UnreachableLoadFunction, true);
176     }
177 }
178 
ALPHA8_EXT_to_R8G8B8A8_UNORM(GLenum type)179 LoadImageFunctionInfo ALPHA8_EXT_to_R8G8B8A8_UNORM(GLenum type)
180 {
181     switch (type)
182     {
183         case GL_UNSIGNED_BYTE:
184             return LoadImageFunctionInfo(LoadA8ToRGBA8, true);
185         default:
186             UNREACHABLE();
187             return LoadImageFunctionInfo(UnreachableLoadFunction, true);
188     }
189 }
190 
ALPHA8_EXT_to_R8_UNORM(GLenum type)191 LoadImageFunctionInfo ALPHA8_EXT_to_R8_UNORM(GLenum type)
192 {
193     switch (type)
194     {
195         case GL_UNSIGNED_BYTE:
196             return LoadImageFunctionInfo(LoadToNative<GLubyte, 1>, false);
197         default:
198             UNREACHABLE();
199             return LoadImageFunctionInfo(UnreachableLoadFunction, true);
200     }
201 }
202 
BGR10_A2_ANGLEX_to_B10G10R10A2_UNORM(GLenum type)203 LoadImageFunctionInfo BGR10_A2_ANGLEX_to_B10G10R10A2_UNORM(GLenum type)
204 {
205     switch (type)
206     {
207         case GL_UNSIGNED_INT_2_10_10_10_REV:
208             return LoadImageFunctionInfo(LoadToNative<GLuint, 1>, false);
209         default:
210             UNREACHABLE();
211             return LoadImageFunctionInfo(UnreachableLoadFunction, true);
212     }
213 }
214 
BGR565_ANGLEX_to_B5G6R5_UNORM(GLenum type)215 LoadImageFunctionInfo BGR565_ANGLEX_to_B5G6R5_UNORM(GLenum type)
216 {
217     switch (type)
218     {
219         case GL_UNSIGNED_BYTE:
220             return LoadImageFunctionInfo(LoadRGB8ToBGR565, true);
221         case GL_UNSIGNED_SHORT_5_6_5:
222             return LoadImageFunctionInfo(LoadRGB565ToBGR565, true);
223         default:
224             UNREACHABLE();
225             return LoadImageFunctionInfo(UnreachableLoadFunction, true);
226     }
227 }
228 
BGR5_A1_ANGLEX_to_default(GLenum type)229 LoadImageFunctionInfo BGR5_A1_ANGLEX_to_default(GLenum type)
230 {
231     switch (type)
232     {
233         case GL_UNSIGNED_BYTE:
234             return LoadImageFunctionInfo(LoadRGB5A1ToRGBA8, true);
235         case GL_UNSIGNED_SHORT_1_5_5_5_REV_EXT:
236             return LoadImageFunctionInfo(LoadToNative<GLushort, 1>, false);
237         default:
238             UNREACHABLE();
239             return LoadImageFunctionInfo(UnreachableLoadFunction, true);
240     }
241 }
242 
BGRA4_ANGLEX_to_default(GLenum type)243 LoadImageFunctionInfo BGRA4_ANGLEX_to_default(GLenum type)
244 {
245     switch (type)
246     {
247         case GL_UNSIGNED_BYTE:
248             return LoadImageFunctionInfo(LoadToNative<GLubyte, 4>, false);
249         case GL_UNSIGNED_SHORT_4_4_4_4_REV_EXT:
250             return LoadImageFunctionInfo(LoadRGBA4ToRGBA8, true);
251         default:
252             UNREACHABLE();
253             return LoadImageFunctionInfo(UnreachableLoadFunction, true);
254     }
255 }
256 
BGRA8_EXT_to_default(GLenum type)257 LoadImageFunctionInfo BGRA8_EXT_to_default(GLenum type)
258 {
259     switch (type)
260     {
261         case GL_UNSIGNED_BYTE:
262             return LoadImageFunctionInfo(LoadToNative<GLubyte, 4>, false);
263         default:
264             UNREACHABLE();
265             return LoadImageFunctionInfo(UnreachableLoadFunction, true);
266     }
267 }
268 
BGRA8_SRGB_ANGLEX_to_B8G8R8A8_UNORM_SRGB(GLenum type)269 LoadImageFunctionInfo BGRA8_SRGB_ANGLEX_to_B8G8R8A8_UNORM_SRGB(GLenum type)
270 {
271     switch (type)
272     {
273         case GL_UNSIGNED_BYTE:
274             return LoadImageFunctionInfo(LoadToNative<GLubyte, 4>, false);
275         default:
276             UNREACHABLE();
277             return LoadImageFunctionInfo(UnreachableLoadFunction, true);
278     }
279 }
280 
BGRA_EXT_to_default(GLenum type)281 LoadImageFunctionInfo BGRA_EXT_to_default(GLenum type)
282 {
283     switch (type)
284     {
285         case GL_UNSIGNED_BYTE:
286             return LoadImageFunctionInfo(UnreachableLoadFunction, true);
287         default:
288             UNREACHABLE();
289             return LoadImageFunctionInfo(UnreachableLoadFunction, true);
290     }
291 }
292 
BGRX8_ANGLEX_to_B8G8R8A8_UNORM(GLenum type)293 LoadImageFunctionInfo BGRX8_ANGLEX_to_B8G8R8A8_UNORM(GLenum type)
294 {
295     switch (type)
296     {
297         case GL_UNSIGNED_BYTE:
298             return LoadImageFunctionInfo(LoadToNative<GLubyte, 4>, false);
299         default:
300             UNREACHABLE();
301             return LoadImageFunctionInfo(UnreachableLoadFunction, true);
302     }
303 }
304 
BGRX8_ANGLEX_to_B8G8R8X8_UNORM(GLenum type)305 LoadImageFunctionInfo BGRX8_ANGLEX_to_B8G8R8X8_UNORM(GLenum type)
306 {
307     switch (type)
308     {
309         case GL_UNSIGNED_BYTE:
310             return LoadImageFunctionInfo(LoadToNative<GLubyte, 4>, false);
311         default:
312             UNREACHABLE();
313             return LoadImageFunctionInfo(UnreachableLoadFunction, true);
314     }
315 }
316 
COMPRESSED_R11_EAC_to_EAC_R11_UNORM_BLOCK(GLenum type)317 LoadImageFunctionInfo COMPRESSED_R11_EAC_to_EAC_R11_UNORM_BLOCK(GLenum type)
318 {
319     switch (type)
320     {
321         case GL_UNSIGNED_BYTE:
322             return LoadImageFunctionInfo(LoadCompressedToNative<4, 4, 1, 8>, true);
323         default:
324             UNREACHABLE();
325             return LoadImageFunctionInfo(UnreachableLoadFunction, true);
326     }
327 }
328 
COMPRESSED_R11_EAC_to_R16_FLOAT(GLenum type)329 LoadImageFunctionInfo COMPRESSED_R11_EAC_to_R16_FLOAT(GLenum type)
330 {
331     switch (type)
332     {
333         case GL_UNSIGNED_BYTE:
334             return LoadImageFunctionInfo(LoadEACR11ToR16F, true);
335         default:
336             UNREACHABLE();
337             return LoadImageFunctionInfo(UnreachableLoadFunction, true);
338     }
339 }
340 
COMPRESSED_R11_EAC_to_R16_UNORM(GLenum type)341 LoadImageFunctionInfo COMPRESSED_R11_EAC_to_R16_UNORM(GLenum type)
342 {
343     switch (type)
344     {
345         case GL_UNSIGNED_BYTE:
346             return LoadImageFunctionInfo(LoadEACR11ToR16, true);
347         default:
348             UNREACHABLE();
349             return LoadImageFunctionInfo(UnreachableLoadFunction, true);
350     }
351 }
352 
COMPRESSED_RED_GREEN_RGTC2_EXT_to_default(GLenum type)353 LoadImageFunctionInfo COMPRESSED_RED_GREEN_RGTC2_EXT_to_default(GLenum type)
354 {
355     switch (type)
356     {
357         case GL_UNSIGNED_BYTE:
358             return LoadImageFunctionInfo(LoadCompressedToNative<4, 4, 1, 16>, true);
359         default:
360             UNREACHABLE();
361             return LoadImageFunctionInfo(UnreachableLoadFunction, true);
362     }
363 }
364 
COMPRESSED_RED_RGTC1_EXT_to_default(GLenum type)365 LoadImageFunctionInfo COMPRESSED_RED_RGTC1_EXT_to_default(GLenum type)
366 {
367     switch (type)
368     {
369         case GL_UNSIGNED_BYTE:
370             return LoadImageFunctionInfo(LoadCompressedToNative<4, 4, 1, 8>, true);
371         default:
372             UNREACHABLE();
373             return LoadImageFunctionInfo(UnreachableLoadFunction, true);
374     }
375 }
376 
COMPRESSED_RG11_EAC_to_EAC_R11G11_UNORM_BLOCK(GLenum type)377 LoadImageFunctionInfo COMPRESSED_RG11_EAC_to_EAC_R11G11_UNORM_BLOCK(GLenum type)
378 {
379     switch (type)
380     {
381         case GL_UNSIGNED_BYTE:
382             return LoadImageFunctionInfo(LoadCompressedToNative<4, 4, 1, 16>, true);
383         default:
384             UNREACHABLE();
385             return LoadImageFunctionInfo(UnreachableLoadFunction, true);
386     }
387 }
388 
COMPRESSED_RG11_EAC_to_R16G16_FLOAT(GLenum type)389 LoadImageFunctionInfo COMPRESSED_RG11_EAC_to_R16G16_FLOAT(GLenum type)
390 {
391     switch (type)
392     {
393         case GL_UNSIGNED_BYTE:
394             return LoadImageFunctionInfo(LoadEACRG11ToRG16F, true);
395         default:
396             UNREACHABLE();
397             return LoadImageFunctionInfo(UnreachableLoadFunction, true);
398     }
399 }
400 
COMPRESSED_RG11_EAC_to_R16G16_UNORM(GLenum type)401 LoadImageFunctionInfo COMPRESSED_RG11_EAC_to_R16G16_UNORM(GLenum type)
402 {
403     switch (type)
404     {
405         case GL_UNSIGNED_BYTE:
406             return LoadImageFunctionInfo(LoadEACRG11ToRG16, true);
407         default:
408             UNREACHABLE();
409             return LoadImageFunctionInfo(UnreachableLoadFunction, true);
410     }
411 }
412 
COMPRESSED_RGB8_ETC2_to_ETC2_R8G8B8_UNORM_BLOCK(GLenum type)413 LoadImageFunctionInfo COMPRESSED_RGB8_ETC2_to_ETC2_R8G8B8_UNORM_BLOCK(GLenum type)
414 {
415     switch (type)
416     {
417         case GL_UNSIGNED_BYTE:
418             return LoadImageFunctionInfo(LoadCompressedToNative<4, 4, 1, 8>, true);
419         default:
420             UNREACHABLE();
421             return LoadImageFunctionInfo(UnreachableLoadFunction, true);
422     }
423 }
424 
COMPRESSED_RGB8_ETC2_to_R8G8B8A8_UNORM(GLenum type)425 LoadImageFunctionInfo COMPRESSED_RGB8_ETC2_to_R8G8B8A8_UNORM(GLenum type)
426 {
427     switch (type)
428     {
429         case GL_UNSIGNED_BYTE:
430             return LoadImageFunctionInfo(LoadETC2RGB8ToRGBA8, true);
431         default:
432             UNREACHABLE();
433             return LoadImageFunctionInfo(UnreachableLoadFunction, true);
434     }
435 }
436 
COMPRESSED_RGB8_LOSSY_DECODE_ETC2_ANGLE_to_BC1_RGB_UNORM_BLOCK(GLenum type)437 LoadImageFunctionInfo COMPRESSED_RGB8_LOSSY_DECODE_ETC2_ANGLE_to_BC1_RGB_UNORM_BLOCK(GLenum type)
438 {
439     switch (type)
440     {
441         case GL_UNSIGNED_BYTE:
442             return LoadImageFunctionInfo(LoadETC2RGB8ToBC1, true);
443         default:
444             UNREACHABLE();
445             return LoadImageFunctionInfo(UnreachableLoadFunction, true);
446     }
447 }
448 
COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2_to_ETC2_R8G8B8A1_UNORM_BLOCK(GLenum type)449 LoadImageFunctionInfo COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2_to_ETC2_R8G8B8A1_UNORM_BLOCK(
450     GLenum type)
451 {
452     switch (type)
453     {
454         case GL_UNSIGNED_BYTE:
455             return LoadImageFunctionInfo(LoadCompressedToNative<4, 4, 1, 8>, true);
456         default:
457             UNREACHABLE();
458             return LoadImageFunctionInfo(UnreachableLoadFunction, true);
459     }
460 }
461 
COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2_to_R8G8B8A8_UNORM(GLenum type)462 LoadImageFunctionInfo COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2_to_R8G8B8A8_UNORM(GLenum type)
463 {
464     switch (type)
465     {
466         case GL_UNSIGNED_BYTE:
467             return LoadImageFunctionInfo(LoadETC2RGB8A1ToRGBA8, true);
468         default:
469             UNREACHABLE();
470             return LoadImageFunctionInfo(UnreachableLoadFunction, true);
471     }
472 }
473 
474 LoadImageFunctionInfo
COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_LOSSY_DECODE_ETC2_ANGLE_to_BC1_RGBA_UNORM_BLOCK(GLenum type)475 COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_LOSSY_DECODE_ETC2_ANGLE_to_BC1_RGBA_UNORM_BLOCK(GLenum type)
476 {
477     switch (type)
478     {
479         case GL_UNSIGNED_BYTE:
480             return LoadImageFunctionInfo(LoadETC2RGB8A1ToBC1, true);
481         default:
482             UNREACHABLE();
483             return LoadImageFunctionInfo(UnreachableLoadFunction, true);
484     }
485 }
486 
COMPRESSED_RGBA8_ETC2_EAC_to_ETC2_R8G8B8A8_UNORM_BLOCK(GLenum type)487 LoadImageFunctionInfo COMPRESSED_RGBA8_ETC2_EAC_to_ETC2_R8G8B8A8_UNORM_BLOCK(GLenum type)
488 {
489     switch (type)
490     {
491         case GL_UNSIGNED_BYTE:
492             return LoadImageFunctionInfo(LoadCompressedToNative<4, 4, 1, 16>, true);
493         default:
494             UNREACHABLE();
495             return LoadImageFunctionInfo(UnreachableLoadFunction, true);
496     }
497 }
498 
COMPRESSED_RGBA8_ETC2_EAC_to_R8G8B8A8_UNORM(GLenum type)499 LoadImageFunctionInfo COMPRESSED_RGBA8_ETC2_EAC_to_R8G8B8A8_UNORM(GLenum type)
500 {
501     switch (type)
502     {
503         case GL_UNSIGNED_BYTE:
504             return LoadImageFunctionInfo(LoadETC2RGBA8ToRGBA8, true);
505         default:
506             UNREACHABLE();
507             return LoadImageFunctionInfo(UnreachableLoadFunction, true);
508     }
509 }
510 
COMPRESSED_RGBA_ASTC_10x10_KHR_to_default(GLenum type)511 LoadImageFunctionInfo COMPRESSED_RGBA_ASTC_10x10_KHR_to_default(GLenum type)
512 {
513     switch (type)
514     {
515         case GL_UNSIGNED_BYTE:
516             return LoadImageFunctionInfo(LoadCompressedToNative<10, 10, 1, 16>, true);
517         default:
518             UNREACHABLE();
519             return LoadImageFunctionInfo(UnreachableLoadFunction, true);
520     }
521 }
522 
COMPRESSED_RGBA_ASTC_10x5_KHR_to_default(GLenum type)523 LoadImageFunctionInfo COMPRESSED_RGBA_ASTC_10x5_KHR_to_default(GLenum type)
524 {
525     switch (type)
526     {
527         case GL_UNSIGNED_BYTE:
528             return LoadImageFunctionInfo(LoadCompressedToNative<10, 5, 1, 16>, true);
529         default:
530             UNREACHABLE();
531             return LoadImageFunctionInfo(UnreachableLoadFunction, true);
532     }
533 }
534 
COMPRESSED_RGBA_ASTC_10x6_KHR_to_default(GLenum type)535 LoadImageFunctionInfo COMPRESSED_RGBA_ASTC_10x6_KHR_to_default(GLenum type)
536 {
537     switch (type)
538     {
539         case GL_UNSIGNED_BYTE:
540             return LoadImageFunctionInfo(LoadCompressedToNative<10, 6, 1, 16>, true);
541         default:
542             UNREACHABLE();
543             return LoadImageFunctionInfo(UnreachableLoadFunction, true);
544     }
545 }
546 
COMPRESSED_RGBA_ASTC_10x8_KHR_to_default(GLenum type)547 LoadImageFunctionInfo COMPRESSED_RGBA_ASTC_10x8_KHR_to_default(GLenum type)
548 {
549     switch (type)
550     {
551         case GL_UNSIGNED_BYTE:
552             return LoadImageFunctionInfo(LoadCompressedToNative<10, 8, 1, 16>, true);
553         default:
554             UNREACHABLE();
555             return LoadImageFunctionInfo(UnreachableLoadFunction, true);
556     }
557 }
558 
COMPRESSED_RGBA_ASTC_12x10_KHR_to_default(GLenum type)559 LoadImageFunctionInfo COMPRESSED_RGBA_ASTC_12x10_KHR_to_default(GLenum type)
560 {
561     switch (type)
562     {
563         case GL_UNSIGNED_BYTE:
564             return LoadImageFunctionInfo(LoadCompressedToNative<12, 10, 1, 16>, true);
565         default:
566             UNREACHABLE();
567             return LoadImageFunctionInfo(UnreachableLoadFunction, true);
568     }
569 }
570 
COMPRESSED_RGBA_ASTC_12x12_KHR_to_default(GLenum type)571 LoadImageFunctionInfo COMPRESSED_RGBA_ASTC_12x12_KHR_to_default(GLenum type)
572 {
573     switch (type)
574     {
575         case GL_UNSIGNED_BYTE:
576             return LoadImageFunctionInfo(LoadCompressedToNative<12, 12, 1, 16>, true);
577         default:
578             UNREACHABLE();
579             return LoadImageFunctionInfo(UnreachableLoadFunction, true);
580     }
581 }
582 
COMPRESSED_RGBA_ASTC_3x3x3_OES_to_default(GLenum type)583 LoadImageFunctionInfo COMPRESSED_RGBA_ASTC_3x3x3_OES_to_default(GLenum type)
584 {
585     switch (type)
586     {
587         case GL_UNSIGNED_BYTE:
588             return LoadImageFunctionInfo(LoadCompressedToNative<3, 3, 3, 16>, true);
589         default:
590             UNREACHABLE();
591             return LoadImageFunctionInfo(UnreachableLoadFunction, true);
592     }
593 }
594 
COMPRESSED_RGBA_ASTC_4x3x3_OES_to_default(GLenum type)595 LoadImageFunctionInfo COMPRESSED_RGBA_ASTC_4x3x3_OES_to_default(GLenum type)
596 {
597     switch (type)
598     {
599         case GL_UNSIGNED_BYTE:
600             return LoadImageFunctionInfo(LoadCompressedToNative<4, 3, 3, 16>, true);
601         default:
602             UNREACHABLE();
603             return LoadImageFunctionInfo(UnreachableLoadFunction, true);
604     }
605 }
606 
COMPRESSED_RGBA_ASTC_4x4_KHR_to_default(GLenum type)607 LoadImageFunctionInfo COMPRESSED_RGBA_ASTC_4x4_KHR_to_default(GLenum type)
608 {
609     switch (type)
610     {
611         case GL_UNSIGNED_BYTE:
612             return LoadImageFunctionInfo(LoadCompressedToNative<4, 4, 1, 16>, true);
613         default:
614             UNREACHABLE();
615             return LoadImageFunctionInfo(UnreachableLoadFunction, true);
616     }
617 }
618 
COMPRESSED_RGBA_ASTC_4x4x3_OES_to_default(GLenum type)619 LoadImageFunctionInfo COMPRESSED_RGBA_ASTC_4x4x3_OES_to_default(GLenum type)
620 {
621     switch (type)
622     {
623         case GL_UNSIGNED_BYTE:
624             return LoadImageFunctionInfo(LoadCompressedToNative<4, 4, 3, 16>, true);
625         default:
626             UNREACHABLE();
627             return LoadImageFunctionInfo(UnreachableLoadFunction, true);
628     }
629 }
630 
COMPRESSED_RGBA_ASTC_4x4x4_OES_to_default(GLenum type)631 LoadImageFunctionInfo COMPRESSED_RGBA_ASTC_4x4x4_OES_to_default(GLenum type)
632 {
633     switch (type)
634     {
635         case GL_UNSIGNED_BYTE:
636             return LoadImageFunctionInfo(LoadCompressedToNative<4, 4, 4, 16>, true);
637         default:
638             UNREACHABLE();
639             return LoadImageFunctionInfo(UnreachableLoadFunction, true);
640     }
641 }
642 
COMPRESSED_RGBA_ASTC_5x4_KHR_to_default(GLenum type)643 LoadImageFunctionInfo COMPRESSED_RGBA_ASTC_5x4_KHR_to_default(GLenum type)
644 {
645     switch (type)
646     {
647         case GL_UNSIGNED_BYTE:
648             return LoadImageFunctionInfo(LoadCompressedToNative<5, 4, 1, 16>, true);
649         default:
650             UNREACHABLE();
651             return LoadImageFunctionInfo(UnreachableLoadFunction, true);
652     }
653 }
654 
COMPRESSED_RGBA_ASTC_5x4x4_OES_to_default(GLenum type)655 LoadImageFunctionInfo COMPRESSED_RGBA_ASTC_5x4x4_OES_to_default(GLenum type)
656 {
657     switch (type)
658     {
659         case GL_UNSIGNED_BYTE:
660             return LoadImageFunctionInfo(LoadCompressedToNative<5, 4, 4, 16>, true);
661         default:
662             UNREACHABLE();
663             return LoadImageFunctionInfo(UnreachableLoadFunction, true);
664     }
665 }
666 
COMPRESSED_RGBA_ASTC_5x5_KHR_to_default(GLenum type)667 LoadImageFunctionInfo COMPRESSED_RGBA_ASTC_5x5_KHR_to_default(GLenum type)
668 {
669     switch (type)
670     {
671         case GL_UNSIGNED_BYTE:
672             return LoadImageFunctionInfo(LoadCompressedToNative<5, 5, 1, 16>, true);
673         default:
674             UNREACHABLE();
675             return LoadImageFunctionInfo(UnreachableLoadFunction, true);
676     }
677 }
678 
COMPRESSED_RGBA_ASTC_5x5x4_OES_to_default(GLenum type)679 LoadImageFunctionInfo COMPRESSED_RGBA_ASTC_5x5x4_OES_to_default(GLenum type)
680 {
681     switch (type)
682     {
683         case GL_UNSIGNED_BYTE:
684             return LoadImageFunctionInfo(LoadCompressedToNative<5, 5, 4, 16>, true);
685         default:
686             UNREACHABLE();
687             return LoadImageFunctionInfo(UnreachableLoadFunction, true);
688     }
689 }
690 
COMPRESSED_RGBA_ASTC_5x5x5_OES_to_default(GLenum type)691 LoadImageFunctionInfo COMPRESSED_RGBA_ASTC_5x5x5_OES_to_default(GLenum type)
692 {
693     switch (type)
694     {
695         case GL_UNSIGNED_BYTE:
696             return LoadImageFunctionInfo(LoadCompressedToNative<5, 5, 5, 16>, true);
697         default:
698             UNREACHABLE();
699             return LoadImageFunctionInfo(UnreachableLoadFunction, true);
700     }
701 }
702 
COMPRESSED_RGBA_ASTC_6x5_KHR_to_default(GLenum type)703 LoadImageFunctionInfo COMPRESSED_RGBA_ASTC_6x5_KHR_to_default(GLenum type)
704 {
705     switch (type)
706     {
707         case GL_UNSIGNED_BYTE:
708             return LoadImageFunctionInfo(LoadCompressedToNative<6, 5, 1, 16>, true);
709         default:
710             UNREACHABLE();
711             return LoadImageFunctionInfo(UnreachableLoadFunction, true);
712     }
713 }
714 
COMPRESSED_RGBA_ASTC_6x5x5_OES_to_default(GLenum type)715 LoadImageFunctionInfo COMPRESSED_RGBA_ASTC_6x5x5_OES_to_default(GLenum type)
716 {
717     switch (type)
718     {
719         case GL_UNSIGNED_BYTE:
720             return LoadImageFunctionInfo(LoadCompressedToNative<6, 5, 5, 16>, true);
721         default:
722             UNREACHABLE();
723             return LoadImageFunctionInfo(UnreachableLoadFunction, true);
724     }
725 }
726 
COMPRESSED_RGBA_ASTC_6x6_KHR_to_default(GLenum type)727 LoadImageFunctionInfo COMPRESSED_RGBA_ASTC_6x6_KHR_to_default(GLenum type)
728 {
729     switch (type)
730     {
731         case GL_UNSIGNED_BYTE:
732             return LoadImageFunctionInfo(LoadCompressedToNative<6, 6, 1, 16>, true);
733         default:
734             UNREACHABLE();
735             return LoadImageFunctionInfo(UnreachableLoadFunction, true);
736     }
737 }
738 
COMPRESSED_RGBA_ASTC_6x6x5_OES_to_default(GLenum type)739 LoadImageFunctionInfo COMPRESSED_RGBA_ASTC_6x6x5_OES_to_default(GLenum type)
740 {
741     switch (type)
742     {
743         case GL_UNSIGNED_BYTE:
744             return LoadImageFunctionInfo(LoadCompressedToNative<6, 6, 5, 16>, true);
745         default:
746             UNREACHABLE();
747             return LoadImageFunctionInfo(UnreachableLoadFunction, true);
748     }
749 }
750 
COMPRESSED_RGBA_ASTC_6x6x6_OES_to_default(GLenum type)751 LoadImageFunctionInfo COMPRESSED_RGBA_ASTC_6x6x6_OES_to_default(GLenum type)
752 {
753     switch (type)
754     {
755         case GL_UNSIGNED_BYTE:
756             return LoadImageFunctionInfo(LoadCompressedToNative<6, 6, 6, 16>, true);
757         default:
758             UNREACHABLE();
759             return LoadImageFunctionInfo(UnreachableLoadFunction, true);
760     }
761 }
762 
COMPRESSED_RGBA_ASTC_8x5_KHR_to_default(GLenum type)763 LoadImageFunctionInfo COMPRESSED_RGBA_ASTC_8x5_KHR_to_default(GLenum type)
764 {
765     switch (type)
766     {
767         case GL_UNSIGNED_BYTE:
768             return LoadImageFunctionInfo(LoadCompressedToNative<8, 5, 1, 16>, true);
769         default:
770             UNREACHABLE();
771             return LoadImageFunctionInfo(UnreachableLoadFunction, true);
772     }
773 }
774 
COMPRESSED_RGBA_ASTC_8x6_KHR_to_default(GLenum type)775 LoadImageFunctionInfo COMPRESSED_RGBA_ASTC_8x6_KHR_to_default(GLenum type)
776 {
777     switch (type)
778     {
779         case GL_UNSIGNED_BYTE:
780             return LoadImageFunctionInfo(LoadCompressedToNative<8, 6, 1, 16>, true);
781         default:
782             UNREACHABLE();
783             return LoadImageFunctionInfo(UnreachableLoadFunction, true);
784     }
785 }
786 
COMPRESSED_RGBA_ASTC_8x8_KHR_to_default(GLenum type)787 LoadImageFunctionInfo COMPRESSED_RGBA_ASTC_8x8_KHR_to_default(GLenum type)
788 {
789     switch (type)
790     {
791         case GL_UNSIGNED_BYTE:
792             return LoadImageFunctionInfo(LoadCompressedToNative<8, 8, 1, 16>, true);
793         default:
794             UNREACHABLE();
795             return LoadImageFunctionInfo(UnreachableLoadFunction, true);
796     }
797 }
798 
COMPRESSED_RGBA_BPTC_UNORM_EXT_to_default(GLenum type)799 LoadImageFunctionInfo COMPRESSED_RGBA_BPTC_UNORM_EXT_to_default(GLenum type)
800 {
801     switch (type)
802     {
803         case GL_UNSIGNED_BYTE:
804             return LoadImageFunctionInfo(LoadCompressedToNative<4, 4, 1, 16>, true);
805         default:
806             UNREACHABLE();
807             return LoadImageFunctionInfo(UnreachableLoadFunction, true);
808     }
809 }
810 
COMPRESSED_RGBA_S3TC_DXT1_EXT_to_default(GLenum type)811 LoadImageFunctionInfo COMPRESSED_RGBA_S3TC_DXT1_EXT_to_default(GLenum type)
812 {
813     switch (type)
814     {
815         case GL_UNSIGNED_BYTE:
816             return LoadImageFunctionInfo(LoadCompressedToNative<4, 4, 1, 8>, true);
817         default:
818             UNREACHABLE();
819             return LoadImageFunctionInfo(UnreachableLoadFunction, true);
820     }
821 }
822 
COMPRESSED_RGBA_S3TC_DXT3_ANGLE_to_default(GLenum type)823 LoadImageFunctionInfo COMPRESSED_RGBA_S3TC_DXT3_ANGLE_to_default(GLenum type)
824 {
825     switch (type)
826     {
827         case GL_UNSIGNED_BYTE:
828             return LoadImageFunctionInfo(LoadCompressedToNative<4, 4, 1, 16>, true);
829         default:
830             UNREACHABLE();
831             return LoadImageFunctionInfo(UnreachableLoadFunction, true);
832     }
833 }
834 
COMPRESSED_RGBA_S3TC_DXT5_ANGLE_to_default(GLenum type)835 LoadImageFunctionInfo COMPRESSED_RGBA_S3TC_DXT5_ANGLE_to_default(GLenum type)
836 {
837     switch (type)
838     {
839         case GL_UNSIGNED_BYTE:
840             return LoadImageFunctionInfo(LoadCompressedToNative<4, 4, 1, 16>, true);
841         default:
842             UNREACHABLE();
843             return LoadImageFunctionInfo(UnreachableLoadFunction, true);
844     }
845 }
846 
COMPRESSED_RGB_BPTC_SIGNED_FLOAT_EXT_to_default(GLenum type)847 LoadImageFunctionInfo COMPRESSED_RGB_BPTC_SIGNED_FLOAT_EXT_to_default(GLenum type)
848 {
849     switch (type)
850     {
851         case GL_UNSIGNED_BYTE:
852             return LoadImageFunctionInfo(LoadCompressedToNative<4, 4, 1, 16>, true);
853         default:
854             UNREACHABLE();
855             return LoadImageFunctionInfo(UnreachableLoadFunction, true);
856     }
857 }
858 
COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_EXT_to_default(GLenum type)859 LoadImageFunctionInfo COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_EXT_to_default(GLenum type)
860 {
861     switch (type)
862     {
863         case GL_UNSIGNED_BYTE:
864             return LoadImageFunctionInfo(LoadCompressedToNative<4, 4, 1, 16>, true);
865         default:
866             UNREACHABLE();
867             return LoadImageFunctionInfo(UnreachableLoadFunction, true);
868     }
869 }
870 
COMPRESSED_RGB_S3TC_DXT1_EXT_to_default(GLenum type)871 LoadImageFunctionInfo COMPRESSED_RGB_S3TC_DXT1_EXT_to_default(GLenum type)
872 {
873     switch (type)
874     {
875         case GL_UNSIGNED_BYTE:
876             return LoadImageFunctionInfo(LoadCompressedToNative<4, 4, 1, 8>, true);
877         default:
878             UNREACHABLE();
879             return LoadImageFunctionInfo(UnreachableLoadFunction, true);
880     }
881 }
882 
COMPRESSED_SIGNED_R11_EAC_to_EAC_R11_SNORM_BLOCK(GLenum type)883 LoadImageFunctionInfo COMPRESSED_SIGNED_R11_EAC_to_EAC_R11_SNORM_BLOCK(GLenum type)
884 {
885     switch (type)
886     {
887         case GL_UNSIGNED_BYTE:
888             return LoadImageFunctionInfo(LoadCompressedToNative<4, 4, 1, 8>, true);
889         default:
890             UNREACHABLE();
891             return LoadImageFunctionInfo(UnreachableLoadFunction, true);
892     }
893 }
894 
COMPRESSED_SIGNED_R11_EAC_to_R16_FLOAT(GLenum type)895 LoadImageFunctionInfo COMPRESSED_SIGNED_R11_EAC_to_R16_FLOAT(GLenum type)
896 {
897     switch (type)
898     {
899         case GL_UNSIGNED_BYTE:
900             return LoadImageFunctionInfo(LoadEACR11SToR16F, true);
901         default:
902             UNREACHABLE();
903             return LoadImageFunctionInfo(UnreachableLoadFunction, true);
904     }
905 }
906 
COMPRESSED_SIGNED_R11_EAC_to_R16_SNORM(GLenum type)907 LoadImageFunctionInfo COMPRESSED_SIGNED_R11_EAC_to_R16_SNORM(GLenum type)
908 {
909     switch (type)
910     {
911         case GL_UNSIGNED_BYTE:
912             return LoadImageFunctionInfo(LoadEACR11SToR16, true);
913         default:
914             UNREACHABLE();
915             return LoadImageFunctionInfo(UnreachableLoadFunction, true);
916     }
917 }
918 
COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT_to_default(GLenum type)919 LoadImageFunctionInfo COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT_to_default(GLenum type)
920 {
921     switch (type)
922     {
923         case GL_UNSIGNED_BYTE:
924             return LoadImageFunctionInfo(LoadCompressedToNative<4, 4, 1, 16>, true);
925         default:
926             UNREACHABLE();
927             return LoadImageFunctionInfo(UnreachableLoadFunction, true);
928     }
929 }
930 
COMPRESSED_SIGNED_RED_RGTC1_EXT_to_default(GLenum type)931 LoadImageFunctionInfo COMPRESSED_SIGNED_RED_RGTC1_EXT_to_default(GLenum type)
932 {
933     switch (type)
934     {
935         case GL_UNSIGNED_BYTE:
936             return LoadImageFunctionInfo(LoadCompressedToNative<4, 4, 1, 8>, true);
937         default:
938             UNREACHABLE();
939             return LoadImageFunctionInfo(UnreachableLoadFunction, true);
940     }
941 }
942 
COMPRESSED_SIGNED_RG11_EAC_to_EAC_R11G11_SNORM_BLOCK(GLenum type)943 LoadImageFunctionInfo COMPRESSED_SIGNED_RG11_EAC_to_EAC_R11G11_SNORM_BLOCK(GLenum type)
944 {
945     switch (type)
946     {
947         case GL_UNSIGNED_BYTE:
948             return LoadImageFunctionInfo(LoadCompressedToNative<4, 4, 1, 16>, true);
949         default:
950             UNREACHABLE();
951             return LoadImageFunctionInfo(UnreachableLoadFunction, true);
952     }
953 }
954 
COMPRESSED_SIGNED_RG11_EAC_to_R16G16_FLOAT(GLenum type)955 LoadImageFunctionInfo COMPRESSED_SIGNED_RG11_EAC_to_R16G16_FLOAT(GLenum type)
956 {
957     switch (type)
958     {
959         case GL_UNSIGNED_BYTE:
960             return LoadImageFunctionInfo(LoadEACRG11SToRG16F, true);
961         default:
962             UNREACHABLE();
963             return LoadImageFunctionInfo(UnreachableLoadFunction, true);
964     }
965 }
966 
COMPRESSED_SIGNED_RG11_EAC_to_R16G16_SNORM(GLenum type)967 LoadImageFunctionInfo COMPRESSED_SIGNED_RG11_EAC_to_R16G16_SNORM(GLenum type)
968 {
969     switch (type)
970     {
971         case GL_UNSIGNED_BYTE:
972             return LoadImageFunctionInfo(LoadEACRG11SToRG16, true);
973         default:
974             UNREACHABLE();
975             return LoadImageFunctionInfo(UnreachableLoadFunction, true);
976     }
977 }
978 
COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR_to_default(GLenum type)979 LoadImageFunctionInfo COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR_to_default(GLenum type)
980 {
981     switch (type)
982     {
983         case GL_UNSIGNED_BYTE:
984             return LoadImageFunctionInfo(LoadCompressedToNative<10, 10, 1, 16>, true);
985         default:
986             UNREACHABLE();
987             return LoadImageFunctionInfo(UnreachableLoadFunction, true);
988     }
989 }
990 
COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR_to_default(GLenum type)991 LoadImageFunctionInfo COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR_to_default(GLenum type)
992 {
993     switch (type)
994     {
995         case GL_UNSIGNED_BYTE:
996             return LoadImageFunctionInfo(LoadCompressedToNative<10, 5, 1, 16>, true);
997         default:
998             UNREACHABLE();
999             return LoadImageFunctionInfo(UnreachableLoadFunction, true);
1000     }
1001 }
1002 
COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR_to_default(GLenum type)1003 LoadImageFunctionInfo COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR_to_default(GLenum type)
1004 {
1005     switch (type)
1006     {
1007         case GL_UNSIGNED_BYTE:
1008             return LoadImageFunctionInfo(LoadCompressedToNative<10, 6, 1, 16>, true);
1009         default:
1010             UNREACHABLE();
1011             return LoadImageFunctionInfo(UnreachableLoadFunction, true);
1012     }
1013 }
1014 
COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR_to_default(GLenum type)1015 LoadImageFunctionInfo COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR_to_default(GLenum type)
1016 {
1017     switch (type)
1018     {
1019         case GL_UNSIGNED_BYTE:
1020             return LoadImageFunctionInfo(LoadCompressedToNative<10, 8, 1, 16>, true);
1021         default:
1022             UNREACHABLE();
1023             return LoadImageFunctionInfo(UnreachableLoadFunction, true);
1024     }
1025 }
1026 
COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR_to_default(GLenum type)1027 LoadImageFunctionInfo COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR_to_default(GLenum type)
1028 {
1029     switch (type)
1030     {
1031         case GL_UNSIGNED_BYTE:
1032             return LoadImageFunctionInfo(LoadCompressedToNative<12, 10, 1, 16>, true);
1033         default:
1034             UNREACHABLE();
1035             return LoadImageFunctionInfo(UnreachableLoadFunction, true);
1036     }
1037 }
1038 
COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR_to_default(GLenum type)1039 LoadImageFunctionInfo COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR_to_default(GLenum type)
1040 {
1041     switch (type)
1042     {
1043         case GL_UNSIGNED_BYTE:
1044             return LoadImageFunctionInfo(LoadCompressedToNative<12, 12, 1, 16>, true);
1045         default:
1046             UNREACHABLE();
1047             return LoadImageFunctionInfo(UnreachableLoadFunction, true);
1048     }
1049 }
1050 
COMPRESSED_SRGB8_ALPHA8_ASTC_3x3x3_OES_to_default(GLenum type)1051 LoadImageFunctionInfo COMPRESSED_SRGB8_ALPHA8_ASTC_3x3x3_OES_to_default(GLenum type)
1052 {
1053     switch (type)
1054     {
1055         case GL_UNSIGNED_BYTE:
1056             return LoadImageFunctionInfo(LoadCompressedToNative<3, 3, 3, 16>, true);
1057         default:
1058             UNREACHABLE();
1059             return LoadImageFunctionInfo(UnreachableLoadFunction, true);
1060     }
1061 }
1062 
COMPRESSED_SRGB8_ALPHA8_ASTC_4x3x3_OES_to_default(GLenum type)1063 LoadImageFunctionInfo COMPRESSED_SRGB8_ALPHA8_ASTC_4x3x3_OES_to_default(GLenum type)
1064 {
1065     switch (type)
1066     {
1067         case GL_UNSIGNED_BYTE:
1068             return LoadImageFunctionInfo(LoadCompressedToNative<4, 3, 3, 16>, true);
1069         default:
1070             UNREACHABLE();
1071             return LoadImageFunctionInfo(UnreachableLoadFunction, true);
1072     }
1073 }
1074 
COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR_to_default(GLenum type)1075 LoadImageFunctionInfo COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR_to_default(GLenum type)
1076 {
1077     switch (type)
1078     {
1079         case GL_UNSIGNED_BYTE:
1080             return LoadImageFunctionInfo(LoadCompressedToNative<4, 4, 1, 16>, true);
1081         default:
1082             UNREACHABLE();
1083             return LoadImageFunctionInfo(UnreachableLoadFunction, true);
1084     }
1085 }
1086 
COMPRESSED_SRGB8_ALPHA8_ASTC_4x4x3_OES_to_default(GLenum type)1087 LoadImageFunctionInfo COMPRESSED_SRGB8_ALPHA8_ASTC_4x4x3_OES_to_default(GLenum type)
1088 {
1089     switch (type)
1090     {
1091         case GL_UNSIGNED_BYTE:
1092             return LoadImageFunctionInfo(LoadCompressedToNative<4, 4, 3, 16>, true);
1093         default:
1094             UNREACHABLE();
1095             return LoadImageFunctionInfo(UnreachableLoadFunction, true);
1096     }
1097 }
1098 
COMPRESSED_SRGB8_ALPHA8_ASTC_4x4x4_OES_to_default(GLenum type)1099 LoadImageFunctionInfo COMPRESSED_SRGB8_ALPHA8_ASTC_4x4x4_OES_to_default(GLenum type)
1100 {
1101     switch (type)
1102     {
1103         case GL_UNSIGNED_BYTE:
1104             return LoadImageFunctionInfo(LoadCompressedToNative<4, 4, 4, 16>, true);
1105         default:
1106             UNREACHABLE();
1107             return LoadImageFunctionInfo(UnreachableLoadFunction, true);
1108     }
1109 }
1110 
COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR_to_default(GLenum type)1111 LoadImageFunctionInfo COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR_to_default(GLenum type)
1112 {
1113     switch (type)
1114     {
1115         case GL_UNSIGNED_BYTE:
1116             return LoadImageFunctionInfo(LoadCompressedToNative<5, 4, 1, 16>, true);
1117         default:
1118             UNREACHABLE();
1119             return LoadImageFunctionInfo(UnreachableLoadFunction, true);
1120     }
1121 }
1122 
COMPRESSED_SRGB8_ALPHA8_ASTC_5x4x4_OES_to_default(GLenum type)1123 LoadImageFunctionInfo COMPRESSED_SRGB8_ALPHA8_ASTC_5x4x4_OES_to_default(GLenum type)
1124 {
1125     switch (type)
1126     {
1127         case GL_UNSIGNED_BYTE:
1128             return LoadImageFunctionInfo(LoadCompressedToNative<5, 4, 4, 16>, true);
1129         default:
1130             UNREACHABLE();
1131             return LoadImageFunctionInfo(UnreachableLoadFunction, true);
1132     }
1133 }
1134 
COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR_to_default(GLenum type)1135 LoadImageFunctionInfo COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR_to_default(GLenum type)
1136 {
1137     switch (type)
1138     {
1139         case GL_UNSIGNED_BYTE:
1140             return LoadImageFunctionInfo(LoadCompressedToNative<5, 5, 1, 16>, true);
1141         default:
1142             UNREACHABLE();
1143             return LoadImageFunctionInfo(UnreachableLoadFunction, true);
1144     }
1145 }
1146 
COMPRESSED_SRGB8_ALPHA8_ASTC_5x5x4_OES_to_default(GLenum type)1147 LoadImageFunctionInfo COMPRESSED_SRGB8_ALPHA8_ASTC_5x5x4_OES_to_default(GLenum type)
1148 {
1149     switch (type)
1150     {
1151         case GL_UNSIGNED_BYTE:
1152             return LoadImageFunctionInfo(LoadCompressedToNative<5, 5, 4, 16>, true);
1153         default:
1154             UNREACHABLE();
1155             return LoadImageFunctionInfo(UnreachableLoadFunction, true);
1156     }
1157 }
1158 
COMPRESSED_SRGB8_ALPHA8_ASTC_5x5x5_OES_to_default(GLenum type)1159 LoadImageFunctionInfo COMPRESSED_SRGB8_ALPHA8_ASTC_5x5x5_OES_to_default(GLenum type)
1160 {
1161     switch (type)
1162     {
1163         case GL_UNSIGNED_BYTE:
1164             return LoadImageFunctionInfo(LoadCompressedToNative<5, 5, 5, 16>, true);
1165         default:
1166             UNREACHABLE();
1167             return LoadImageFunctionInfo(UnreachableLoadFunction, true);
1168     }
1169 }
1170 
COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR_to_default(GLenum type)1171 LoadImageFunctionInfo COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR_to_default(GLenum type)
1172 {
1173     switch (type)
1174     {
1175         case GL_UNSIGNED_BYTE:
1176             return LoadImageFunctionInfo(LoadCompressedToNative<6, 5, 1, 16>, true);
1177         default:
1178             UNREACHABLE();
1179             return LoadImageFunctionInfo(UnreachableLoadFunction, true);
1180     }
1181 }
1182 
COMPRESSED_SRGB8_ALPHA8_ASTC_6x5x5_OES_to_default(GLenum type)1183 LoadImageFunctionInfo COMPRESSED_SRGB8_ALPHA8_ASTC_6x5x5_OES_to_default(GLenum type)
1184 {
1185     switch (type)
1186     {
1187         case GL_UNSIGNED_BYTE:
1188             return LoadImageFunctionInfo(LoadCompressedToNative<6, 5, 5, 16>, true);
1189         default:
1190             UNREACHABLE();
1191             return LoadImageFunctionInfo(UnreachableLoadFunction, true);
1192     }
1193 }
1194 
COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR_to_default(GLenum type)1195 LoadImageFunctionInfo COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR_to_default(GLenum type)
1196 {
1197     switch (type)
1198     {
1199         case GL_UNSIGNED_BYTE:
1200             return LoadImageFunctionInfo(LoadCompressedToNative<6, 6, 1, 16>, true);
1201         default:
1202             UNREACHABLE();
1203             return LoadImageFunctionInfo(UnreachableLoadFunction, true);
1204     }
1205 }
1206 
COMPRESSED_SRGB8_ALPHA8_ASTC_6x6x5_OES_to_default(GLenum type)1207 LoadImageFunctionInfo COMPRESSED_SRGB8_ALPHA8_ASTC_6x6x5_OES_to_default(GLenum type)
1208 {
1209     switch (type)
1210     {
1211         case GL_UNSIGNED_BYTE:
1212             return LoadImageFunctionInfo(LoadCompressedToNative<6, 6, 5, 16>, true);
1213         default:
1214             UNREACHABLE();
1215             return LoadImageFunctionInfo(UnreachableLoadFunction, true);
1216     }
1217 }
1218 
COMPRESSED_SRGB8_ALPHA8_ASTC_6x6x6_OES_to_default(GLenum type)1219 LoadImageFunctionInfo COMPRESSED_SRGB8_ALPHA8_ASTC_6x6x6_OES_to_default(GLenum type)
1220 {
1221     switch (type)
1222     {
1223         case GL_UNSIGNED_BYTE:
1224             return LoadImageFunctionInfo(LoadCompressedToNative<6, 6, 6, 16>, true);
1225         default:
1226             UNREACHABLE();
1227             return LoadImageFunctionInfo(UnreachableLoadFunction, true);
1228     }
1229 }
1230 
COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR_to_default(GLenum type)1231 LoadImageFunctionInfo COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR_to_default(GLenum type)
1232 {
1233     switch (type)
1234     {
1235         case GL_UNSIGNED_BYTE:
1236             return LoadImageFunctionInfo(LoadCompressedToNative<8, 5, 1, 16>, true);
1237         default:
1238             UNREACHABLE();
1239             return LoadImageFunctionInfo(UnreachableLoadFunction, true);
1240     }
1241 }
1242 
COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR_to_default(GLenum type)1243 LoadImageFunctionInfo COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR_to_default(GLenum type)
1244 {
1245     switch (type)
1246     {
1247         case GL_UNSIGNED_BYTE:
1248             return LoadImageFunctionInfo(LoadCompressedToNative<8, 6, 1, 16>, true);
1249         default:
1250             UNREACHABLE();
1251             return LoadImageFunctionInfo(UnreachableLoadFunction, true);
1252     }
1253 }
1254 
COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR_to_default(GLenum type)1255 LoadImageFunctionInfo COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR_to_default(GLenum type)
1256 {
1257     switch (type)
1258     {
1259         case GL_UNSIGNED_BYTE:
1260             return LoadImageFunctionInfo(LoadCompressedToNative<8, 8, 1, 16>, true);
1261         default:
1262             UNREACHABLE();
1263             return LoadImageFunctionInfo(UnreachableLoadFunction, true);
1264     }
1265 }
1266 
COMPRESSED_SRGB8_ALPHA8_ETC2_EAC_to_ETC2_R8G8B8A8_SRGB_BLOCK(GLenum type)1267 LoadImageFunctionInfo COMPRESSED_SRGB8_ALPHA8_ETC2_EAC_to_ETC2_R8G8B8A8_SRGB_BLOCK(GLenum type)
1268 {
1269     switch (type)
1270     {
1271         case GL_UNSIGNED_BYTE:
1272             return LoadImageFunctionInfo(LoadCompressedToNative<4, 4, 1, 16>, true);
1273         default:
1274             UNREACHABLE();
1275             return LoadImageFunctionInfo(UnreachableLoadFunction, true);
1276     }
1277 }
1278 
COMPRESSED_SRGB8_ALPHA8_ETC2_EAC_to_R8G8B8A8_UNORM_SRGB(GLenum type)1279 LoadImageFunctionInfo COMPRESSED_SRGB8_ALPHA8_ETC2_EAC_to_R8G8B8A8_UNORM_SRGB(GLenum type)
1280 {
1281     switch (type)
1282     {
1283         case GL_UNSIGNED_BYTE:
1284             return LoadImageFunctionInfo(LoadETC2SRGBA8ToSRGBA8, true);
1285         default:
1286             UNREACHABLE();
1287             return LoadImageFunctionInfo(UnreachableLoadFunction, true);
1288     }
1289 }
1290 
COMPRESSED_SRGB8_ETC2_to_ETC2_R8G8B8_SRGB_BLOCK(GLenum type)1291 LoadImageFunctionInfo COMPRESSED_SRGB8_ETC2_to_ETC2_R8G8B8_SRGB_BLOCK(GLenum type)
1292 {
1293     switch (type)
1294     {
1295         case GL_UNSIGNED_BYTE:
1296             return LoadImageFunctionInfo(LoadCompressedToNative<4, 4, 1, 8>, true);
1297         default:
1298             UNREACHABLE();
1299             return LoadImageFunctionInfo(UnreachableLoadFunction, true);
1300     }
1301 }
1302 
COMPRESSED_SRGB8_ETC2_to_R8G8B8A8_UNORM_SRGB(GLenum type)1303 LoadImageFunctionInfo COMPRESSED_SRGB8_ETC2_to_R8G8B8A8_UNORM_SRGB(GLenum type)
1304 {
1305     switch (type)
1306     {
1307         case GL_UNSIGNED_BYTE:
1308             return LoadImageFunctionInfo(LoadETC2SRGB8ToRGBA8, true);
1309         default:
1310             UNREACHABLE();
1311             return LoadImageFunctionInfo(UnreachableLoadFunction, true);
1312     }
1313 }
1314 
COMPRESSED_SRGB8_LOSSY_DECODE_ETC2_ANGLE_to_BC1_RGB_UNORM_SRGB_BLOCK(GLenum type)1315 LoadImageFunctionInfo COMPRESSED_SRGB8_LOSSY_DECODE_ETC2_ANGLE_to_BC1_RGB_UNORM_SRGB_BLOCK(
1316     GLenum type)
1317 {
1318     switch (type)
1319     {
1320         case GL_UNSIGNED_BYTE:
1321             return LoadImageFunctionInfo(LoadETC2SRGB8ToBC1, true);
1322         default:
1323             UNREACHABLE();
1324             return LoadImageFunctionInfo(UnreachableLoadFunction, true);
1325     }
1326 }
1327 
COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2_to_ETC2_R8G8B8A1_SRGB_BLOCK(GLenum type)1328 LoadImageFunctionInfo COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2_to_ETC2_R8G8B8A1_SRGB_BLOCK(
1329     GLenum type)
1330 {
1331     switch (type)
1332     {
1333         case GL_UNSIGNED_BYTE:
1334             return LoadImageFunctionInfo(LoadCompressedToNative<4, 4, 1, 8>, true);
1335         default:
1336             UNREACHABLE();
1337             return LoadImageFunctionInfo(UnreachableLoadFunction, true);
1338     }
1339 }
1340 
COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2_to_R8G8B8A8_UNORM_SRGB(GLenum type)1341 LoadImageFunctionInfo COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2_to_R8G8B8A8_UNORM_SRGB(GLenum type)
1342 {
1343     switch (type)
1344     {
1345         case GL_UNSIGNED_BYTE:
1346             return LoadImageFunctionInfo(LoadETC2SRGB8A1ToRGBA8, true);
1347         default:
1348             UNREACHABLE();
1349             return LoadImageFunctionInfo(UnreachableLoadFunction, true);
1350     }
1351 }
1352 
1353 LoadImageFunctionInfo
COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_LOSSY_DECODE_ETC2_ANGLE_to_BC1_RGBA_UNORM_SRGB_BLOCK(GLenum type)1354 COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_LOSSY_DECODE_ETC2_ANGLE_to_BC1_RGBA_UNORM_SRGB_BLOCK(
1355     GLenum type)
1356 {
1357     switch (type)
1358     {
1359         case GL_UNSIGNED_BYTE:
1360             return LoadImageFunctionInfo(LoadETC2SRGB8A1ToBC1, true);
1361         default:
1362             UNREACHABLE();
1363             return LoadImageFunctionInfo(UnreachableLoadFunction, true);
1364     }
1365 }
1366 
COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT_to_default(GLenum type)1367 LoadImageFunctionInfo COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT_to_default(GLenum type)
1368 {
1369     switch (type)
1370     {
1371         case GL_UNSIGNED_BYTE:
1372             return LoadImageFunctionInfo(LoadCompressedToNative<4, 4, 1, 16>, true);
1373         default:
1374             UNREACHABLE();
1375             return LoadImageFunctionInfo(UnreachableLoadFunction, true);
1376     }
1377 }
1378 
COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT_to_default(GLenum type)1379 LoadImageFunctionInfo COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT_to_default(GLenum type)
1380 {
1381     switch (type)
1382     {
1383         case GL_UNSIGNED_BYTE:
1384             return LoadImageFunctionInfo(LoadCompressedToNative<4, 4, 1, 8>, true);
1385         default:
1386             UNREACHABLE();
1387             return LoadImageFunctionInfo(UnreachableLoadFunction, true);
1388     }
1389 }
1390 
COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT_to_default(GLenum type)1391 LoadImageFunctionInfo COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT_to_default(GLenum type)
1392 {
1393     switch (type)
1394     {
1395         case GL_UNSIGNED_BYTE:
1396             return LoadImageFunctionInfo(LoadCompressedToNative<4, 4, 1, 16>, true);
1397         default:
1398             UNREACHABLE();
1399             return LoadImageFunctionInfo(UnreachableLoadFunction, true);
1400     }
1401 }
1402 
COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT_to_default(GLenum type)1403 LoadImageFunctionInfo COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT_to_default(GLenum type)
1404 {
1405     switch (type)
1406     {
1407         case GL_UNSIGNED_BYTE:
1408             return LoadImageFunctionInfo(LoadCompressedToNative<4, 4, 1, 16>, true);
1409         default:
1410             UNREACHABLE();
1411             return LoadImageFunctionInfo(UnreachableLoadFunction, true);
1412     }
1413 }
1414 
COMPRESSED_SRGB_S3TC_DXT1_EXT_to_default(GLenum type)1415 LoadImageFunctionInfo COMPRESSED_SRGB_S3TC_DXT1_EXT_to_default(GLenum type)
1416 {
1417     switch (type)
1418     {
1419         case GL_UNSIGNED_BYTE:
1420             return LoadImageFunctionInfo(LoadCompressedToNative<4, 4, 1, 8>, true);
1421         default:
1422             UNREACHABLE();
1423             return LoadImageFunctionInfo(UnreachableLoadFunction, true);
1424     }
1425 }
1426 
DEPTH24_STENCIL8_to_D24_UNORM_S8_UINT(GLenum type)1427 LoadImageFunctionInfo DEPTH24_STENCIL8_to_D24_UNORM_S8_UINT(GLenum type)
1428 {
1429     switch (type)
1430     {
1431         case GL_UNSIGNED_INT_24_8:
1432             return LoadImageFunctionInfo(LoadR32ToR24G8, true);
1433         default:
1434             UNREACHABLE();
1435             return LoadImageFunctionInfo(UnreachableLoadFunction, true);
1436     }
1437 }
1438 
DEPTH24_STENCIL8_to_D32_FLOAT_S8X24_UINT(GLenum type)1439 LoadImageFunctionInfo DEPTH24_STENCIL8_to_D32_FLOAT_S8X24_UINT(GLenum type)
1440 {
1441     switch (type)
1442     {
1443         case GL_UNSIGNED_INT_24_8:
1444             return LoadImageFunctionInfo(LoadD24S8ToD32FS8X24, true);
1445         default:
1446             UNREACHABLE();
1447             return LoadImageFunctionInfo(UnreachableLoadFunction, true);
1448     }
1449 }
1450 
DEPTH32F_STENCIL8_to_D24_UNORM_S8_UINT(GLenum type)1451 LoadImageFunctionInfo DEPTH32F_STENCIL8_to_D24_UNORM_S8_UINT(GLenum type)
1452 {
1453     switch (type)
1454     {
1455         case GL_FLOAT_32_UNSIGNED_INT_24_8_REV:
1456             return LoadImageFunctionInfo(LoadD32FS8X24ToD24S8, true);
1457         default:
1458             UNREACHABLE();
1459             return LoadImageFunctionInfo(UnreachableLoadFunction, true);
1460     }
1461 }
1462 
DEPTH32F_STENCIL8_to_D32_FLOAT_S8X24_UINT(GLenum type)1463 LoadImageFunctionInfo DEPTH32F_STENCIL8_to_D32_FLOAT_S8X24_UINT(GLenum type)
1464 {
1465     switch (type)
1466     {
1467         case GL_FLOAT_32_UNSIGNED_INT_24_8_REV:
1468             return LoadImageFunctionInfo(LoadD32FS8X24ToD32FS8X24, true);
1469         default:
1470             UNREACHABLE();
1471             return LoadImageFunctionInfo(UnreachableLoadFunction, true);
1472     }
1473 }
1474 
DEPTH_COMPONENT16_to_D16_UNORM(GLenum type)1475 LoadImageFunctionInfo DEPTH_COMPONENT16_to_D16_UNORM(GLenum type)
1476 {
1477     switch (type)
1478     {
1479         case GL_UNSIGNED_INT:
1480             return LoadImageFunctionInfo(LoadR32ToR16, true);
1481         case GL_UNSIGNED_SHORT:
1482             return LoadImageFunctionInfo(LoadToNative<GLushort, 1>, false);
1483         default:
1484             UNREACHABLE();
1485             return LoadImageFunctionInfo(UnreachableLoadFunction, true);
1486     }
1487 }
1488 
DEPTH_COMPONENT24_to_D24_UNORM_S8_UINT(GLenum type)1489 LoadImageFunctionInfo DEPTH_COMPONENT24_to_D24_UNORM_S8_UINT(GLenum type)
1490 {
1491     switch (type)
1492     {
1493         case GL_UNSIGNED_INT:
1494             return LoadImageFunctionInfo(LoadR32ToR24G8, true);
1495         default:
1496             UNREACHABLE();
1497             return LoadImageFunctionInfo(UnreachableLoadFunction, true);
1498     }
1499 }
1500 
DEPTH_COMPONENT24_to_D24_UNORM_X8_UINT(GLenum type)1501 LoadImageFunctionInfo DEPTH_COMPONENT24_to_D24_UNORM_X8_UINT(GLenum type)
1502 {
1503     switch (type)
1504     {
1505         case GL_UNSIGNED_INT:
1506             return LoadImageFunctionInfo(LoadR32ToR24G8, true);
1507         default:
1508             UNREACHABLE();
1509             return LoadImageFunctionInfo(UnreachableLoadFunction, true);
1510     }
1511 }
1512 
DEPTH_COMPONENT24_to_D32_FLOAT(GLenum type)1513 LoadImageFunctionInfo DEPTH_COMPONENT24_to_D32_FLOAT(GLenum type)
1514 {
1515     switch (type)
1516     {
1517         case GL_UNSIGNED_INT:
1518             return LoadImageFunctionInfo(LoadD24S8ToD32F, true);
1519         default:
1520             UNREACHABLE();
1521             return LoadImageFunctionInfo(UnreachableLoadFunction, true);
1522     }
1523 }
1524 
DEPTH_COMPONENT24_to_D32_FLOAT_S8X24_UINT(GLenum type)1525 LoadImageFunctionInfo DEPTH_COMPONENT24_to_D32_FLOAT_S8X24_UINT(GLenum type)
1526 {
1527     switch (type)
1528     {
1529         case GL_UNSIGNED_INT:
1530             return LoadImageFunctionInfo(LoadD32ToD32FX32, true);
1531         case GL_UNSIGNED_INT_24_8:
1532             return LoadImageFunctionInfo(LoadD24S8ToD32FS8X24, true);
1533         default:
1534             UNREACHABLE();
1535             return LoadImageFunctionInfo(UnreachableLoadFunction, true);
1536     }
1537 }
1538 
DEPTH_COMPONENT32F_to_D32_FLOAT(GLenum type)1539 LoadImageFunctionInfo DEPTH_COMPONENT32F_to_D32_FLOAT(GLenum type)
1540 {
1541     switch (type)
1542     {
1543         case GL_FLOAT:
1544             return LoadImageFunctionInfo(LoadD32FToD32F, true);
1545         default:
1546             UNREACHABLE();
1547             return LoadImageFunctionInfo(UnreachableLoadFunction, true);
1548     }
1549 }
1550 
DEPTH_COMPONENT32_OES_to_D32_FLOAT(GLenum type)1551 LoadImageFunctionInfo DEPTH_COMPONENT32_OES_to_D32_FLOAT(GLenum type)
1552 {
1553     switch (type)
1554     {
1555         case GL_UNSIGNED_INT:
1556             return LoadImageFunctionInfo(LoadD32ToD32F, true);
1557         default:
1558             UNREACHABLE();
1559             return LoadImageFunctionInfo(UnreachableLoadFunction, true);
1560     }
1561 }
1562 
DEPTH_COMPONENT32_OES_to_default(GLenum type)1563 LoadImageFunctionInfo DEPTH_COMPONENT32_OES_to_default(GLenum type)
1564 {
1565     switch (type)
1566     {
1567         case GL_UNSIGNED_INT:
1568             return LoadImageFunctionInfo(LoadR32ToR24G8, true);
1569         default:
1570             UNREACHABLE();
1571             return LoadImageFunctionInfo(UnreachableLoadFunction, true);
1572     }
1573 }
1574 
ETC1_RGB8_LOSSY_DECODE_ANGLE_to_BC1_RGB_UNORM_BLOCK(GLenum type)1575 LoadImageFunctionInfo ETC1_RGB8_LOSSY_DECODE_ANGLE_to_BC1_RGB_UNORM_BLOCK(GLenum type)
1576 {
1577     switch (type)
1578     {
1579         case GL_UNSIGNED_BYTE:
1580             return LoadImageFunctionInfo(LoadETC1RGB8ToBC1, true);
1581         default:
1582             UNREACHABLE();
1583             return LoadImageFunctionInfo(UnreachableLoadFunction, true);
1584     }
1585 }
1586 
ETC1_RGB8_OES_to_ETC1_R8G8B8_UNORM_BLOCK(GLenum type)1587 LoadImageFunctionInfo ETC1_RGB8_OES_to_ETC1_R8G8B8_UNORM_BLOCK(GLenum type)
1588 {
1589     switch (type)
1590     {
1591         case GL_UNSIGNED_BYTE:
1592             return LoadImageFunctionInfo(LoadCompressedToNative<4, 4, 1, 8>, true);
1593         default:
1594             UNREACHABLE();
1595             return LoadImageFunctionInfo(UnreachableLoadFunction, true);
1596     }
1597 }
1598 
ETC1_RGB8_OES_to_ETC2_R8G8B8_UNORM_BLOCK(GLenum type)1599 LoadImageFunctionInfo ETC1_RGB8_OES_to_ETC2_R8G8B8_UNORM_BLOCK(GLenum type)
1600 {
1601     switch (type)
1602     {
1603         case GL_UNSIGNED_BYTE:
1604             return LoadImageFunctionInfo(LoadCompressedToNative<4, 4, 1, 8>, true);
1605         default:
1606             UNREACHABLE();
1607             return LoadImageFunctionInfo(UnreachableLoadFunction, true);
1608     }
1609 }
1610 
ETC1_RGB8_OES_to_R8G8B8A8_UNORM(GLenum type)1611 LoadImageFunctionInfo ETC1_RGB8_OES_to_R8G8B8A8_UNORM(GLenum type)
1612 {
1613     switch (type)
1614     {
1615         case GL_UNSIGNED_BYTE:
1616             return LoadImageFunctionInfo(LoadETC1RGB8ToRGBA8, true);
1617         default:
1618             UNREACHABLE();
1619             return LoadImageFunctionInfo(UnreachableLoadFunction, true);
1620     }
1621 }
1622 
G8_B8R8_2PLANE_420_UNORM_ANGLE_to_default(GLenum type)1623 LoadImageFunctionInfo G8_B8R8_2PLANE_420_UNORM_ANGLE_to_default(GLenum type)
1624 {
1625     switch (type)
1626     {
1627         case GL_UNSIGNED_BYTE:
1628             return LoadImageFunctionInfo(LoadYuvToNative, true);
1629         default:
1630             UNREACHABLE();
1631             return LoadImageFunctionInfo(UnreachableLoadFunction, true);
1632     }
1633 }
1634 
G8_B8_R8_3PLANE_420_UNORM_ANGLE_to_default(GLenum type)1635 LoadImageFunctionInfo G8_B8_R8_3PLANE_420_UNORM_ANGLE_to_default(GLenum type)
1636 {
1637     switch (type)
1638     {
1639         case GL_UNSIGNED_BYTE:
1640             return LoadImageFunctionInfo(UnimplementedLoadFunction, true);
1641         default:
1642             UNREACHABLE();
1643             return LoadImageFunctionInfo(UnreachableLoadFunction, true);
1644     }
1645 }
1646 
LUMINANCE_to_R16G16B16A16_FLOAT(GLenum type)1647 LoadImageFunctionInfo LUMINANCE_to_R16G16B16A16_FLOAT(GLenum type)
1648 {
1649     switch (type)
1650     {
1651         case GL_HALF_FLOAT:
1652             return LoadImageFunctionInfo(LoadL16FToRGBA16F, true);
1653         case GL_HALF_FLOAT_OES:
1654             return LoadImageFunctionInfo(LoadL16FToRGBA16F, true);
1655         case GL_UNSIGNED_BYTE:
1656             return LoadImageFunctionInfo(UnreachableLoadFunction, true);
1657         default:
1658             UNREACHABLE();
1659             return LoadImageFunctionInfo(UnreachableLoadFunction, true);
1660     }
1661 }
1662 
LUMINANCE_to_R32G32B32A32_FLOAT(GLenum type)1663 LoadImageFunctionInfo LUMINANCE_to_R32G32B32A32_FLOAT(GLenum type)
1664 {
1665     switch (type)
1666     {
1667         case GL_FLOAT:
1668             return LoadImageFunctionInfo(LoadL32FToRGBA32F, true);
1669         case GL_UNSIGNED_BYTE:
1670             return LoadImageFunctionInfo(UnreachableLoadFunction, true);
1671         default:
1672             UNREACHABLE();
1673             return LoadImageFunctionInfo(UnreachableLoadFunction, true);
1674     }
1675 }
1676 
LUMINANCE_to_default(GLenum type)1677 LoadImageFunctionInfo LUMINANCE_to_default(GLenum type)
1678 {
1679     switch (type)
1680     {
1681         case GL_UNSIGNED_BYTE:
1682             return LoadImageFunctionInfo(UnreachableLoadFunction, true);
1683         default:
1684             UNREACHABLE();
1685             return LoadImageFunctionInfo(UnreachableLoadFunction, true);
1686     }
1687 }
1688 
LUMINANCE16F_EXT_to_R16_FLOAT(GLenum type)1689 LoadImageFunctionInfo LUMINANCE16F_EXT_to_R16_FLOAT(GLenum type)
1690 {
1691     switch (type)
1692     {
1693         case GL_HALF_FLOAT:
1694             return LoadImageFunctionInfo(LoadToNative<GLhalf, 1>, false);
1695         case GL_HALF_FLOAT_OES:
1696             return LoadImageFunctionInfo(LoadToNative<GLhalf, 1>, false);
1697         default:
1698             UNREACHABLE();
1699             return LoadImageFunctionInfo(UnreachableLoadFunction, true);
1700     }
1701 }
1702 
LUMINANCE16F_EXT_to_default(GLenum type)1703 LoadImageFunctionInfo LUMINANCE16F_EXT_to_default(GLenum type)
1704 {
1705     switch (type)
1706     {
1707         case GL_HALF_FLOAT:
1708             return LoadImageFunctionInfo(LoadL16FToRGBA16F, true);
1709         case GL_HALF_FLOAT_OES:
1710             return LoadImageFunctionInfo(LoadL16FToRGBA16F, true);
1711         default:
1712             UNREACHABLE();
1713             return LoadImageFunctionInfo(UnreachableLoadFunction, true);
1714     }
1715 }
1716 
LUMINANCE32F_EXT_to_R32_FLOAT(GLenum type)1717 LoadImageFunctionInfo LUMINANCE32F_EXT_to_R32_FLOAT(GLenum type)
1718 {
1719     switch (type)
1720     {
1721         case GL_FLOAT:
1722             return LoadImageFunctionInfo(LoadToNative<GLfloat, 1>, false);
1723         default:
1724             UNREACHABLE();
1725             return LoadImageFunctionInfo(UnreachableLoadFunction, true);
1726     }
1727 }
1728 
LUMINANCE32F_EXT_to_default(GLenum type)1729 LoadImageFunctionInfo LUMINANCE32F_EXT_to_default(GLenum type)
1730 {
1731     switch (type)
1732     {
1733         case GL_FLOAT:
1734             return LoadImageFunctionInfo(LoadL32FToRGBA32F, true);
1735         default:
1736             UNREACHABLE();
1737             return LoadImageFunctionInfo(UnreachableLoadFunction, true);
1738     }
1739 }
1740 
LUMINANCE8_ALPHA8_EXT_to_R8G8B8A8_UNORM(GLenum type)1741 LoadImageFunctionInfo LUMINANCE8_ALPHA8_EXT_to_R8G8B8A8_UNORM(GLenum type)
1742 {
1743     switch (type)
1744     {
1745         case GL_UNSIGNED_BYTE:
1746             return LoadImageFunctionInfo(LoadLA8ToRGBA8, true);
1747         default:
1748             UNREACHABLE();
1749             return LoadImageFunctionInfo(UnreachableLoadFunction, true);
1750     }
1751 }
1752 
LUMINANCE8_ALPHA8_EXT_to_R8G8_UNORM(GLenum type)1753 LoadImageFunctionInfo LUMINANCE8_ALPHA8_EXT_to_R8G8_UNORM(GLenum type)
1754 {
1755     switch (type)
1756     {
1757         case GL_UNSIGNED_BYTE:
1758             return LoadImageFunctionInfo(LoadToNative<GLubyte, 2>, false);
1759         default:
1760             UNREACHABLE();
1761             return LoadImageFunctionInfo(UnreachableLoadFunction, true);
1762     }
1763 }
1764 
LUMINANCE8_EXT_to_R8G8B8A8_UNORM(GLenum type)1765 LoadImageFunctionInfo LUMINANCE8_EXT_to_R8G8B8A8_UNORM(GLenum type)
1766 {
1767     switch (type)
1768     {
1769         case GL_UNSIGNED_BYTE:
1770             return LoadImageFunctionInfo(LoadL8ToRGBA8, true);
1771         default:
1772             UNREACHABLE();
1773             return LoadImageFunctionInfo(UnreachableLoadFunction, true);
1774     }
1775 }
1776 
LUMINANCE8_EXT_to_R8_UNORM(GLenum type)1777 LoadImageFunctionInfo LUMINANCE8_EXT_to_R8_UNORM(GLenum type)
1778 {
1779     switch (type)
1780     {
1781         case GL_UNSIGNED_BYTE:
1782             return LoadImageFunctionInfo(LoadToNative<GLubyte, 1>, false);
1783         default:
1784             UNREACHABLE();
1785             return LoadImageFunctionInfo(UnreachableLoadFunction, true);
1786     }
1787 }
1788 
LUMINANCE_ALPHA_to_R16G16B16A16_FLOAT(GLenum type)1789 LoadImageFunctionInfo LUMINANCE_ALPHA_to_R16G16B16A16_FLOAT(GLenum type)
1790 {
1791     switch (type)
1792     {
1793         case GL_HALF_FLOAT:
1794             return LoadImageFunctionInfo(LoadLA16FToRGBA16F, true);
1795         case GL_HALF_FLOAT_OES:
1796             return LoadImageFunctionInfo(LoadLA16FToRGBA16F, true);
1797         case GL_UNSIGNED_BYTE:
1798             return LoadImageFunctionInfo(UnreachableLoadFunction, true);
1799         default:
1800             UNREACHABLE();
1801             return LoadImageFunctionInfo(UnreachableLoadFunction, true);
1802     }
1803 }
1804 
LUMINANCE_ALPHA_to_R32G32B32A32_FLOAT(GLenum type)1805 LoadImageFunctionInfo LUMINANCE_ALPHA_to_R32G32B32A32_FLOAT(GLenum type)
1806 {
1807     switch (type)
1808     {
1809         case GL_FLOAT:
1810             return LoadImageFunctionInfo(LoadLA32FToRGBA32F, true);
1811         case GL_UNSIGNED_BYTE:
1812             return LoadImageFunctionInfo(UnreachableLoadFunction, true);
1813         default:
1814             UNREACHABLE();
1815             return LoadImageFunctionInfo(UnreachableLoadFunction, true);
1816     }
1817 }
1818 
LUMINANCE_ALPHA_to_default(GLenum type)1819 LoadImageFunctionInfo LUMINANCE_ALPHA_to_default(GLenum type)
1820 {
1821     switch (type)
1822     {
1823         case GL_UNSIGNED_BYTE:
1824             return LoadImageFunctionInfo(UnreachableLoadFunction, true);
1825         default:
1826             UNREACHABLE();
1827             return LoadImageFunctionInfo(UnreachableLoadFunction, true);
1828     }
1829 }
1830 
LUMINANCE_ALPHA16F_EXT_to_R16G16_FLOAT(GLenum type)1831 LoadImageFunctionInfo LUMINANCE_ALPHA16F_EXT_to_R16G16_FLOAT(GLenum type)
1832 {
1833     switch (type)
1834     {
1835         case GL_HALF_FLOAT:
1836             return LoadImageFunctionInfo(LoadToNative<GLhalf, 2>, false);
1837         case GL_HALF_FLOAT_OES:
1838             return LoadImageFunctionInfo(LoadToNative<GLhalf, 2>, false);
1839         default:
1840             UNREACHABLE();
1841             return LoadImageFunctionInfo(UnreachableLoadFunction, true);
1842     }
1843 }
1844 
LUMINANCE_ALPHA16F_EXT_to_default(GLenum type)1845 LoadImageFunctionInfo LUMINANCE_ALPHA16F_EXT_to_default(GLenum type)
1846 {
1847     switch (type)
1848     {
1849         case GL_HALF_FLOAT:
1850             return LoadImageFunctionInfo(LoadLA16FToRGBA16F, true);
1851         case GL_HALF_FLOAT_OES:
1852             return LoadImageFunctionInfo(LoadLA16FToRGBA16F, true);
1853         default:
1854             UNREACHABLE();
1855             return LoadImageFunctionInfo(UnreachableLoadFunction, true);
1856     }
1857 }
1858 
LUMINANCE_ALPHA32F_EXT_to_R32G32_FLOAT(GLenum type)1859 LoadImageFunctionInfo LUMINANCE_ALPHA32F_EXT_to_R32G32_FLOAT(GLenum type)
1860 {
1861     switch (type)
1862     {
1863         case GL_FLOAT:
1864             return LoadImageFunctionInfo(LoadToNative<GLfloat, 2>, false);
1865         default:
1866             UNREACHABLE();
1867             return LoadImageFunctionInfo(UnreachableLoadFunction, true);
1868     }
1869 }
1870 
LUMINANCE_ALPHA32F_EXT_to_default(GLenum type)1871 LoadImageFunctionInfo LUMINANCE_ALPHA32F_EXT_to_default(GLenum type)
1872 {
1873     switch (type)
1874     {
1875         case GL_FLOAT:
1876             return LoadImageFunctionInfo(LoadLA32FToRGBA32F, true);
1877         default:
1878             UNREACHABLE();
1879             return LoadImageFunctionInfo(UnreachableLoadFunction, true);
1880     }
1881 }
1882 
R11F_G11F_B10F_to_R11G11B10_FLOAT(GLenum type)1883 LoadImageFunctionInfo R11F_G11F_B10F_to_R11G11B10_FLOAT(GLenum type)
1884 {
1885     switch (type)
1886     {
1887         case GL_FLOAT:
1888             return LoadImageFunctionInfo(LoadRGB32FToRG11B10F, true);
1889         case GL_HALF_FLOAT:
1890             return LoadImageFunctionInfo(LoadRGB16FToRG11B10F, true);
1891         case GL_HALF_FLOAT_OES:
1892             return LoadImageFunctionInfo(LoadRGB16FToRG11B10F, true);
1893         case GL_UNSIGNED_INT_10F_11F_11F_REV:
1894             return LoadImageFunctionInfo(LoadToNative<GLuint, 1>, false);
1895         default:
1896             UNREACHABLE();
1897             return LoadImageFunctionInfo(UnreachableLoadFunction, true);
1898     }
1899 }
1900 
R16F_to_R16_FLOAT(GLenum type)1901 LoadImageFunctionInfo R16F_to_R16_FLOAT(GLenum type)
1902 {
1903     switch (type)
1904     {
1905         case GL_FLOAT:
1906             return LoadImageFunctionInfo(Load32FTo16F<1>, true);
1907         case GL_HALF_FLOAT:
1908             return LoadImageFunctionInfo(LoadToNative<GLhalf, 1>, false);
1909         case GL_HALF_FLOAT_OES:
1910             return LoadImageFunctionInfo(LoadToNative<GLhalf, 1>, false);
1911         default:
1912             UNREACHABLE();
1913             return LoadImageFunctionInfo(UnreachableLoadFunction, true);
1914     }
1915 }
1916 
R16I_to_R16_SINT(GLenum type)1917 LoadImageFunctionInfo R16I_to_R16_SINT(GLenum type)
1918 {
1919     switch (type)
1920     {
1921         case GL_SHORT:
1922             return LoadImageFunctionInfo(LoadToNative<GLshort, 1>, false);
1923         default:
1924             UNREACHABLE();
1925             return LoadImageFunctionInfo(UnreachableLoadFunction, true);
1926     }
1927 }
1928 
R16UI_to_R16_UINT(GLenum type)1929 LoadImageFunctionInfo R16UI_to_R16_UINT(GLenum type)
1930 {
1931     switch (type)
1932     {
1933         case GL_UNSIGNED_SHORT:
1934             return LoadImageFunctionInfo(LoadToNative<GLushort, 1>, false);
1935         default:
1936             UNREACHABLE();
1937             return LoadImageFunctionInfo(UnreachableLoadFunction, true);
1938     }
1939 }
1940 
R16_EXT_to_R16_UNORM(GLenum type)1941 LoadImageFunctionInfo R16_EXT_to_R16_UNORM(GLenum type)
1942 {
1943     switch (type)
1944     {
1945         case GL_UNSIGNED_SHORT:
1946             return LoadImageFunctionInfo(LoadToNative<GLushort, 1>, false);
1947         default:
1948             UNREACHABLE();
1949             return LoadImageFunctionInfo(UnreachableLoadFunction, true);
1950     }
1951 }
1952 
R16_SNORM_EXT_to_R16_SNORM(GLenum type)1953 LoadImageFunctionInfo R16_SNORM_EXT_to_R16_SNORM(GLenum type)
1954 {
1955     switch (type)
1956     {
1957         case GL_SHORT:
1958             return LoadImageFunctionInfo(LoadToNative<GLushort, 1>, false);
1959         default:
1960             UNREACHABLE();
1961             return LoadImageFunctionInfo(UnreachableLoadFunction, true);
1962     }
1963 }
1964 
R16_SSCALED_ANGLEX_to_default(GLenum type)1965 LoadImageFunctionInfo R16_SSCALED_ANGLEX_to_default(GLenum type)
1966 {
1967     switch (type)
1968     {
1969         case GL_UNSIGNED_BYTE:
1970             return LoadImageFunctionInfo(UnreachableLoadFunction, true);
1971         default:
1972             UNREACHABLE();
1973             return LoadImageFunctionInfo(UnreachableLoadFunction, true);
1974     }
1975 }
1976 
R16_USCALED_ANGLEX_to_default(GLenum type)1977 LoadImageFunctionInfo R16_USCALED_ANGLEX_to_default(GLenum type)
1978 {
1979     switch (type)
1980     {
1981         case GL_UNSIGNED_BYTE:
1982             return LoadImageFunctionInfo(UnreachableLoadFunction, true);
1983         default:
1984             UNREACHABLE();
1985             return LoadImageFunctionInfo(UnreachableLoadFunction, true);
1986     }
1987 }
1988 
R32F_to_R32_FLOAT(GLenum type)1989 LoadImageFunctionInfo R32F_to_R32_FLOAT(GLenum type)
1990 {
1991     switch (type)
1992     {
1993         case GL_FLOAT:
1994             return LoadImageFunctionInfo(LoadToNative<GLfloat, 1>, false);
1995         default:
1996             UNREACHABLE();
1997             return LoadImageFunctionInfo(UnreachableLoadFunction, true);
1998     }
1999 }
2000 
R32I_to_R32_SINT(GLenum type)2001 LoadImageFunctionInfo R32I_to_R32_SINT(GLenum type)
2002 {
2003     switch (type)
2004     {
2005         case GL_INT:
2006             return LoadImageFunctionInfo(LoadToNative<GLint, 1>, false);
2007         default:
2008             UNREACHABLE();
2009             return LoadImageFunctionInfo(UnreachableLoadFunction, true);
2010     }
2011 }
2012 
R32UI_to_R32_UINT(GLenum type)2013 LoadImageFunctionInfo R32UI_to_R32_UINT(GLenum type)
2014 {
2015     switch (type)
2016     {
2017         case GL_UNSIGNED_INT:
2018             return LoadImageFunctionInfo(LoadToNative<GLuint, 1>, false);
2019         default:
2020             UNREACHABLE();
2021             return LoadImageFunctionInfo(UnreachableLoadFunction, true);
2022     }
2023 }
2024 
R8_to_R8_UNORM(GLenum type)2025 LoadImageFunctionInfo R8_to_R8_UNORM(GLenum type)
2026 {
2027     switch (type)
2028     {
2029         case GL_UNSIGNED_BYTE:
2030             return LoadImageFunctionInfo(LoadToNative<GLubyte, 1>, false);
2031         default:
2032             UNREACHABLE();
2033             return LoadImageFunctionInfo(UnreachableLoadFunction, true);
2034     }
2035 }
2036 
R8I_to_R8_SINT(GLenum type)2037 LoadImageFunctionInfo R8I_to_R8_SINT(GLenum type)
2038 {
2039     switch (type)
2040     {
2041         case GL_BYTE:
2042             return LoadImageFunctionInfo(LoadToNative<GLbyte, 1>, false);
2043         default:
2044             UNREACHABLE();
2045             return LoadImageFunctionInfo(UnreachableLoadFunction, true);
2046     }
2047 }
2048 
R8UI_to_R8_UINT(GLenum type)2049 LoadImageFunctionInfo R8UI_to_R8_UINT(GLenum type)
2050 {
2051     switch (type)
2052     {
2053         case GL_UNSIGNED_BYTE:
2054             return LoadImageFunctionInfo(LoadToNative<GLubyte, 1>, false);
2055         default:
2056             UNREACHABLE();
2057             return LoadImageFunctionInfo(UnreachableLoadFunction, true);
2058     }
2059 }
2060 
R8_SNORM_to_R8_SNORM(GLenum type)2061 LoadImageFunctionInfo R8_SNORM_to_R8_SNORM(GLenum type)
2062 {
2063     switch (type)
2064     {
2065         case GL_BYTE:
2066             return LoadImageFunctionInfo(LoadToNative<GLbyte, 1>, false);
2067         default:
2068             UNREACHABLE();
2069             return LoadImageFunctionInfo(UnreachableLoadFunction, true);
2070     }
2071 }
2072 
R8_SSCALED_ANGLEX_to_default(GLenum type)2073 LoadImageFunctionInfo R8_SSCALED_ANGLEX_to_default(GLenum type)
2074 {
2075     switch (type)
2076     {
2077         case GL_UNSIGNED_BYTE:
2078             return LoadImageFunctionInfo(UnreachableLoadFunction, true);
2079         default:
2080             UNREACHABLE();
2081             return LoadImageFunctionInfo(UnreachableLoadFunction, true);
2082     }
2083 }
2084 
R8_USCALED_ANGLEX_to_default(GLenum type)2085 LoadImageFunctionInfo R8_USCALED_ANGLEX_to_default(GLenum type)
2086 {
2087     switch (type)
2088     {
2089         case GL_UNSIGNED_BYTE:
2090             return LoadImageFunctionInfo(UnreachableLoadFunction, true);
2091         default:
2092             UNREACHABLE();
2093             return LoadImageFunctionInfo(UnreachableLoadFunction, true);
2094     }
2095 }
2096 
RG16F_to_R16G16_FLOAT(GLenum type)2097 LoadImageFunctionInfo RG16F_to_R16G16_FLOAT(GLenum type)
2098 {
2099     switch (type)
2100     {
2101         case GL_FLOAT:
2102             return LoadImageFunctionInfo(Load32FTo16F<2>, true);
2103         case GL_HALF_FLOAT:
2104             return LoadImageFunctionInfo(LoadToNative<GLhalf, 2>, false);
2105         case GL_HALF_FLOAT_OES:
2106             return LoadImageFunctionInfo(LoadToNative<GLhalf, 2>, false);
2107         default:
2108             UNREACHABLE();
2109             return LoadImageFunctionInfo(UnreachableLoadFunction, true);
2110     }
2111 }
2112 
RG16I_to_R16G16_SINT(GLenum type)2113 LoadImageFunctionInfo RG16I_to_R16G16_SINT(GLenum type)
2114 {
2115     switch (type)
2116     {
2117         case GL_SHORT:
2118             return LoadImageFunctionInfo(LoadToNative<GLshort, 2>, false);
2119         default:
2120             UNREACHABLE();
2121             return LoadImageFunctionInfo(UnreachableLoadFunction, true);
2122     }
2123 }
2124 
RG16UI_to_R16G16_UINT(GLenum type)2125 LoadImageFunctionInfo RG16UI_to_R16G16_UINT(GLenum type)
2126 {
2127     switch (type)
2128     {
2129         case GL_UNSIGNED_SHORT:
2130             return LoadImageFunctionInfo(LoadToNative<GLushort, 2>, false);
2131         default:
2132             UNREACHABLE();
2133             return LoadImageFunctionInfo(UnreachableLoadFunction, true);
2134     }
2135 }
2136 
RG16_EXT_to_R16G16_UNORM(GLenum type)2137 LoadImageFunctionInfo RG16_EXT_to_R16G16_UNORM(GLenum type)
2138 {
2139     switch (type)
2140     {
2141         case GL_UNSIGNED_SHORT:
2142             return LoadImageFunctionInfo(LoadToNative<GLushort, 2>, false);
2143         default:
2144             UNREACHABLE();
2145             return LoadImageFunctionInfo(UnreachableLoadFunction, true);
2146     }
2147 }
2148 
RG16_SNORM_EXT_to_R16G16_SNORM(GLenum type)2149 LoadImageFunctionInfo RG16_SNORM_EXT_to_R16G16_SNORM(GLenum type)
2150 {
2151     switch (type)
2152     {
2153         case GL_SHORT:
2154             return LoadImageFunctionInfo(LoadToNative<GLushort, 2>, false);
2155         default:
2156             UNREACHABLE();
2157             return LoadImageFunctionInfo(UnreachableLoadFunction, true);
2158     }
2159 }
2160 
RG16_SSCALED_ANGLEX_to_default(GLenum type)2161 LoadImageFunctionInfo RG16_SSCALED_ANGLEX_to_default(GLenum type)
2162 {
2163     switch (type)
2164     {
2165         case GL_UNSIGNED_BYTE:
2166             return LoadImageFunctionInfo(UnreachableLoadFunction, true);
2167         default:
2168             UNREACHABLE();
2169             return LoadImageFunctionInfo(UnreachableLoadFunction, true);
2170     }
2171 }
2172 
RG16_USCALED_ANGLEX_to_default(GLenum type)2173 LoadImageFunctionInfo RG16_USCALED_ANGLEX_to_default(GLenum type)
2174 {
2175     switch (type)
2176     {
2177         case GL_UNSIGNED_BYTE:
2178             return LoadImageFunctionInfo(UnreachableLoadFunction, true);
2179         default:
2180             UNREACHABLE();
2181             return LoadImageFunctionInfo(UnreachableLoadFunction, true);
2182     }
2183 }
2184 
RG32F_to_R32G32_FLOAT(GLenum type)2185 LoadImageFunctionInfo RG32F_to_R32G32_FLOAT(GLenum type)
2186 {
2187     switch (type)
2188     {
2189         case GL_FLOAT:
2190             return LoadImageFunctionInfo(LoadToNative<GLfloat, 2>, false);
2191         default:
2192             UNREACHABLE();
2193             return LoadImageFunctionInfo(UnreachableLoadFunction, true);
2194     }
2195 }
2196 
RG32I_to_R32G32_SINT(GLenum type)2197 LoadImageFunctionInfo RG32I_to_R32G32_SINT(GLenum type)
2198 {
2199     switch (type)
2200     {
2201         case GL_INT:
2202             return LoadImageFunctionInfo(LoadToNative<GLint, 2>, false);
2203         default:
2204             UNREACHABLE();
2205             return LoadImageFunctionInfo(UnreachableLoadFunction, true);
2206     }
2207 }
2208 
RG32UI_to_R32G32_UINT(GLenum type)2209 LoadImageFunctionInfo RG32UI_to_R32G32_UINT(GLenum type)
2210 {
2211     switch (type)
2212     {
2213         case GL_UNSIGNED_INT:
2214             return LoadImageFunctionInfo(LoadToNative<GLuint, 2>, false);
2215         default:
2216             UNREACHABLE();
2217             return LoadImageFunctionInfo(UnreachableLoadFunction, true);
2218     }
2219 }
2220 
RG8_to_R8G8_UNORM(GLenum type)2221 LoadImageFunctionInfo RG8_to_R8G8_UNORM(GLenum type)
2222 {
2223     switch (type)
2224     {
2225         case GL_UNSIGNED_BYTE:
2226             return LoadImageFunctionInfo(LoadToNative<GLubyte, 2>, false);
2227         default:
2228             UNREACHABLE();
2229             return LoadImageFunctionInfo(UnreachableLoadFunction, true);
2230     }
2231 }
2232 
RG8I_to_R8G8_SINT(GLenum type)2233 LoadImageFunctionInfo RG8I_to_R8G8_SINT(GLenum type)
2234 {
2235     switch (type)
2236     {
2237         case GL_BYTE:
2238             return LoadImageFunctionInfo(LoadToNative<GLbyte, 2>, false);
2239         default:
2240             UNREACHABLE();
2241             return LoadImageFunctionInfo(UnreachableLoadFunction, true);
2242     }
2243 }
2244 
RG8UI_to_R8G8_UINT(GLenum type)2245 LoadImageFunctionInfo RG8UI_to_R8G8_UINT(GLenum type)
2246 {
2247     switch (type)
2248     {
2249         case GL_UNSIGNED_BYTE:
2250             return LoadImageFunctionInfo(LoadToNative<GLubyte, 2>, false);
2251         default:
2252             UNREACHABLE();
2253             return LoadImageFunctionInfo(UnreachableLoadFunction, true);
2254     }
2255 }
2256 
RG8_SNORM_to_R8G8_SNORM(GLenum type)2257 LoadImageFunctionInfo RG8_SNORM_to_R8G8_SNORM(GLenum type)
2258 {
2259     switch (type)
2260     {
2261         case GL_BYTE:
2262             return LoadImageFunctionInfo(LoadToNative<GLbyte, 2>, false);
2263         default:
2264             UNREACHABLE();
2265             return LoadImageFunctionInfo(UnreachableLoadFunction, true);
2266     }
2267 }
2268 
RG8_SSCALED_ANGLEX_to_default(GLenum type)2269 LoadImageFunctionInfo RG8_SSCALED_ANGLEX_to_default(GLenum type)
2270 {
2271     switch (type)
2272     {
2273         case GL_UNSIGNED_BYTE:
2274             return LoadImageFunctionInfo(UnreachableLoadFunction, true);
2275         default:
2276             UNREACHABLE();
2277             return LoadImageFunctionInfo(UnreachableLoadFunction, true);
2278     }
2279 }
2280 
RG8_USCALED_ANGLEX_to_default(GLenum type)2281 LoadImageFunctionInfo RG8_USCALED_ANGLEX_to_default(GLenum type)
2282 {
2283     switch (type)
2284     {
2285         case GL_UNSIGNED_BYTE:
2286             return LoadImageFunctionInfo(UnreachableLoadFunction, true);
2287         default:
2288             UNREACHABLE();
2289             return LoadImageFunctionInfo(UnreachableLoadFunction, true);
2290     }
2291 }
2292 
RGB_to_default(GLenum type)2293 LoadImageFunctionInfo RGB_to_default(GLenum type)
2294 {
2295     switch (type)
2296     {
2297         case GL_UNSIGNED_BYTE:
2298             return LoadImageFunctionInfo(UnreachableLoadFunction, true);
2299         case GL_UNSIGNED_SHORT_5_6_5:
2300             return LoadImageFunctionInfo(UnreachableLoadFunction, true);
2301         default:
2302             UNREACHABLE();
2303             return LoadImageFunctionInfo(UnreachableLoadFunction, true);
2304     }
2305 }
2306 
RGB10_A2_to_R10G10B10A2_UNORM(GLenum type)2307 LoadImageFunctionInfo RGB10_A2_to_R10G10B10A2_UNORM(GLenum type)
2308 {
2309     switch (type)
2310     {
2311         case GL_UNSIGNED_INT_2_10_10_10_REV:
2312             return LoadImageFunctionInfo(LoadToNative<GLuint, 1>, false);
2313         default:
2314             UNREACHABLE();
2315             return LoadImageFunctionInfo(UnreachableLoadFunction, true);
2316     }
2317 }
2318 
RGB10_A2UI_to_R10G10B10A2_UINT(GLenum type)2319 LoadImageFunctionInfo RGB10_A2UI_to_R10G10B10A2_UINT(GLenum type)
2320 {
2321     switch (type)
2322     {
2323         case GL_UNSIGNED_INT_2_10_10_10_REV:
2324             return LoadImageFunctionInfo(LoadToNative<GLuint, 1>, false);
2325         default:
2326             UNREACHABLE();
2327             return LoadImageFunctionInfo(UnreachableLoadFunction, true);
2328     }
2329 }
2330 
RGB10_A2_SINT_ANGLEX_to_R10G10B10A2_SINT(GLenum type)2331 LoadImageFunctionInfo RGB10_A2_SINT_ANGLEX_to_R10G10B10A2_SINT(GLenum type)
2332 {
2333     switch (type)
2334     {
2335         case GL_UNSIGNED_BYTE:
2336             return LoadImageFunctionInfo(LoadRGB10A2ToRGBA8, true);
2337         case GL_UNSIGNED_INT_2_10_10_10_REV:
2338             return LoadImageFunctionInfo(LoadToNative<GLuint, 1>, false);
2339         default:
2340             UNREACHABLE();
2341             return LoadImageFunctionInfo(UnreachableLoadFunction, true);
2342     }
2343 }
2344 
RGB10_A2_SNORM_ANGLEX_to_R10G10B10A2_SNORM(GLenum type)2345 LoadImageFunctionInfo RGB10_A2_SNORM_ANGLEX_to_R10G10B10A2_SNORM(GLenum type)
2346 {
2347     switch (type)
2348     {
2349         case GL_UNSIGNED_BYTE:
2350             return LoadImageFunctionInfo(LoadRGB10A2ToRGBA8, true);
2351         case GL_UNSIGNED_INT_2_10_10_10_REV:
2352             return LoadImageFunctionInfo(LoadToNative<GLuint, 1>, false);
2353         default:
2354             UNREACHABLE();
2355             return LoadImageFunctionInfo(UnreachableLoadFunction, true);
2356     }
2357 }
2358 
RGB10_A2_SSCALED_ANGLEX_to_default(GLenum type)2359 LoadImageFunctionInfo RGB10_A2_SSCALED_ANGLEX_to_default(GLenum type)
2360 {
2361     switch (type)
2362     {
2363         case GL_UNSIGNED_BYTE:
2364             return LoadImageFunctionInfo(UnreachableLoadFunction, true);
2365         default:
2366             UNREACHABLE();
2367             return LoadImageFunctionInfo(UnreachableLoadFunction, true);
2368     }
2369 }
2370 
RGB10_A2_USCALED_ANGLEX_to_default(GLenum type)2371 LoadImageFunctionInfo RGB10_A2_USCALED_ANGLEX_to_default(GLenum type)
2372 {
2373     switch (type)
2374     {
2375         case GL_UNSIGNED_BYTE:
2376             return LoadImageFunctionInfo(UnreachableLoadFunction, true);
2377         default:
2378             UNREACHABLE();
2379             return LoadImageFunctionInfo(UnreachableLoadFunction, true);
2380     }
2381 }
2382 
RGB10_UNORM_ANGLEX_to_R10G10B10A2_UNORM(GLenum type)2383 LoadImageFunctionInfo RGB10_UNORM_ANGLEX_to_R10G10B10A2_UNORM(GLenum type)
2384 {
2385     switch (type)
2386     {
2387         case GL_UNSIGNED_INT_2_10_10_10_REV:
2388             return LoadImageFunctionInfo(LoadRGB10A2ToRGB10X2, true);
2389         default:
2390             UNREACHABLE();
2391             return LoadImageFunctionInfo(UnreachableLoadFunction, true);
2392     }
2393 }
2394 
RGB10_UNORM_ANGLEX_to_R10G10B10X2_UNORM(GLenum type)2395 LoadImageFunctionInfo RGB10_UNORM_ANGLEX_to_R10G10B10X2_UNORM(GLenum type)
2396 {
2397     switch (type)
2398     {
2399         case GL_UNSIGNED_INT_2_10_10_10_REV:
2400             return LoadImageFunctionInfo(LoadRGB10A2ToRGB10X2, true);
2401         default:
2402             UNREACHABLE();
2403             return LoadImageFunctionInfo(UnreachableLoadFunction, true);
2404     }
2405 }
2406 
RGB16F_to_R16G16B16A16_FLOAT(GLenum type)2407 LoadImageFunctionInfo RGB16F_to_R16G16B16A16_FLOAT(GLenum type)
2408 {
2409     switch (type)
2410     {
2411         case GL_FLOAT:
2412             return LoadImageFunctionInfo(LoadRGB32FToRGBA16F, true);
2413         case GL_HALF_FLOAT:
2414             return LoadImageFunctionInfo(LoadToNative3To4<GLhalf, gl::Float16One>, true);
2415         case GL_HALF_FLOAT_OES:
2416             return LoadImageFunctionInfo(LoadToNative3To4<GLhalf, gl::Float16One>, true);
2417         default:
2418             UNREACHABLE();
2419             return LoadImageFunctionInfo(UnreachableLoadFunction, true);
2420     }
2421 }
2422 
RGB16F_to_R16G16B16_FLOAT(GLenum type)2423 LoadImageFunctionInfo RGB16F_to_R16G16B16_FLOAT(GLenum type)
2424 {
2425     switch (type)
2426     {
2427         case GL_FLOAT:
2428             return LoadImageFunctionInfo(LoadRGB32FToRGB16F, true);
2429         case GL_HALF_FLOAT:
2430             return LoadImageFunctionInfo(LoadToNative<GLhalf, 3>, false);
2431         case GL_HALF_FLOAT_OES:
2432             return LoadImageFunctionInfo(LoadToNative<GLhalf, 3>, false);
2433         default:
2434             UNREACHABLE();
2435             return LoadImageFunctionInfo(UnreachableLoadFunction, true);
2436     }
2437 }
2438 
RGB16I_to_R16G16B16A16_SINT(GLenum type)2439 LoadImageFunctionInfo RGB16I_to_R16G16B16A16_SINT(GLenum type)
2440 {
2441     switch (type)
2442     {
2443         case GL_SHORT:
2444             return LoadImageFunctionInfo(LoadToNative3To4<GLshort, 0x0001>, true);
2445         default:
2446             UNREACHABLE();
2447             return LoadImageFunctionInfo(UnreachableLoadFunction, true);
2448     }
2449 }
2450 
RGB16I_to_R16G16B16_SINT(GLenum type)2451 LoadImageFunctionInfo RGB16I_to_R16G16B16_SINT(GLenum type)
2452 {
2453     switch (type)
2454     {
2455         case GL_SHORT:
2456             return LoadImageFunctionInfo(LoadToNative<GLshort, 3>, false);
2457         default:
2458             UNREACHABLE();
2459             return LoadImageFunctionInfo(UnreachableLoadFunction, true);
2460     }
2461 }
2462 
RGB16UI_to_R16G16B16A16_UINT(GLenum type)2463 LoadImageFunctionInfo RGB16UI_to_R16G16B16A16_UINT(GLenum type)
2464 {
2465     switch (type)
2466     {
2467         case GL_UNSIGNED_SHORT:
2468             return LoadImageFunctionInfo(LoadToNative3To4<GLushort, 0x0001>, true);
2469         default:
2470             UNREACHABLE();
2471             return LoadImageFunctionInfo(UnreachableLoadFunction, true);
2472     }
2473 }
2474 
RGB16UI_to_R16G16B16_UINT(GLenum type)2475 LoadImageFunctionInfo RGB16UI_to_R16G16B16_UINT(GLenum type)
2476 {
2477     switch (type)
2478     {
2479         case GL_UNSIGNED_SHORT:
2480             return LoadImageFunctionInfo(LoadToNative<GLushort, 3>, false);
2481         default:
2482             UNREACHABLE();
2483             return LoadImageFunctionInfo(UnreachableLoadFunction, true);
2484     }
2485 }
2486 
RGB16_EXT_to_R16G16B16A16_UNORM(GLenum type)2487 LoadImageFunctionInfo RGB16_EXT_to_R16G16B16A16_UNORM(GLenum type)
2488 {
2489     switch (type)
2490     {
2491         case GL_UNSIGNED_SHORT:
2492             return LoadImageFunctionInfo(LoadToNative3To4<GLushort, 0xFFFF>, true);
2493         default:
2494             UNREACHABLE();
2495             return LoadImageFunctionInfo(UnreachableLoadFunction, true);
2496     }
2497 }
2498 
RGB16_EXT_to_R16G16B16_UNORM(GLenum type)2499 LoadImageFunctionInfo RGB16_EXT_to_R16G16B16_UNORM(GLenum type)
2500 {
2501     switch (type)
2502     {
2503         case GL_UNSIGNED_SHORT:
2504             return LoadImageFunctionInfo(LoadToNative<GLushort, 3>, false);
2505         default:
2506             UNREACHABLE();
2507             return LoadImageFunctionInfo(UnreachableLoadFunction, true);
2508     }
2509 }
2510 
RGB16_SNORM_EXT_to_R16G16B16A16_SNORM(GLenum type)2511 LoadImageFunctionInfo RGB16_SNORM_EXT_to_R16G16B16A16_SNORM(GLenum type)
2512 {
2513     switch (type)
2514     {
2515         case GL_SHORT:
2516             return LoadImageFunctionInfo(LoadToNative3To4<GLushort, 0x7FFF>, true);
2517         default:
2518             UNREACHABLE();
2519             return LoadImageFunctionInfo(UnreachableLoadFunction, true);
2520     }
2521 }
2522 
RGB16_SNORM_EXT_to_R16G16B16_SNORM(GLenum type)2523 LoadImageFunctionInfo RGB16_SNORM_EXT_to_R16G16B16_SNORM(GLenum type)
2524 {
2525     switch (type)
2526     {
2527         case GL_SHORT:
2528             return LoadImageFunctionInfo(LoadToNative<GLushort, 3>, false);
2529         default:
2530             UNREACHABLE();
2531             return LoadImageFunctionInfo(UnreachableLoadFunction, true);
2532     }
2533 }
2534 
RGB16_SSCALED_ANGLEX_to_default(GLenum type)2535 LoadImageFunctionInfo RGB16_SSCALED_ANGLEX_to_default(GLenum type)
2536 {
2537     switch (type)
2538     {
2539         case GL_UNSIGNED_BYTE:
2540             return LoadImageFunctionInfo(UnreachableLoadFunction, true);
2541         default:
2542             UNREACHABLE();
2543             return LoadImageFunctionInfo(UnreachableLoadFunction, true);
2544     }
2545 }
2546 
RGB16_USCALED_ANGLEX_to_default(GLenum type)2547 LoadImageFunctionInfo RGB16_USCALED_ANGLEX_to_default(GLenum type)
2548 {
2549     switch (type)
2550     {
2551         case GL_UNSIGNED_BYTE:
2552             return LoadImageFunctionInfo(UnreachableLoadFunction, true);
2553         default:
2554             UNREACHABLE();
2555             return LoadImageFunctionInfo(UnreachableLoadFunction, true);
2556     }
2557 }
2558 
RGB32F_to_R32G32B32A32_FLOAT(GLenum type)2559 LoadImageFunctionInfo RGB32F_to_R32G32B32A32_FLOAT(GLenum type)
2560 {
2561     switch (type)
2562     {
2563         case GL_FLOAT:
2564             return LoadImageFunctionInfo(LoadToNative3To4<GLfloat, gl::Float32One>, true);
2565         default:
2566             UNREACHABLE();
2567             return LoadImageFunctionInfo(UnreachableLoadFunction, true);
2568     }
2569 }
2570 
RGB32F_to_R32G32B32_FLOAT(GLenum type)2571 LoadImageFunctionInfo RGB32F_to_R32G32B32_FLOAT(GLenum type)
2572 {
2573     switch (type)
2574     {
2575         case GL_FLOAT:
2576             return LoadImageFunctionInfo(LoadToNative<GLfloat, 3>, false);
2577         default:
2578             UNREACHABLE();
2579             return LoadImageFunctionInfo(UnreachableLoadFunction, true);
2580     }
2581 }
2582 
RGB32I_to_R32G32B32A32_SINT(GLenum type)2583 LoadImageFunctionInfo RGB32I_to_R32G32B32A32_SINT(GLenum type)
2584 {
2585     switch (type)
2586     {
2587         case GL_INT:
2588             return LoadImageFunctionInfo(LoadToNative3To4<GLint, 0x00000001>, true);
2589         default:
2590             UNREACHABLE();
2591             return LoadImageFunctionInfo(UnreachableLoadFunction, true);
2592     }
2593 }
2594 
RGB32I_to_R32G32B32_SINT(GLenum type)2595 LoadImageFunctionInfo RGB32I_to_R32G32B32_SINT(GLenum type)
2596 {
2597     switch (type)
2598     {
2599         case GL_INT:
2600             return LoadImageFunctionInfo(LoadToNative<GLint, 3>, false);
2601         default:
2602             UNREACHABLE();
2603             return LoadImageFunctionInfo(UnreachableLoadFunction, true);
2604     }
2605 }
2606 
RGB32UI_to_R32G32B32A32_UINT(GLenum type)2607 LoadImageFunctionInfo RGB32UI_to_R32G32B32A32_UINT(GLenum type)
2608 {
2609     switch (type)
2610     {
2611         case GL_UNSIGNED_INT:
2612             return LoadImageFunctionInfo(LoadToNative3To4<GLuint, 0x00000001>, true);
2613         default:
2614             UNREACHABLE();
2615             return LoadImageFunctionInfo(UnreachableLoadFunction, true);
2616     }
2617 }
2618 
RGB32UI_to_R32G32B32_UINT(GLenum type)2619 LoadImageFunctionInfo RGB32UI_to_R32G32B32_UINT(GLenum type)
2620 {
2621     switch (type)
2622     {
2623         case GL_UNSIGNED_INT:
2624             return LoadImageFunctionInfo(LoadToNative<GLuint, 3>, false);
2625         default:
2626             UNREACHABLE();
2627             return LoadImageFunctionInfo(UnreachableLoadFunction, true);
2628     }
2629 }
2630 
RGB565_to_B5G6R5_UNORM(GLenum type)2631 LoadImageFunctionInfo RGB565_to_B5G6R5_UNORM(GLenum type)
2632 {
2633     switch (type)
2634     {
2635         case GL_UNSIGNED_BYTE:
2636             return LoadImageFunctionInfo(LoadRGB8ToBGR565, true);
2637         case GL_UNSIGNED_SHORT_5_6_5:
2638             return LoadImageFunctionInfo(LoadToNative<GLushort, 1>, false);
2639         default:
2640             UNREACHABLE();
2641             return LoadImageFunctionInfo(UnreachableLoadFunction, true);
2642     }
2643 }
2644 
RGB565_to_R5G6B5_UNORM(GLenum type)2645 LoadImageFunctionInfo RGB565_to_R5G6B5_UNORM(GLenum type)
2646 {
2647     switch (type)
2648     {
2649         case GL_UNSIGNED_BYTE:
2650             return LoadImageFunctionInfo(LoadRGB8ToBGR565, true);
2651         case GL_UNSIGNED_SHORT_5_6_5:
2652             return LoadImageFunctionInfo(LoadToNative<GLushort, 1>, false);
2653         default:
2654             UNREACHABLE();
2655             return LoadImageFunctionInfo(UnreachableLoadFunction, true);
2656     }
2657 }
2658 
RGB565_to_R8G8B8A8_UNORM(GLenum type)2659 LoadImageFunctionInfo RGB565_to_R8G8B8A8_UNORM(GLenum type)
2660 {
2661     switch (type)
2662     {
2663         case GL_UNSIGNED_BYTE:
2664             return LoadImageFunctionInfo(LoadToNative3To4<GLubyte, 0xFF>, true);
2665         case GL_UNSIGNED_SHORT_5_6_5:
2666             return LoadImageFunctionInfo(LoadR5G6B5ToRGBA8, true);
2667         default:
2668             UNREACHABLE();
2669             return LoadImageFunctionInfo(UnreachableLoadFunction, true);
2670     }
2671 }
2672 
RGB5_A1_to_A1R5G5B5_UNORM(GLenum type)2673 LoadImageFunctionInfo RGB5_A1_to_A1R5G5B5_UNORM(GLenum type)
2674 {
2675     switch (type)
2676     {
2677         case GL_UNSIGNED_BYTE:
2678             return LoadImageFunctionInfo(LoadRGBA8ToBGR5A1, true);
2679         case GL_UNSIGNED_INT_2_10_10_10_REV:
2680             return LoadImageFunctionInfo(LoadRGB10A2ToBGR5A1, true);
2681         case GL_UNSIGNED_SHORT_5_5_5_1:
2682             return LoadImageFunctionInfo(LoadRGB5A1ToA1RGB5, true);
2683         default:
2684             UNREACHABLE();
2685             return LoadImageFunctionInfo(UnreachableLoadFunction, true);
2686     }
2687 }
2688 
RGB5_A1_to_B5G5R5A1_UNORM(GLenum type)2689 LoadImageFunctionInfo RGB5_A1_to_B5G5R5A1_UNORM(GLenum type)
2690 {
2691     switch (type)
2692     {
2693         case GL_UNSIGNED_BYTE:
2694             return LoadImageFunctionInfo(LoadRGBA8ToBGR5A1, true);
2695         case GL_UNSIGNED_INT_2_10_10_10_REV:
2696             return LoadImageFunctionInfo(LoadRGB10A2ToBGR5A1, true);
2697         case GL_UNSIGNED_SHORT_5_5_5_1:
2698             return LoadImageFunctionInfo(LoadRGB5A1ToA1RGB5, true);
2699         default:
2700             UNREACHABLE();
2701             return LoadImageFunctionInfo(UnreachableLoadFunction, true);
2702     }
2703 }
2704 
RGB5_A1_to_R5G5B5A1_UNORM(GLenum type)2705 LoadImageFunctionInfo RGB5_A1_to_R5G5B5A1_UNORM(GLenum type)
2706 {
2707     switch (type)
2708     {
2709         case GL_UNSIGNED_BYTE:
2710             return LoadImageFunctionInfo(LoadRGBA8ToRGB5A1, true);
2711         case GL_UNSIGNED_INT_2_10_10_10_REV:
2712             return LoadImageFunctionInfo(LoadRGB10A2ToRGB5A1, true);
2713         case GL_UNSIGNED_SHORT_5_5_5_1:
2714             return LoadImageFunctionInfo(LoadToNative<GLushort, 1>, false);
2715         default:
2716             UNREACHABLE();
2717             return LoadImageFunctionInfo(UnreachableLoadFunction, true);
2718     }
2719 }
2720 
RGB5_A1_to_R8G8B8A8_UNORM(GLenum type)2721 LoadImageFunctionInfo RGB5_A1_to_R8G8B8A8_UNORM(GLenum type)
2722 {
2723     switch (type)
2724     {
2725         case GL_UNSIGNED_BYTE:
2726             return LoadImageFunctionInfo(LoadToNative<GLubyte, 4>, false);
2727         case GL_UNSIGNED_INT_2_10_10_10_REV:
2728             return LoadImageFunctionInfo(LoadRGB10A2ToRGBA8, true);
2729         case GL_UNSIGNED_SHORT_5_5_5_1:
2730             return LoadImageFunctionInfo(LoadRGB5A1ToRGBA8, true);
2731         default:
2732             UNREACHABLE();
2733             return LoadImageFunctionInfo(UnreachableLoadFunction, true);
2734     }
2735 }
2736 
RGB8_to_R8G8B8A8_UNORM(GLenum type)2737 LoadImageFunctionInfo RGB8_to_R8G8B8A8_UNORM(GLenum type)
2738 {
2739     switch (type)
2740     {
2741         case GL_UNSIGNED_BYTE:
2742             return LoadImageFunctionInfo(LoadToNative3To4<GLubyte, 0xFF>, true);
2743         default:
2744             UNREACHABLE();
2745             return LoadImageFunctionInfo(UnreachableLoadFunction, true);
2746     }
2747 }
2748 
RGB8_to_R8G8B8_UNORM(GLenum type)2749 LoadImageFunctionInfo RGB8_to_R8G8B8_UNORM(GLenum type)
2750 {
2751     switch (type)
2752     {
2753         case GL_UNSIGNED_BYTE:
2754             return LoadImageFunctionInfo(LoadToNative<GLbyte, 3>, false);
2755         default:
2756             UNREACHABLE();
2757             return LoadImageFunctionInfo(UnreachableLoadFunction, true);
2758     }
2759 }
2760 
RGB8I_to_R8G8B8A8_SINT(GLenum type)2761 LoadImageFunctionInfo RGB8I_to_R8G8B8A8_SINT(GLenum type)
2762 {
2763     switch (type)
2764     {
2765         case GL_BYTE:
2766             return LoadImageFunctionInfo(LoadToNative3To4<GLbyte, 0x01>, true);
2767         default:
2768             UNREACHABLE();
2769             return LoadImageFunctionInfo(UnreachableLoadFunction, true);
2770     }
2771 }
2772 
RGB8I_to_R8G8B8_SINT(GLenum type)2773 LoadImageFunctionInfo RGB8I_to_R8G8B8_SINT(GLenum type)
2774 {
2775     switch (type)
2776     {
2777         case GL_BYTE:
2778             return LoadImageFunctionInfo(LoadToNative<GLbyte, 3>, false);
2779         default:
2780             UNREACHABLE();
2781             return LoadImageFunctionInfo(UnreachableLoadFunction, true);
2782     }
2783 }
2784 
RGB8UI_to_R8G8B8A8_UINT(GLenum type)2785 LoadImageFunctionInfo RGB8UI_to_R8G8B8A8_UINT(GLenum type)
2786 {
2787     switch (type)
2788     {
2789         case GL_UNSIGNED_BYTE:
2790             return LoadImageFunctionInfo(LoadToNative3To4<GLubyte, 0x01>, true);
2791         default:
2792             UNREACHABLE();
2793             return LoadImageFunctionInfo(UnreachableLoadFunction, true);
2794     }
2795 }
2796 
RGB8UI_to_R8G8B8_UINT(GLenum type)2797 LoadImageFunctionInfo RGB8UI_to_R8G8B8_UINT(GLenum type)
2798 {
2799     switch (type)
2800     {
2801         case GL_UNSIGNED_BYTE:
2802             return LoadImageFunctionInfo(LoadToNative<GLubyte, 3>, false);
2803         default:
2804             UNREACHABLE();
2805             return LoadImageFunctionInfo(UnreachableLoadFunction, true);
2806     }
2807 }
2808 
RGB8_SNORM_to_R8G8B8A8_SNORM(GLenum type)2809 LoadImageFunctionInfo RGB8_SNORM_to_R8G8B8A8_SNORM(GLenum type)
2810 {
2811     switch (type)
2812     {
2813         case GL_BYTE:
2814             return LoadImageFunctionInfo(LoadToNative3To4<GLbyte, 0x7F>, true);
2815         default:
2816             UNREACHABLE();
2817             return LoadImageFunctionInfo(UnreachableLoadFunction, true);
2818     }
2819 }
2820 
RGB8_SNORM_to_R8G8B8_SNORM(GLenum type)2821 LoadImageFunctionInfo RGB8_SNORM_to_R8G8B8_SNORM(GLenum type)
2822 {
2823     switch (type)
2824     {
2825         case GL_BYTE:
2826             return LoadImageFunctionInfo(LoadToNative<GLbyte, 3>, false);
2827         default:
2828             UNREACHABLE();
2829             return LoadImageFunctionInfo(UnreachableLoadFunction, true);
2830     }
2831 }
2832 
RGB8_SSCALED_ANGLEX_to_default(GLenum type)2833 LoadImageFunctionInfo RGB8_SSCALED_ANGLEX_to_default(GLenum type)
2834 {
2835     switch (type)
2836     {
2837         case GL_UNSIGNED_BYTE:
2838             return LoadImageFunctionInfo(UnreachableLoadFunction, true);
2839         default:
2840             UNREACHABLE();
2841             return LoadImageFunctionInfo(UnreachableLoadFunction, true);
2842     }
2843 }
2844 
RGB8_USCALED_ANGLEX_to_default(GLenum type)2845 LoadImageFunctionInfo RGB8_USCALED_ANGLEX_to_default(GLenum type)
2846 {
2847     switch (type)
2848     {
2849         case GL_UNSIGNED_BYTE:
2850             return LoadImageFunctionInfo(UnreachableLoadFunction, true);
2851         default:
2852             UNREACHABLE();
2853             return LoadImageFunctionInfo(UnreachableLoadFunction, true);
2854     }
2855 }
2856 
RGB9_E5_to_R9G9B9E5_SHAREDEXP(GLenum type)2857 LoadImageFunctionInfo RGB9_E5_to_R9G9B9E5_SHAREDEXP(GLenum type)
2858 {
2859     switch (type)
2860     {
2861         case GL_FLOAT:
2862             return LoadImageFunctionInfo(LoadRGB32FToRGB9E5, true);
2863         case GL_HALF_FLOAT:
2864             return LoadImageFunctionInfo(LoadRGB16FToRGB9E5, true);
2865         case GL_HALF_FLOAT_OES:
2866             return LoadImageFunctionInfo(LoadRGB16FToRGB9E5, true);
2867         case GL_UNSIGNED_INT_5_9_9_9_REV:
2868             return LoadImageFunctionInfo(LoadToNative<GLuint, 1>, false);
2869         default:
2870             UNREACHABLE();
2871             return LoadImageFunctionInfo(UnreachableLoadFunction, true);
2872     }
2873 }
2874 
RGBA_to_default(GLenum type)2875 LoadImageFunctionInfo RGBA_to_default(GLenum type)
2876 {
2877     switch (type)
2878     {
2879         case GL_UNSIGNED_BYTE:
2880             return LoadImageFunctionInfo(UnreachableLoadFunction, true);
2881         case GL_UNSIGNED_SHORT_4_4_4_4:
2882             return LoadImageFunctionInfo(UnreachableLoadFunction, true);
2883         case GL_UNSIGNED_SHORT_5_5_5_1:
2884             return LoadImageFunctionInfo(UnreachableLoadFunction, true);
2885         default:
2886             UNREACHABLE();
2887             return LoadImageFunctionInfo(UnreachableLoadFunction, true);
2888     }
2889 }
2890 
RGBA16F_to_R16G16B16A16_FLOAT(GLenum type)2891 LoadImageFunctionInfo RGBA16F_to_R16G16B16A16_FLOAT(GLenum type)
2892 {
2893     switch (type)
2894     {
2895         case GL_FLOAT:
2896             return LoadImageFunctionInfo(Load32FTo16F<4>, true);
2897         case GL_HALF_FLOAT:
2898             return LoadImageFunctionInfo(LoadToNative<GLhalf, 4>, false);
2899         case GL_HALF_FLOAT_OES:
2900             return LoadImageFunctionInfo(LoadToNative<GLhalf, 4>, false);
2901         default:
2902             UNREACHABLE();
2903             return LoadImageFunctionInfo(UnreachableLoadFunction, true);
2904     }
2905 }
2906 
RGBA16I_to_R16G16B16A16_SINT(GLenum type)2907 LoadImageFunctionInfo RGBA16I_to_R16G16B16A16_SINT(GLenum type)
2908 {
2909     switch (type)
2910     {
2911         case GL_SHORT:
2912             return LoadImageFunctionInfo(LoadToNative<GLshort, 4>, false);
2913         default:
2914             UNREACHABLE();
2915             return LoadImageFunctionInfo(UnreachableLoadFunction, true);
2916     }
2917 }
2918 
RGBA16UI_to_R16G16B16A16_UINT(GLenum type)2919 LoadImageFunctionInfo RGBA16UI_to_R16G16B16A16_UINT(GLenum type)
2920 {
2921     switch (type)
2922     {
2923         case GL_UNSIGNED_SHORT:
2924             return LoadImageFunctionInfo(LoadToNative<GLushort, 4>, false);
2925         default:
2926             UNREACHABLE();
2927             return LoadImageFunctionInfo(UnreachableLoadFunction, true);
2928     }
2929 }
2930 
RGBA16_EXT_to_R16G16B16A16_UNORM(GLenum type)2931 LoadImageFunctionInfo RGBA16_EXT_to_R16G16B16A16_UNORM(GLenum type)
2932 {
2933     switch (type)
2934     {
2935         case GL_UNSIGNED_SHORT:
2936             return LoadImageFunctionInfo(LoadToNative<GLushort, 4>, false);
2937         default:
2938             UNREACHABLE();
2939             return LoadImageFunctionInfo(UnreachableLoadFunction, true);
2940     }
2941 }
2942 
RGBA16_SNORM_EXT_to_R16G16B16A16_SNORM(GLenum type)2943 LoadImageFunctionInfo RGBA16_SNORM_EXT_to_R16G16B16A16_SNORM(GLenum type)
2944 {
2945     switch (type)
2946     {
2947         case GL_SHORT:
2948             return LoadImageFunctionInfo(LoadToNative<GLushort, 4>, false);
2949         default:
2950             UNREACHABLE();
2951             return LoadImageFunctionInfo(UnreachableLoadFunction, true);
2952     }
2953 }
2954 
RGBA16_SSCALED_ANGLEX_to_default(GLenum type)2955 LoadImageFunctionInfo RGBA16_SSCALED_ANGLEX_to_default(GLenum type)
2956 {
2957     switch (type)
2958     {
2959         case GL_UNSIGNED_BYTE:
2960             return LoadImageFunctionInfo(UnreachableLoadFunction, true);
2961         default:
2962             UNREACHABLE();
2963             return LoadImageFunctionInfo(UnreachableLoadFunction, true);
2964     }
2965 }
2966 
RGBA16_USCALED_ANGLEX_to_default(GLenum type)2967 LoadImageFunctionInfo RGBA16_USCALED_ANGLEX_to_default(GLenum type)
2968 {
2969     switch (type)
2970     {
2971         case GL_UNSIGNED_BYTE:
2972             return LoadImageFunctionInfo(UnreachableLoadFunction, true);
2973         default:
2974             UNREACHABLE();
2975             return LoadImageFunctionInfo(UnreachableLoadFunction, true);
2976     }
2977 }
2978 
RGBA32F_to_R32G32B32A32_FLOAT(GLenum type)2979 LoadImageFunctionInfo RGBA32F_to_R32G32B32A32_FLOAT(GLenum type)
2980 {
2981     switch (type)
2982     {
2983         case GL_FLOAT:
2984             return LoadImageFunctionInfo(LoadToNative<GLfloat, 4>, false);
2985         default:
2986             UNREACHABLE();
2987             return LoadImageFunctionInfo(UnreachableLoadFunction, true);
2988     }
2989 }
2990 
RGBA32I_to_R32G32B32A32_SINT(GLenum type)2991 LoadImageFunctionInfo RGBA32I_to_R32G32B32A32_SINT(GLenum type)
2992 {
2993     switch (type)
2994     {
2995         case GL_INT:
2996             return LoadImageFunctionInfo(LoadToNative<GLint, 4>, false);
2997         default:
2998             UNREACHABLE();
2999             return LoadImageFunctionInfo(UnreachableLoadFunction, true);
3000     }
3001 }
3002 
RGBA32UI_to_R32G32B32A32_UINT(GLenum type)3003 LoadImageFunctionInfo RGBA32UI_to_R32G32B32A32_UINT(GLenum type)
3004 {
3005     switch (type)
3006     {
3007         case GL_UNSIGNED_INT:
3008             return LoadImageFunctionInfo(LoadToNative<GLuint, 4>, false);
3009         default:
3010             UNREACHABLE();
3011             return LoadImageFunctionInfo(UnreachableLoadFunction, true);
3012     }
3013 }
3014 
RGBA4_to_B4G4R4A4_UNORM(GLenum type)3015 LoadImageFunctionInfo RGBA4_to_B4G4R4A4_UNORM(GLenum type)
3016 {
3017     switch (type)
3018     {
3019         case GL_UNSIGNED_BYTE:
3020             return LoadImageFunctionInfo(LoadRGBA8ToBGRA4, true);
3021         case GL_UNSIGNED_SHORT_4_4_4_4:
3022             return LoadImageFunctionInfo(LoadRGBA4ToARGB4, true);
3023         default:
3024             UNREACHABLE();
3025             return LoadImageFunctionInfo(UnreachableLoadFunction, true);
3026     }
3027 }
3028 
RGBA4_to_R4G4B4A4_UNORM(GLenum type)3029 LoadImageFunctionInfo RGBA4_to_R4G4B4A4_UNORM(GLenum type)
3030 {
3031     switch (type)
3032     {
3033         case GL_UNSIGNED_BYTE:
3034             return LoadImageFunctionInfo(LoadRGBA8ToRGBA4, true);
3035         case GL_UNSIGNED_SHORT_4_4_4_4:
3036             return LoadImageFunctionInfo(LoadToNative<GLushort, 1>, false);
3037         default:
3038             UNREACHABLE();
3039             return LoadImageFunctionInfo(UnreachableLoadFunction, true);
3040     }
3041 }
3042 
RGBA4_to_R8G8B8A8_UNORM(GLenum type)3043 LoadImageFunctionInfo RGBA4_to_R8G8B8A8_UNORM(GLenum type)
3044 {
3045     switch (type)
3046     {
3047         case GL_UNSIGNED_BYTE:
3048             return LoadImageFunctionInfo(LoadToNative<GLubyte, 4>, false);
3049         case GL_UNSIGNED_SHORT_4_4_4_4:
3050             return LoadImageFunctionInfo(LoadRGBA4ToRGBA8, true);
3051         default:
3052             UNREACHABLE();
3053             return LoadImageFunctionInfo(UnreachableLoadFunction, true);
3054     }
3055 }
3056 
RGBA8_to_R8G8B8A8_UNORM(GLenum type)3057 LoadImageFunctionInfo RGBA8_to_R8G8B8A8_UNORM(GLenum type)
3058 {
3059     switch (type)
3060     {
3061         case GL_UNSIGNED_BYTE:
3062             return LoadImageFunctionInfo(LoadToNative<GLubyte, 4>, false);
3063         default:
3064             UNREACHABLE();
3065             return LoadImageFunctionInfo(UnreachableLoadFunction, true);
3066     }
3067 }
3068 
RGBA8I_to_R8G8B8A8_SINT(GLenum type)3069 LoadImageFunctionInfo RGBA8I_to_R8G8B8A8_SINT(GLenum type)
3070 {
3071     switch (type)
3072     {
3073         case GL_BYTE:
3074             return LoadImageFunctionInfo(LoadToNative<GLbyte, 4>, false);
3075         default:
3076             UNREACHABLE();
3077             return LoadImageFunctionInfo(UnreachableLoadFunction, true);
3078     }
3079 }
3080 
RGBA8UI_to_R8G8B8A8_UINT(GLenum type)3081 LoadImageFunctionInfo RGBA8UI_to_R8G8B8A8_UINT(GLenum type)
3082 {
3083     switch (type)
3084     {
3085         case GL_UNSIGNED_BYTE:
3086             return LoadImageFunctionInfo(LoadToNative<GLubyte, 4>, false);
3087         default:
3088             UNREACHABLE();
3089             return LoadImageFunctionInfo(UnreachableLoadFunction, true);
3090     }
3091 }
3092 
RGBA8_SNORM_to_R8G8B8A8_SNORM(GLenum type)3093 LoadImageFunctionInfo RGBA8_SNORM_to_R8G8B8A8_SNORM(GLenum type)
3094 {
3095     switch (type)
3096     {
3097         case GL_BYTE:
3098             return LoadImageFunctionInfo(LoadToNative<GLbyte, 4>, false);
3099         default:
3100             UNREACHABLE();
3101             return LoadImageFunctionInfo(UnreachableLoadFunction, true);
3102     }
3103 }
3104 
RGBA8_SSCALED_ANGLEX_to_default(GLenum type)3105 LoadImageFunctionInfo RGBA8_SSCALED_ANGLEX_to_default(GLenum type)
3106 {
3107     switch (type)
3108     {
3109         case GL_UNSIGNED_BYTE:
3110             return LoadImageFunctionInfo(UnreachableLoadFunction, true);
3111         default:
3112             UNREACHABLE();
3113             return LoadImageFunctionInfo(UnreachableLoadFunction, true);
3114     }
3115 }
3116 
RGBA8_USCALED_ANGLEX_to_default(GLenum type)3117 LoadImageFunctionInfo RGBA8_USCALED_ANGLEX_to_default(GLenum type)
3118 {
3119     switch (type)
3120     {
3121         case GL_UNSIGNED_BYTE:
3122             return LoadImageFunctionInfo(UnreachableLoadFunction, true);
3123         default:
3124             UNREACHABLE();
3125             return LoadImageFunctionInfo(UnreachableLoadFunction, true);
3126     }
3127 }
3128 
SR8_EXT_to_R8_UNORM_SRGB(GLenum type)3129 LoadImageFunctionInfo SR8_EXT_to_R8_UNORM_SRGB(GLenum type)
3130 {
3131     switch (type)
3132     {
3133         case GL_UNSIGNED_BYTE:
3134             return LoadImageFunctionInfo(LoadToNative<GLbyte, 1>, false);
3135         default:
3136             UNREACHABLE();
3137             return LoadImageFunctionInfo(UnreachableLoadFunction, true);
3138     }
3139 }
3140 
SRG8_EXT_to_R8G8_UNORM_SRGB(GLenum type)3141 LoadImageFunctionInfo SRG8_EXT_to_R8G8_UNORM_SRGB(GLenum type)
3142 {
3143     switch (type)
3144     {
3145         case GL_UNSIGNED_BYTE:
3146             return LoadImageFunctionInfo(LoadToNative<GLbyte, 2>, false);
3147         default:
3148             UNREACHABLE();
3149             return LoadImageFunctionInfo(UnreachableLoadFunction, true);
3150     }
3151 }
3152 
SRGB8_to_R8G8B8A8_UNORM_SRGB(GLenum type)3153 LoadImageFunctionInfo SRGB8_to_R8G8B8A8_UNORM_SRGB(GLenum type)
3154 {
3155     switch (type)
3156     {
3157         case GL_UNSIGNED_BYTE:
3158             return LoadImageFunctionInfo(LoadToNative3To4<GLubyte, 0xFF>, true);
3159         default:
3160             UNREACHABLE();
3161             return LoadImageFunctionInfo(UnreachableLoadFunction, true);
3162     }
3163 }
3164 
SRGB8_to_R8G8B8_UNORM_SRGB(GLenum type)3165 LoadImageFunctionInfo SRGB8_to_R8G8B8_UNORM_SRGB(GLenum type)
3166 {
3167     switch (type)
3168     {
3169         case GL_UNSIGNED_BYTE:
3170             return LoadImageFunctionInfo(LoadToNative<GLbyte, 3>, false);
3171         default:
3172             UNREACHABLE();
3173             return LoadImageFunctionInfo(UnreachableLoadFunction, true);
3174     }
3175 }
3176 
SRGB8_ALPHA8_to_R8G8B8A8_UNORM_SRGB(GLenum type)3177 LoadImageFunctionInfo SRGB8_ALPHA8_to_R8G8B8A8_UNORM_SRGB(GLenum type)
3178 {
3179     switch (type)
3180     {
3181         case GL_UNSIGNED_BYTE:
3182             return LoadImageFunctionInfo(LoadToNative<GLubyte, 4>, false);
3183         default:
3184             UNREACHABLE();
3185             return LoadImageFunctionInfo(UnreachableLoadFunction, true);
3186     }
3187 }
3188 
STENCIL_INDEX8_to_S8_UINT(GLenum type)3189 LoadImageFunctionInfo STENCIL_INDEX8_to_S8_UINT(GLenum type)
3190 {
3191     switch (type)
3192     {
3193         case GL_UNSIGNED_BYTE:
3194             return LoadImageFunctionInfo(LoadToNative<GLubyte, 1>, false);
3195         default:
3196             UNREACHABLE();
3197             return LoadImageFunctionInfo(UnreachableLoadFunction, true);
3198     }
3199 }
3200 
STENCIL_INDEX8_to_default(GLenum type)3201 LoadImageFunctionInfo STENCIL_INDEX8_to_default(GLenum type)
3202 {
3203     switch (type)
3204     {
3205         case GL_UNSIGNED_BYTE:
3206             return LoadImageFunctionInfo(UnimplementedLoadFunction, true);
3207         default:
3208             UNREACHABLE();
3209             return LoadImageFunctionInfo(UnreachableLoadFunction, true);
3210     }
3211 }
3212 
3213 }  // namespace
3214 
GetLoadFunctionsMap(GLenum internalFormat,FormatID angleFormat)3215 LoadFunctionMap GetLoadFunctionsMap(GLenum internalFormat, FormatID angleFormat)
3216 {
3217     // clang-format off
3218     switch (internalFormat)
3219     {
3220         case GL_A1RGB5_ANGLEX:
3221         {
3222             switch (angleFormat)
3223             {
3224                 case FormatID::A1R5G5B5_UNORM:
3225                     return A1RGB5_ANGLEX_to_A1R5G5B5_UNORM;
3226                 default:
3227                     break;
3228             }
3229             break;
3230         }
3231         case GL_ALPHA:
3232         {
3233             switch (angleFormat)
3234             {
3235                 case FormatID::R16G16B16A16_FLOAT:
3236                     return ALPHA_to_R16G16B16A16_FLOAT;
3237                 case FormatID::R32G32B32A32_FLOAT:
3238                     return ALPHA_to_R32G32B32A32_FLOAT;
3239                 default:
3240                     return ALPHA_to_default;
3241             }
3242         }
3243         case GL_ALPHA16F_EXT:
3244         {
3245             switch (angleFormat)
3246             {
3247                 case FormatID::R16_FLOAT:
3248                     return ALPHA16F_EXT_to_R16_FLOAT;
3249                 default:
3250                     return ALPHA16F_EXT_to_default;
3251             }
3252         }
3253         case GL_ALPHA32F_EXT:
3254         {
3255             switch (angleFormat)
3256             {
3257                 case FormatID::R32_FLOAT:
3258                     return ALPHA32F_EXT_to_R32_FLOAT;
3259                 default:
3260                     return ALPHA32F_EXT_to_default;
3261             }
3262         }
3263         case GL_ALPHA8_EXT:
3264         {
3265             switch (angleFormat)
3266             {
3267                 case FormatID::A8_UNORM:
3268                     return ALPHA8_EXT_to_A8_UNORM;
3269                 case FormatID::R8G8B8A8_UNORM:
3270                     return ALPHA8_EXT_to_R8G8B8A8_UNORM;
3271                 case FormatID::R8_UNORM:
3272                     return ALPHA8_EXT_to_R8_UNORM;
3273                 default:
3274                     break;
3275             }
3276             break;
3277         }
3278         case GL_BGR10_A2_ANGLEX:
3279         {
3280             switch (angleFormat)
3281             {
3282                 case FormatID::B10G10R10A2_UNORM:
3283                     return BGR10_A2_ANGLEX_to_B10G10R10A2_UNORM;
3284                 default:
3285                     break;
3286             }
3287             break;
3288         }
3289         case GL_BGR565_ANGLEX:
3290         {
3291             switch (angleFormat)
3292             {
3293                 case FormatID::B5G6R5_UNORM:
3294                     return BGR565_ANGLEX_to_B5G6R5_UNORM;
3295                 default:
3296                     break;
3297             }
3298             break;
3299         }
3300         case GL_BGR5_A1_ANGLEX:
3301             return BGR5_A1_ANGLEX_to_default;
3302         case GL_BGRA4_ANGLEX:
3303             return BGRA4_ANGLEX_to_default;
3304         case GL_BGRA8_EXT:
3305             return BGRA8_EXT_to_default;
3306         case GL_BGRA8_SRGB_ANGLEX:
3307         {
3308             switch (angleFormat)
3309             {
3310                 case FormatID::B8G8R8A8_UNORM_SRGB:
3311                     return BGRA8_SRGB_ANGLEX_to_B8G8R8A8_UNORM_SRGB;
3312                 default:
3313                     break;
3314             }
3315             break;
3316         }
3317         case GL_BGRA_EXT:
3318             return BGRA_EXT_to_default;
3319         case GL_BGRX8_ANGLEX:
3320         {
3321             switch (angleFormat)
3322             {
3323                 case FormatID::B8G8R8A8_UNORM:
3324                     return BGRX8_ANGLEX_to_B8G8R8A8_UNORM;
3325                 case FormatID::B8G8R8X8_UNORM:
3326                     return BGRX8_ANGLEX_to_B8G8R8X8_UNORM;
3327                 default:
3328                     break;
3329             }
3330             break;
3331         }
3332         case GL_COMPRESSED_R11_EAC:
3333         {
3334             switch (angleFormat)
3335             {
3336                 case FormatID::EAC_R11_UNORM_BLOCK:
3337                     return COMPRESSED_R11_EAC_to_EAC_R11_UNORM_BLOCK;
3338                 case FormatID::R16_FLOAT:
3339                     return COMPRESSED_R11_EAC_to_R16_FLOAT;
3340                 case FormatID::R16_UNORM:
3341                     return COMPRESSED_R11_EAC_to_R16_UNORM;
3342                 default:
3343                     break;
3344             }
3345             break;
3346         }
3347         case GL_COMPRESSED_RED_GREEN_RGTC2_EXT:
3348             return COMPRESSED_RED_GREEN_RGTC2_EXT_to_default;
3349         case GL_COMPRESSED_RED_RGTC1_EXT:
3350             return COMPRESSED_RED_RGTC1_EXT_to_default;
3351         case GL_COMPRESSED_RG11_EAC:
3352         {
3353             switch (angleFormat)
3354             {
3355                 case FormatID::EAC_R11G11_UNORM_BLOCK:
3356                     return COMPRESSED_RG11_EAC_to_EAC_R11G11_UNORM_BLOCK;
3357                 case FormatID::R16G16_FLOAT:
3358                     return COMPRESSED_RG11_EAC_to_R16G16_FLOAT;
3359                 case FormatID::R16G16_UNORM:
3360                     return COMPRESSED_RG11_EAC_to_R16G16_UNORM;
3361                 default:
3362                     break;
3363             }
3364             break;
3365         }
3366         case GL_COMPRESSED_RGB8_ETC2:
3367         {
3368             switch (angleFormat)
3369             {
3370                 case FormatID::ETC2_R8G8B8_UNORM_BLOCK:
3371                     return COMPRESSED_RGB8_ETC2_to_ETC2_R8G8B8_UNORM_BLOCK;
3372                 case FormatID::R8G8B8A8_UNORM:
3373                     return COMPRESSED_RGB8_ETC2_to_R8G8B8A8_UNORM;
3374                 default:
3375                     break;
3376             }
3377             break;
3378         }
3379         case GL_COMPRESSED_RGB8_LOSSY_DECODE_ETC2_ANGLE:
3380         {
3381             switch (angleFormat)
3382             {
3383                 case FormatID::BC1_RGB_UNORM_BLOCK:
3384                     return COMPRESSED_RGB8_LOSSY_DECODE_ETC2_ANGLE_to_BC1_RGB_UNORM_BLOCK;
3385                 default:
3386                     break;
3387             }
3388             break;
3389         }
3390         case GL_COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2:
3391         {
3392             switch (angleFormat)
3393             {
3394                 case FormatID::ETC2_R8G8B8A1_UNORM_BLOCK:
3395                     return COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2_to_ETC2_R8G8B8A1_UNORM_BLOCK;
3396                 case FormatID::R8G8B8A8_UNORM:
3397                     return COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2_to_R8G8B8A8_UNORM;
3398                 default:
3399                     break;
3400             }
3401             break;
3402         }
3403         case GL_COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_LOSSY_DECODE_ETC2_ANGLE:
3404         {
3405             switch (angleFormat)
3406             {
3407                 case FormatID::BC1_RGBA_UNORM_BLOCK:
3408                     return COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_LOSSY_DECODE_ETC2_ANGLE_to_BC1_RGBA_UNORM_BLOCK;
3409                 default:
3410                     break;
3411             }
3412             break;
3413         }
3414         case GL_COMPRESSED_RGBA8_ETC2_EAC:
3415         {
3416             switch (angleFormat)
3417             {
3418                 case FormatID::ETC2_R8G8B8A8_UNORM_BLOCK:
3419                     return COMPRESSED_RGBA8_ETC2_EAC_to_ETC2_R8G8B8A8_UNORM_BLOCK;
3420                 case FormatID::R8G8B8A8_UNORM:
3421                     return COMPRESSED_RGBA8_ETC2_EAC_to_R8G8B8A8_UNORM;
3422                 default:
3423                     break;
3424             }
3425             break;
3426         }
3427         case GL_COMPRESSED_RGBA_ASTC_10x10_KHR:
3428             return COMPRESSED_RGBA_ASTC_10x10_KHR_to_default;
3429         case GL_COMPRESSED_RGBA_ASTC_10x5_KHR:
3430             return COMPRESSED_RGBA_ASTC_10x5_KHR_to_default;
3431         case GL_COMPRESSED_RGBA_ASTC_10x6_KHR:
3432             return COMPRESSED_RGBA_ASTC_10x6_KHR_to_default;
3433         case GL_COMPRESSED_RGBA_ASTC_10x8_KHR:
3434             return COMPRESSED_RGBA_ASTC_10x8_KHR_to_default;
3435         case GL_COMPRESSED_RGBA_ASTC_12x10_KHR:
3436             return COMPRESSED_RGBA_ASTC_12x10_KHR_to_default;
3437         case GL_COMPRESSED_RGBA_ASTC_12x12_KHR:
3438             return COMPRESSED_RGBA_ASTC_12x12_KHR_to_default;
3439         case GL_COMPRESSED_RGBA_ASTC_3x3x3_OES:
3440             return COMPRESSED_RGBA_ASTC_3x3x3_OES_to_default;
3441         case GL_COMPRESSED_RGBA_ASTC_4x3x3_OES:
3442             return COMPRESSED_RGBA_ASTC_4x3x3_OES_to_default;
3443         case GL_COMPRESSED_RGBA_ASTC_4x4_KHR:
3444             return COMPRESSED_RGBA_ASTC_4x4_KHR_to_default;
3445         case GL_COMPRESSED_RGBA_ASTC_4x4x3_OES:
3446             return COMPRESSED_RGBA_ASTC_4x4x3_OES_to_default;
3447         case GL_COMPRESSED_RGBA_ASTC_4x4x4_OES:
3448             return COMPRESSED_RGBA_ASTC_4x4x4_OES_to_default;
3449         case GL_COMPRESSED_RGBA_ASTC_5x4_KHR:
3450             return COMPRESSED_RGBA_ASTC_5x4_KHR_to_default;
3451         case GL_COMPRESSED_RGBA_ASTC_5x4x4_OES:
3452             return COMPRESSED_RGBA_ASTC_5x4x4_OES_to_default;
3453         case GL_COMPRESSED_RGBA_ASTC_5x5_KHR:
3454             return COMPRESSED_RGBA_ASTC_5x5_KHR_to_default;
3455         case GL_COMPRESSED_RGBA_ASTC_5x5x4_OES:
3456             return COMPRESSED_RGBA_ASTC_5x5x4_OES_to_default;
3457         case GL_COMPRESSED_RGBA_ASTC_5x5x5_OES:
3458             return COMPRESSED_RGBA_ASTC_5x5x5_OES_to_default;
3459         case GL_COMPRESSED_RGBA_ASTC_6x5_KHR:
3460             return COMPRESSED_RGBA_ASTC_6x5_KHR_to_default;
3461         case GL_COMPRESSED_RGBA_ASTC_6x5x5_OES:
3462             return COMPRESSED_RGBA_ASTC_6x5x5_OES_to_default;
3463         case GL_COMPRESSED_RGBA_ASTC_6x6_KHR:
3464             return COMPRESSED_RGBA_ASTC_6x6_KHR_to_default;
3465         case GL_COMPRESSED_RGBA_ASTC_6x6x5_OES:
3466             return COMPRESSED_RGBA_ASTC_6x6x5_OES_to_default;
3467         case GL_COMPRESSED_RGBA_ASTC_6x6x6_OES:
3468             return COMPRESSED_RGBA_ASTC_6x6x6_OES_to_default;
3469         case GL_COMPRESSED_RGBA_ASTC_8x5_KHR:
3470             return COMPRESSED_RGBA_ASTC_8x5_KHR_to_default;
3471         case GL_COMPRESSED_RGBA_ASTC_8x6_KHR:
3472             return COMPRESSED_RGBA_ASTC_8x6_KHR_to_default;
3473         case GL_COMPRESSED_RGBA_ASTC_8x8_KHR:
3474             return COMPRESSED_RGBA_ASTC_8x8_KHR_to_default;
3475         case GL_COMPRESSED_RGBA_BPTC_UNORM_EXT:
3476             return COMPRESSED_RGBA_BPTC_UNORM_EXT_to_default;
3477         case GL_COMPRESSED_RGBA_S3TC_DXT1_EXT:
3478             return COMPRESSED_RGBA_S3TC_DXT1_EXT_to_default;
3479         case GL_COMPRESSED_RGBA_S3TC_DXT3_ANGLE:
3480             return COMPRESSED_RGBA_S3TC_DXT3_ANGLE_to_default;
3481         case GL_COMPRESSED_RGBA_S3TC_DXT5_ANGLE:
3482             return COMPRESSED_RGBA_S3TC_DXT5_ANGLE_to_default;
3483         case GL_COMPRESSED_RGB_BPTC_SIGNED_FLOAT_EXT:
3484             return COMPRESSED_RGB_BPTC_SIGNED_FLOAT_EXT_to_default;
3485         case GL_COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_EXT:
3486             return COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_EXT_to_default;
3487         case GL_COMPRESSED_RGB_S3TC_DXT1_EXT:
3488             return COMPRESSED_RGB_S3TC_DXT1_EXT_to_default;
3489         case GL_COMPRESSED_SIGNED_R11_EAC:
3490         {
3491             switch (angleFormat)
3492             {
3493                 case FormatID::EAC_R11_SNORM_BLOCK:
3494                     return COMPRESSED_SIGNED_R11_EAC_to_EAC_R11_SNORM_BLOCK;
3495                 case FormatID::R16_FLOAT:
3496                     return COMPRESSED_SIGNED_R11_EAC_to_R16_FLOAT;
3497                 case FormatID::R16_SNORM:
3498                     return COMPRESSED_SIGNED_R11_EAC_to_R16_SNORM;
3499                 default:
3500                     break;
3501             }
3502             break;
3503         }
3504         case GL_COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT:
3505             return COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT_to_default;
3506         case GL_COMPRESSED_SIGNED_RED_RGTC1_EXT:
3507             return COMPRESSED_SIGNED_RED_RGTC1_EXT_to_default;
3508         case GL_COMPRESSED_SIGNED_RG11_EAC:
3509         {
3510             switch (angleFormat)
3511             {
3512                 case FormatID::EAC_R11G11_SNORM_BLOCK:
3513                     return COMPRESSED_SIGNED_RG11_EAC_to_EAC_R11G11_SNORM_BLOCK;
3514                 case FormatID::R16G16_FLOAT:
3515                     return COMPRESSED_SIGNED_RG11_EAC_to_R16G16_FLOAT;
3516                 case FormatID::R16G16_SNORM:
3517                     return COMPRESSED_SIGNED_RG11_EAC_to_R16G16_SNORM;
3518                 default:
3519                     break;
3520             }
3521             break;
3522         }
3523         case GL_COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR:
3524             return COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR_to_default;
3525         case GL_COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR:
3526             return COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR_to_default;
3527         case GL_COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR:
3528             return COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR_to_default;
3529         case GL_COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR:
3530             return COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR_to_default;
3531         case GL_COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR:
3532             return COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR_to_default;
3533         case GL_COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR:
3534             return COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR_to_default;
3535         case GL_COMPRESSED_SRGB8_ALPHA8_ASTC_3x3x3_OES:
3536             return COMPRESSED_SRGB8_ALPHA8_ASTC_3x3x3_OES_to_default;
3537         case GL_COMPRESSED_SRGB8_ALPHA8_ASTC_4x3x3_OES:
3538             return COMPRESSED_SRGB8_ALPHA8_ASTC_4x3x3_OES_to_default;
3539         case GL_COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR:
3540             return COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR_to_default;
3541         case GL_COMPRESSED_SRGB8_ALPHA8_ASTC_4x4x3_OES:
3542             return COMPRESSED_SRGB8_ALPHA8_ASTC_4x4x3_OES_to_default;
3543         case GL_COMPRESSED_SRGB8_ALPHA8_ASTC_4x4x4_OES:
3544             return COMPRESSED_SRGB8_ALPHA8_ASTC_4x4x4_OES_to_default;
3545         case GL_COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR:
3546             return COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR_to_default;
3547         case GL_COMPRESSED_SRGB8_ALPHA8_ASTC_5x4x4_OES:
3548             return COMPRESSED_SRGB8_ALPHA8_ASTC_5x4x4_OES_to_default;
3549         case GL_COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR:
3550             return COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR_to_default;
3551         case GL_COMPRESSED_SRGB8_ALPHA8_ASTC_5x5x4_OES:
3552             return COMPRESSED_SRGB8_ALPHA8_ASTC_5x5x4_OES_to_default;
3553         case GL_COMPRESSED_SRGB8_ALPHA8_ASTC_5x5x5_OES:
3554             return COMPRESSED_SRGB8_ALPHA8_ASTC_5x5x5_OES_to_default;
3555         case GL_COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR:
3556             return COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR_to_default;
3557         case GL_COMPRESSED_SRGB8_ALPHA8_ASTC_6x5x5_OES:
3558             return COMPRESSED_SRGB8_ALPHA8_ASTC_6x5x5_OES_to_default;
3559         case GL_COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR:
3560             return COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR_to_default;
3561         case GL_COMPRESSED_SRGB8_ALPHA8_ASTC_6x6x5_OES:
3562             return COMPRESSED_SRGB8_ALPHA8_ASTC_6x6x5_OES_to_default;
3563         case GL_COMPRESSED_SRGB8_ALPHA8_ASTC_6x6x6_OES:
3564             return COMPRESSED_SRGB8_ALPHA8_ASTC_6x6x6_OES_to_default;
3565         case GL_COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR:
3566             return COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR_to_default;
3567         case GL_COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR:
3568             return COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR_to_default;
3569         case GL_COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR:
3570             return COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR_to_default;
3571         case GL_COMPRESSED_SRGB8_ALPHA8_ETC2_EAC:
3572         {
3573             switch (angleFormat)
3574             {
3575                 case FormatID::ETC2_R8G8B8A8_SRGB_BLOCK:
3576                     return COMPRESSED_SRGB8_ALPHA8_ETC2_EAC_to_ETC2_R8G8B8A8_SRGB_BLOCK;
3577                 case FormatID::R8G8B8A8_UNORM_SRGB:
3578                     return COMPRESSED_SRGB8_ALPHA8_ETC2_EAC_to_R8G8B8A8_UNORM_SRGB;
3579                 default:
3580                     break;
3581             }
3582             break;
3583         }
3584         case GL_COMPRESSED_SRGB8_ETC2:
3585         {
3586             switch (angleFormat)
3587             {
3588                 case FormatID::ETC2_R8G8B8_SRGB_BLOCK:
3589                     return COMPRESSED_SRGB8_ETC2_to_ETC2_R8G8B8_SRGB_BLOCK;
3590                 case FormatID::R8G8B8A8_UNORM_SRGB:
3591                     return COMPRESSED_SRGB8_ETC2_to_R8G8B8A8_UNORM_SRGB;
3592                 default:
3593                     break;
3594             }
3595             break;
3596         }
3597         case GL_COMPRESSED_SRGB8_LOSSY_DECODE_ETC2_ANGLE:
3598         {
3599             switch (angleFormat)
3600             {
3601                 case FormatID::BC1_RGB_UNORM_SRGB_BLOCK:
3602                     return COMPRESSED_SRGB8_LOSSY_DECODE_ETC2_ANGLE_to_BC1_RGB_UNORM_SRGB_BLOCK;
3603                 default:
3604                     break;
3605             }
3606             break;
3607         }
3608         case GL_COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2:
3609         {
3610             switch (angleFormat)
3611             {
3612                 case FormatID::ETC2_R8G8B8A1_SRGB_BLOCK:
3613                     return COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2_to_ETC2_R8G8B8A1_SRGB_BLOCK;
3614                 case FormatID::R8G8B8A8_UNORM_SRGB:
3615                     return COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2_to_R8G8B8A8_UNORM_SRGB;
3616                 default:
3617                     break;
3618             }
3619             break;
3620         }
3621         case GL_COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_LOSSY_DECODE_ETC2_ANGLE:
3622         {
3623             switch (angleFormat)
3624             {
3625                 case FormatID::BC1_RGBA_UNORM_SRGB_BLOCK:
3626                     return COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_LOSSY_DECODE_ETC2_ANGLE_to_BC1_RGBA_UNORM_SRGB_BLOCK;
3627                 default:
3628                     break;
3629             }
3630             break;
3631         }
3632         case GL_COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT:
3633             return COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT_to_default;
3634         case GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT:
3635             return COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT_to_default;
3636         case GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT:
3637             return COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT_to_default;
3638         case GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT:
3639             return COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT_to_default;
3640         case GL_COMPRESSED_SRGB_S3TC_DXT1_EXT:
3641             return COMPRESSED_SRGB_S3TC_DXT1_EXT_to_default;
3642         case GL_DEPTH24_STENCIL8:
3643         {
3644             switch (angleFormat)
3645             {
3646                 case FormatID::D24_UNORM_S8_UINT:
3647                     return DEPTH24_STENCIL8_to_D24_UNORM_S8_UINT;
3648                 case FormatID::D32_FLOAT_S8X24_UINT:
3649                     return DEPTH24_STENCIL8_to_D32_FLOAT_S8X24_UINT;
3650                 default:
3651                     break;
3652             }
3653             break;
3654         }
3655         case GL_DEPTH32F_STENCIL8:
3656         {
3657             switch (angleFormat)
3658             {
3659                 case FormatID::D24_UNORM_S8_UINT:
3660                     return DEPTH32F_STENCIL8_to_D24_UNORM_S8_UINT;
3661                 case FormatID::D32_FLOAT_S8X24_UINT:
3662                     return DEPTH32F_STENCIL8_to_D32_FLOAT_S8X24_UINT;
3663                 default:
3664                     break;
3665             }
3666             break;
3667         }
3668         case GL_DEPTH_COMPONENT16:
3669         {
3670             switch (angleFormat)
3671             {
3672                 case FormatID::D16_UNORM:
3673                     return DEPTH_COMPONENT16_to_D16_UNORM;
3674                 default:
3675                     break;
3676             }
3677             break;
3678         }
3679         case GL_DEPTH_COMPONENT24:
3680         {
3681             switch (angleFormat)
3682             {
3683                 case FormatID::D24_UNORM_S8_UINT:
3684                     return DEPTH_COMPONENT24_to_D24_UNORM_S8_UINT;
3685                 case FormatID::D24_UNORM_X8_UINT:
3686                     return DEPTH_COMPONENT24_to_D24_UNORM_X8_UINT;
3687                 case FormatID::D32_FLOAT:
3688                     return DEPTH_COMPONENT24_to_D32_FLOAT;
3689                 case FormatID::D32_FLOAT_S8X24_UINT:
3690                     return DEPTH_COMPONENT24_to_D32_FLOAT_S8X24_UINT;
3691                 default:
3692                     break;
3693             }
3694             break;
3695         }
3696         case GL_DEPTH_COMPONENT32F:
3697         {
3698             switch (angleFormat)
3699             {
3700                 case FormatID::D32_FLOAT:
3701                     return DEPTH_COMPONENT32F_to_D32_FLOAT;
3702                 default:
3703                     break;
3704             }
3705             break;
3706         }
3707         case GL_DEPTH_COMPONENT32_OES:
3708         {
3709             switch (angleFormat)
3710             {
3711                 case FormatID::D32_FLOAT:
3712                     return DEPTH_COMPONENT32_OES_to_D32_FLOAT;
3713                 default:
3714                     return DEPTH_COMPONENT32_OES_to_default;
3715             }
3716         }
3717         case GL_ETC1_RGB8_LOSSY_DECODE_ANGLE:
3718         {
3719             switch (angleFormat)
3720             {
3721                 case FormatID::BC1_RGB_UNORM_BLOCK:
3722                     return ETC1_RGB8_LOSSY_DECODE_ANGLE_to_BC1_RGB_UNORM_BLOCK;
3723                 default:
3724                     break;
3725             }
3726             break;
3727         }
3728         case GL_ETC1_RGB8_OES:
3729         {
3730             switch (angleFormat)
3731             {
3732                 case FormatID::ETC1_R8G8B8_UNORM_BLOCK:
3733                     return ETC1_RGB8_OES_to_ETC1_R8G8B8_UNORM_BLOCK;
3734                 case FormatID::ETC2_R8G8B8_UNORM_BLOCK:
3735                     return ETC1_RGB8_OES_to_ETC2_R8G8B8_UNORM_BLOCK;
3736                 case FormatID::R8G8B8A8_UNORM:
3737                     return ETC1_RGB8_OES_to_R8G8B8A8_UNORM;
3738                 default:
3739                     break;
3740             }
3741             break;
3742         }
3743         case GL_G8_B8R8_2PLANE_420_UNORM_ANGLE:
3744             return G8_B8R8_2PLANE_420_UNORM_ANGLE_to_default;
3745         case GL_G8_B8_R8_3PLANE_420_UNORM_ANGLE:
3746             return G8_B8_R8_3PLANE_420_UNORM_ANGLE_to_default;
3747         case GL_LUMINANCE:
3748         {
3749             switch (angleFormat)
3750             {
3751                 case FormatID::R16G16B16A16_FLOAT:
3752                     return LUMINANCE_to_R16G16B16A16_FLOAT;
3753                 case FormatID::R32G32B32A32_FLOAT:
3754                     return LUMINANCE_to_R32G32B32A32_FLOAT;
3755                 default:
3756                     return LUMINANCE_to_default;
3757             }
3758         }
3759         case GL_LUMINANCE16F_EXT:
3760         {
3761             switch (angleFormat)
3762             {
3763                 case FormatID::R16_FLOAT:
3764                     return LUMINANCE16F_EXT_to_R16_FLOAT;
3765                 default:
3766                     return LUMINANCE16F_EXT_to_default;
3767             }
3768         }
3769         case GL_LUMINANCE32F_EXT:
3770         {
3771             switch (angleFormat)
3772             {
3773                 case FormatID::R32_FLOAT:
3774                     return LUMINANCE32F_EXT_to_R32_FLOAT;
3775                 default:
3776                     return LUMINANCE32F_EXT_to_default;
3777             }
3778         }
3779         case GL_LUMINANCE8_ALPHA8_EXT:
3780         {
3781             switch (angleFormat)
3782             {
3783                 case FormatID::R8G8B8A8_UNORM:
3784                     return LUMINANCE8_ALPHA8_EXT_to_R8G8B8A8_UNORM;
3785                 case FormatID::R8G8_UNORM:
3786                     return LUMINANCE8_ALPHA8_EXT_to_R8G8_UNORM;
3787                 default:
3788                     break;
3789             }
3790             break;
3791         }
3792         case GL_LUMINANCE8_EXT:
3793         {
3794             switch (angleFormat)
3795             {
3796                 case FormatID::R8G8B8A8_UNORM:
3797                     return LUMINANCE8_EXT_to_R8G8B8A8_UNORM;
3798                 case FormatID::R8_UNORM:
3799                     return LUMINANCE8_EXT_to_R8_UNORM;
3800                 default:
3801                     break;
3802             }
3803             break;
3804         }
3805         case GL_LUMINANCE_ALPHA:
3806         {
3807             switch (angleFormat)
3808             {
3809                 case FormatID::R16G16B16A16_FLOAT:
3810                     return LUMINANCE_ALPHA_to_R16G16B16A16_FLOAT;
3811                 case FormatID::R32G32B32A32_FLOAT:
3812                     return LUMINANCE_ALPHA_to_R32G32B32A32_FLOAT;
3813                 default:
3814                     return LUMINANCE_ALPHA_to_default;
3815             }
3816         }
3817         case GL_LUMINANCE_ALPHA16F_EXT:
3818         {
3819             switch (angleFormat)
3820             {
3821                 case FormatID::R16G16_FLOAT:
3822                     return LUMINANCE_ALPHA16F_EXT_to_R16G16_FLOAT;
3823                 default:
3824                     return LUMINANCE_ALPHA16F_EXT_to_default;
3825             }
3826         }
3827         case GL_LUMINANCE_ALPHA32F_EXT:
3828         {
3829             switch (angleFormat)
3830             {
3831                 case FormatID::R32G32_FLOAT:
3832                     return LUMINANCE_ALPHA32F_EXT_to_R32G32_FLOAT;
3833                 default:
3834                     return LUMINANCE_ALPHA32F_EXT_to_default;
3835             }
3836         }
3837         case GL_R11F_G11F_B10F:
3838         {
3839             switch (angleFormat)
3840             {
3841                 case FormatID::R11G11B10_FLOAT:
3842                     return R11F_G11F_B10F_to_R11G11B10_FLOAT;
3843                 default:
3844                     break;
3845             }
3846             break;
3847         }
3848         case GL_R16F:
3849         {
3850             switch (angleFormat)
3851             {
3852                 case FormatID::R16_FLOAT:
3853                     return R16F_to_R16_FLOAT;
3854                 default:
3855                     break;
3856             }
3857             break;
3858         }
3859         case GL_R16I:
3860         {
3861             switch (angleFormat)
3862             {
3863                 case FormatID::R16_SINT:
3864                     return R16I_to_R16_SINT;
3865                 default:
3866                     break;
3867             }
3868             break;
3869         }
3870         case GL_R16UI:
3871         {
3872             switch (angleFormat)
3873             {
3874                 case FormatID::R16_UINT:
3875                     return R16UI_to_R16_UINT;
3876                 default:
3877                     break;
3878             }
3879             break;
3880         }
3881         case GL_R16_EXT:
3882         {
3883             switch (angleFormat)
3884             {
3885                 case FormatID::R16_UNORM:
3886                     return R16_EXT_to_R16_UNORM;
3887                 default:
3888                     break;
3889             }
3890             break;
3891         }
3892         case GL_R16_SNORM_EXT:
3893         {
3894             switch (angleFormat)
3895             {
3896                 case FormatID::R16_SNORM:
3897                     return R16_SNORM_EXT_to_R16_SNORM;
3898                 default:
3899                     break;
3900             }
3901             break;
3902         }
3903         case GL_R16_SSCALED_ANGLEX:
3904             return R16_SSCALED_ANGLEX_to_default;
3905         case GL_R16_USCALED_ANGLEX:
3906             return R16_USCALED_ANGLEX_to_default;
3907         case GL_R32F:
3908         {
3909             switch (angleFormat)
3910             {
3911                 case FormatID::R32_FLOAT:
3912                     return R32F_to_R32_FLOAT;
3913                 default:
3914                     break;
3915             }
3916             break;
3917         }
3918         case GL_R32I:
3919         {
3920             switch (angleFormat)
3921             {
3922                 case FormatID::R32_SINT:
3923                     return R32I_to_R32_SINT;
3924                 default:
3925                     break;
3926             }
3927             break;
3928         }
3929         case GL_R32UI:
3930         {
3931             switch (angleFormat)
3932             {
3933                 case FormatID::R32_UINT:
3934                     return R32UI_to_R32_UINT;
3935                 default:
3936                     break;
3937             }
3938             break;
3939         }
3940         case GL_R8:
3941         {
3942             switch (angleFormat)
3943             {
3944                 case FormatID::R8_UNORM:
3945                     return R8_to_R8_UNORM;
3946                 default:
3947                     break;
3948             }
3949             break;
3950         }
3951         case GL_R8I:
3952         {
3953             switch (angleFormat)
3954             {
3955                 case FormatID::R8_SINT:
3956                     return R8I_to_R8_SINT;
3957                 default:
3958                     break;
3959             }
3960             break;
3961         }
3962         case GL_R8UI:
3963         {
3964             switch (angleFormat)
3965             {
3966                 case FormatID::R8_UINT:
3967                     return R8UI_to_R8_UINT;
3968                 default:
3969                     break;
3970             }
3971             break;
3972         }
3973         case GL_R8_SNORM:
3974         {
3975             switch (angleFormat)
3976             {
3977                 case FormatID::R8_SNORM:
3978                     return R8_SNORM_to_R8_SNORM;
3979                 default:
3980                     break;
3981             }
3982             break;
3983         }
3984         case GL_R8_SSCALED_ANGLEX:
3985             return R8_SSCALED_ANGLEX_to_default;
3986         case GL_R8_USCALED_ANGLEX:
3987             return R8_USCALED_ANGLEX_to_default;
3988         case GL_RG16F:
3989         {
3990             switch (angleFormat)
3991             {
3992                 case FormatID::R16G16_FLOAT:
3993                     return RG16F_to_R16G16_FLOAT;
3994                 default:
3995                     break;
3996             }
3997             break;
3998         }
3999         case GL_RG16I:
4000         {
4001             switch (angleFormat)
4002             {
4003                 case FormatID::R16G16_SINT:
4004                     return RG16I_to_R16G16_SINT;
4005                 default:
4006                     break;
4007             }
4008             break;
4009         }
4010         case GL_RG16UI:
4011         {
4012             switch (angleFormat)
4013             {
4014                 case FormatID::R16G16_UINT:
4015                     return RG16UI_to_R16G16_UINT;
4016                 default:
4017                     break;
4018             }
4019             break;
4020         }
4021         case GL_RG16_EXT:
4022         {
4023             switch (angleFormat)
4024             {
4025                 case FormatID::R16G16_UNORM:
4026                     return RG16_EXT_to_R16G16_UNORM;
4027                 default:
4028                     break;
4029             }
4030             break;
4031         }
4032         case GL_RG16_SNORM_EXT:
4033         {
4034             switch (angleFormat)
4035             {
4036                 case FormatID::R16G16_SNORM:
4037                     return RG16_SNORM_EXT_to_R16G16_SNORM;
4038                 default:
4039                     break;
4040             }
4041             break;
4042         }
4043         case GL_RG16_SSCALED_ANGLEX:
4044             return RG16_SSCALED_ANGLEX_to_default;
4045         case GL_RG16_USCALED_ANGLEX:
4046             return RG16_USCALED_ANGLEX_to_default;
4047         case GL_RG32F:
4048         {
4049             switch (angleFormat)
4050             {
4051                 case FormatID::R32G32_FLOAT:
4052                     return RG32F_to_R32G32_FLOAT;
4053                 default:
4054                     break;
4055             }
4056             break;
4057         }
4058         case GL_RG32I:
4059         {
4060             switch (angleFormat)
4061             {
4062                 case FormatID::R32G32_SINT:
4063                     return RG32I_to_R32G32_SINT;
4064                 default:
4065                     break;
4066             }
4067             break;
4068         }
4069         case GL_RG32UI:
4070         {
4071             switch (angleFormat)
4072             {
4073                 case FormatID::R32G32_UINT:
4074                     return RG32UI_to_R32G32_UINT;
4075                 default:
4076                     break;
4077             }
4078             break;
4079         }
4080         case GL_RG8:
4081         {
4082             switch (angleFormat)
4083             {
4084                 case FormatID::R8G8_UNORM:
4085                     return RG8_to_R8G8_UNORM;
4086                 default:
4087                     break;
4088             }
4089             break;
4090         }
4091         case GL_RG8I:
4092         {
4093             switch (angleFormat)
4094             {
4095                 case FormatID::R8G8_SINT:
4096                     return RG8I_to_R8G8_SINT;
4097                 default:
4098                     break;
4099             }
4100             break;
4101         }
4102         case GL_RG8UI:
4103         {
4104             switch (angleFormat)
4105             {
4106                 case FormatID::R8G8_UINT:
4107                     return RG8UI_to_R8G8_UINT;
4108                 default:
4109                     break;
4110             }
4111             break;
4112         }
4113         case GL_RG8_SNORM:
4114         {
4115             switch (angleFormat)
4116             {
4117                 case FormatID::R8G8_SNORM:
4118                     return RG8_SNORM_to_R8G8_SNORM;
4119                 default:
4120                     break;
4121             }
4122             break;
4123         }
4124         case GL_RG8_SSCALED_ANGLEX:
4125             return RG8_SSCALED_ANGLEX_to_default;
4126         case GL_RG8_USCALED_ANGLEX:
4127             return RG8_USCALED_ANGLEX_to_default;
4128         case GL_RGB:
4129             return RGB_to_default;
4130         case GL_RGB10_A2:
4131         {
4132             switch (angleFormat)
4133             {
4134                 case FormatID::R10G10B10A2_UNORM:
4135                     return RGB10_A2_to_R10G10B10A2_UNORM;
4136                 default:
4137                     break;
4138             }
4139             break;
4140         }
4141         case GL_RGB10_A2UI:
4142         {
4143             switch (angleFormat)
4144             {
4145                 case FormatID::R10G10B10A2_UINT:
4146                     return RGB10_A2UI_to_R10G10B10A2_UINT;
4147                 default:
4148                     break;
4149             }
4150             break;
4151         }
4152         case GL_RGB10_A2_SINT_ANGLEX:
4153         {
4154             switch (angleFormat)
4155             {
4156                 case FormatID::R10G10B10A2_SINT:
4157                     return RGB10_A2_SINT_ANGLEX_to_R10G10B10A2_SINT;
4158                 default:
4159                     break;
4160             }
4161             break;
4162         }
4163         case GL_RGB10_A2_SNORM_ANGLEX:
4164         {
4165             switch (angleFormat)
4166             {
4167                 case FormatID::R10G10B10A2_SNORM:
4168                     return RGB10_A2_SNORM_ANGLEX_to_R10G10B10A2_SNORM;
4169                 default:
4170                     break;
4171             }
4172             break;
4173         }
4174         case GL_RGB10_A2_SSCALED_ANGLEX:
4175             return RGB10_A2_SSCALED_ANGLEX_to_default;
4176         case GL_RGB10_A2_USCALED_ANGLEX:
4177             return RGB10_A2_USCALED_ANGLEX_to_default;
4178         case GL_RGB10_UNORM_ANGLEX:
4179         {
4180             switch (angleFormat)
4181             {
4182                 case FormatID::R10G10B10A2_UNORM:
4183                     return RGB10_UNORM_ANGLEX_to_R10G10B10A2_UNORM;
4184                 case FormatID::R10G10B10X2_UNORM:
4185                     return RGB10_UNORM_ANGLEX_to_R10G10B10X2_UNORM;
4186                 default:
4187                     break;
4188             }
4189             break;
4190         }
4191         case GL_RGB16F:
4192         {
4193             switch (angleFormat)
4194             {
4195                 case FormatID::R16G16B16A16_FLOAT:
4196                     return RGB16F_to_R16G16B16A16_FLOAT;
4197                 case FormatID::R16G16B16_FLOAT:
4198                     return RGB16F_to_R16G16B16_FLOAT;
4199                 default:
4200                     break;
4201             }
4202             break;
4203         }
4204         case GL_RGB16I:
4205         {
4206             switch (angleFormat)
4207             {
4208                 case FormatID::R16G16B16A16_SINT:
4209                     return RGB16I_to_R16G16B16A16_SINT;
4210                 case FormatID::R16G16B16_SINT:
4211                     return RGB16I_to_R16G16B16_SINT;
4212                 default:
4213                     break;
4214             }
4215             break;
4216         }
4217         case GL_RGB16UI:
4218         {
4219             switch (angleFormat)
4220             {
4221                 case FormatID::R16G16B16A16_UINT:
4222                     return RGB16UI_to_R16G16B16A16_UINT;
4223                 case FormatID::R16G16B16_UINT:
4224                     return RGB16UI_to_R16G16B16_UINT;
4225                 default:
4226                     break;
4227             }
4228             break;
4229         }
4230         case GL_RGB16_EXT:
4231         {
4232             switch (angleFormat)
4233             {
4234                 case FormatID::R16G16B16A16_UNORM:
4235                     return RGB16_EXT_to_R16G16B16A16_UNORM;
4236                 case FormatID::R16G16B16_UNORM:
4237                     return RGB16_EXT_to_R16G16B16_UNORM;
4238                 default:
4239                     break;
4240             }
4241             break;
4242         }
4243         case GL_RGB16_SNORM_EXT:
4244         {
4245             switch (angleFormat)
4246             {
4247                 case FormatID::R16G16B16A16_SNORM:
4248                     return RGB16_SNORM_EXT_to_R16G16B16A16_SNORM;
4249                 case FormatID::R16G16B16_SNORM:
4250                     return RGB16_SNORM_EXT_to_R16G16B16_SNORM;
4251                 default:
4252                     break;
4253             }
4254             break;
4255         }
4256         case GL_RGB16_SSCALED_ANGLEX:
4257             return RGB16_SSCALED_ANGLEX_to_default;
4258         case GL_RGB16_USCALED_ANGLEX:
4259             return RGB16_USCALED_ANGLEX_to_default;
4260         case GL_RGB32F:
4261         {
4262             switch (angleFormat)
4263             {
4264                 case FormatID::R32G32B32A32_FLOAT:
4265                     return RGB32F_to_R32G32B32A32_FLOAT;
4266                 case FormatID::R32G32B32_FLOAT:
4267                     return RGB32F_to_R32G32B32_FLOAT;
4268                 default:
4269                     break;
4270             }
4271             break;
4272         }
4273         case GL_RGB32I:
4274         {
4275             switch (angleFormat)
4276             {
4277                 case FormatID::R32G32B32A32_SINT:
4278                     return RGB32I_to_R32G32B32A32_SINT;
4279                 case FormatID::R32G32B32_SINT:
4280                     return RGB32I_to_R32G32B32_SINT;
4281                 default:
4282                     break;
4283             }
4284             break;
4285         }
4286         case GL_RGB32UI:
4287         {
4288             switch (angleFormat)
4289             {
4290                 case FormatID::R32G32B32A32_UINT:
4291                     return RGB32UI_to_R32G32B32A32_UINT;
4292                 case FormatID::R32G32B32_UINT:
4293                     return RGB32UI_to_R32G32B32_UINT;
4294                 default:
4295                     break;
4296             }
4297             break;
4298         }
4299         case GL_RGB565:
4300         {
4301             switch (angleFormat)
4302             {
4303                 case FormatID::B5G6R5_UNORM:
4304                     return RGB565_to_B5G6R5_UNORM;
4305                 case FormatID::R5G6B5_UNORM:
4306                     return RGB565_to_R5G6B5_UNORM;
4307                 case FormatID::R8G8B8A8_UNORM:
4308                     return RGB565_to_R8G8B8A8_UNORM;
4309                 default:
4310                     break;
4311             }
4312             break;
4313         }
4314         case GL_RGB5_A1:
4315         {
4316             switch (angleFormat)
4317             {
4318                 case FormatID::A1R5G5B5_UNORM:
4319                     return RGB5_A1_to_A1R5G5B5_UNORM;
4320                 case FormatID::B5G5R5A1_UNORM:
4321                     return RGB5_A1_to_B5G5R5A1_UNORM;
4322                 case FormatID::R5G5B5A1_UNORM:
4323                     return RGB5_A1_to_R5G5B5A1_UNORM;
4324                 case FormatID::R8G8B8A8_UNORM:
4325                     return RGB5_A1_to_R8G8B8A8_UNORM;
4326                 default:
4327                     break;
4328             }
4329             break;
4330         }
4331         case GL_RGB8:
4332         {
4333             switch (angleFormat)
4334             {
4335                 case FormatID::R8G8B8A8_UNORM:
4336                     return RGB8_to_R8G8B8A8_UNORM;
4337                 case FormatID::R8G8B8_UNORM:
4338                     return RGB8_to_R8G8B8_UNORM;
4339                 default:
4340                     break;
4341             }
4342             break;
4343         }
4344         case GL_RGB8I:
4345         {
4346             switch (angleFormat)
4347             {
4348                 case FormatID::R8G8B8A8_SINT:
4349                     return RGB8I_to_R8G8B8A8_SINT;
4350                 case FormatID::R8G8B8_SINT:
4351                     return RGB8I_to_R8G8B8_SINT;
4352                 default:
4353                     break;
4354             }
4355             break;
4356         }
4357         case GL_RGB8UI:
4358         {
4359             switch (angleFormat)
4360             {
4361                 case FormatID::R8G8B8A8_UINT:
4362                     return RGB8UI_to_R8G8B8A8_UINT;
4363                 case FormatID::R8G8B8_UINT:
4364                     return RGB8UI_to_R8G8B8_UINT;
4365                 default:
4366                     break;
4367             }
4368             break;
4369         }
4370         case GL_RGB8_SNORM:
4371         {
4372             switch (angleFormat)
4373             {
4374                 case FormatID::R8G8B8A8_SNORM:
4375                     return RGB8_SNORM_to_R8G8B8A8_SNORM;
4376                 case FormatID::R8G8B8_SNORM:
4377                     return RGB8_SNORM_to_R8G8B8_SNORM;
4378                 default:
4379                     break;
4380             }
4381             break;
4382         }
4383         case GL_RGB8_SSCALED_ANGLEX:
4384             return RGB8_SSCALED_ANGLEX_to_default;
4385         case GL_RGB8_USCALED_ANGLEX:
4386             return RGB8_USCALED_ANGLEX_to_default;
4387         case GL_RGB9_E5:
4388         {
4389             switch (angleFormat)
4390             {
4391                 case FormatID::R9G9B9E5_SHAREDEXP:
4392                     return RGB9_E5_to_R9G9B9E5_SHAREDEXP;
4393                 default:
4394                     break;
4395             }
4396             break;
4397         }
4398         case GL_RGBA:
4399             return RGBA_to_default;
4400         case GL_RGBA16F:
4401         {
4402             switch (angleFormat)
4403             {
4404                 case FormatID::R16G16B16A16_FLOAT:
4405                     return RGBA16F_to_R16G16B16A16_FLOAT;
4406                 default:
4407                     break;
4408             }
4409             break;
4410         }
4411         case GL_RGBA16I:
4412         {
4413             switch (angleFormat)
4414             {
4415                 case FormatID::R16G16B16A16_SINT:
4416                     return RGBA16I_to_R16G16B16A16_SINT;
4417                 default:
4418                     break;
4419             }
4420             break;
4421         }
4422         case GL_RGBA16UI:
4423         {
4424             switch (angleFormat)
4425             {
4426                 case FormatID::R16G16B16A16_UINT:
4427                     return RGBA16UI_to_R16G16B16A16_UINT;
4428                 default:
4429                     break;
4430             }
4431             break;
4432         }
4433         case GL_RGBA16_EXT:
4434         {
4435             switch (angleFormat)
4436             {
4437                 case FormatID::R16G16B16A16_UNORM:
4438                     return RGBA16_EXT_to_R16G16B16A16_UNORM;
4439                 default:
4440                     break;
4441             }
4442             break;
4443         }
4444         case GL_RGBA16_SNORM_EXT:
4445         {
4446             switch (angleFormat)
4447             {
4448                 case FormatID::R16G16B16A16_SNORM:
4449                     return RGBA16_SNORM_EXT_to_R16G16B16A16_SNORM;
4450                 default:
4451                     break;
4452             }
4453             break;
4454         }
4455         case GL_RGBA16_SSCALED_ANGLEX:
4456             return RGBA16_SSCALED_ANGLEX_to_default;
4457         case GL_RGBA16_USCALED_ANGLEX:
4458             return RGBA16_USCALED_ANGLEX_to_default;
4459         case GL_RGBA32F:
4460         {
4461             switch (angleFormat)
4462             {
4463                 case FormatID::R32G32B32A32_FLOAT:
4464                     return RGBA32F_to_R32G32B32A32_FLOAT;
4465                 default:
4466                     break;
4467             }
4468             break;
4469         }
4470         case GL_RGBA32I:
4471         {
4472             switch (angleFormat)
4473             {
4474                 case FormatID::R32G32B32A32_SINT:
4475                     return RGBA32I_to_R32G32B32A32_SINT;
4476                 default:
4477                     break;
4478             }
4479             break;
4480         }
4481         case GL_RGBA32UI:
4482         {
4483             switch (angleFormat)
4484             {
4485                 case FormatID::R32G32B32A32_UINT:
4486                     return RGBA32UI_to_R32G32B32A32_UINT;
4487                 default:
4488                     break;
4489             }
4490             break;
4491         }
4492         case GL_RGBA4:
4493         {
4494             switch (angleFormat)
4495             {
4496                 case FormatID::B4G4R4A4_UNORM:
4497                     return RGBA4_to_B4G4R4A4_UNORM;
4498                 case FormatID::R4G4B4A4_UNORM:
4499                     return RGBA4_to_R4G4B4A4_UNORM;
4500                 case FormatID::R8G8B8A8_UNORM:
4501                     return RGBA4_to_R8G8B8A8_UNORM;
4502                 default:
4503                     break;
4504             }
4505             break;
4506         }
4507         case GL_RGBA8:
4508         {
4509             switch (angleFormat)
4510             {
4511                 case FormatID::R8G8B8A8_UNORM:
4512                     return RGBA8_to_R8G8B8A8_UNORM;
4513                 default:
4514                     break;
4515             }
4516             break;
4517         }
4518         case GL_RGBA8I:
4519         {
4520             switch (angleFormat)
4521             {
4522                 case FormatID::R8G8B8A8_SINT:
4523                     return RGBA8I_to_R8G8B8A8_SINT;
4524                 default:
4525                     break;
4526             }
4527             break;
4528         }
4529         case GL_RGBA8UI:
4530         {
4531             switch (angleFormat)
4532             {
4533                 case FormatID::R8G8B8A8_UINT:
4534                     return RGBA8UI_to_R8G8B8A8_UINT;
4535                 default:
4536                     break;
4537             }
4538             break;
4539         }
4540         case GL_RGBA8_SNORM:
4541         {
4542             switch (angleFormat)
4543             {
4544                 case FormatID::R8G8B8A8_SNORM:
4545                     return RGBA8_SNORM_to_R8G8B8A8_SNORM;
4546                 default:
4547                     break;
4548             }
4549             break;
4550         }
4551         case GL_RGBA8_SSCALED_ANGLEX:
4552             return RGBA8_SSCALED_ANGLEX_to_default;
4553         case GL_RGBA8_USCALED_ANGLEX:
4554             return RGBA8_USCALED_ANGLEX_to_default;
4555         case GL_SR8_EXT:
4556         {
4557             switch (angleFormat)
4558             {
4559                 case FormatID::R8_UNORM_SRGB:
4560                     return SR8_EXT_to_R8_UNORM_SRGB;
4561                 default:
4562                     break;
4563             }
4564             break;
4565         }
4566         case GL_SRG8_EXT:
4567         {
4568             switch (angleFormat)
4569             {
4570                 case FormatID::R8G8_UNORM_SRGB:
4571                     return SRG8_EXT_to_R8G8_UNORM_SRGB;
4572                 default:
4573                     break;
4574             }
4575             break;
4576         }
4577         case GL_SRGB8:
4578         {
4579             switch (angleFormat)
4580             {
4581                 case FormatID::R8G8B8A8_UNORM_SRGB:
4582                     return SRGB8_to_R8G8B8A8_UNORM_SRGB;
4583                 case FormatID::R8G8B8_UNORM_SRGB:
4584                     return SRGB8_to_R8G8B8_UNORM_SRGB;
4585                 default:
4586                     break;
4587             }
4588             break;
4589         }
4590         case GL_SRGB8_ALPHA8:
4591         {
4592             switch (angleFormat)
4593             {
4594                 case FormatID::R8G8B8A8_UNORM_SRGB:
4595                     return SRGB8_ALPHA8_to_R8G8B8A8_UNORM_SRGB;
4596                 default:
4597                     break;
4598             }
4599             break;
4600         }
4601         case GL_STENCIL_INDEX8:
4602         {
4603             switch (angleFormat)
4604             {
4605                 case FormatID::S8_UINT:
4606                     return STENCIL_INDEX8_to_S8_UINT;
4607                 default:
4608                     return STENCIL_INDEX8_to_default;
4609             }
4610         }
4611 
4612         default:
4613             break;
4614     }
4615     // clang-format on
4616     ASSERT(internalFormat == GL_NONE || angleFormat == angle::FormatID::NONE);
4617     static LoadFunctionMap emptyLoadFunctionsMap;
4618     return emptyLoadFunctionsMap;
4619 
4620 }  // GetLoadFunctionsMap
4621 
4622 }  // namespace angle
4623