xref: /aosp_15_r20/external/angle/src/libANGLE/renderer/vulkan/vk_format_table_autogen.cpp (revision 8975f5c5ed3d1c378011245431ada316dfb6f244)
1 // GENERATED FILE - DO NOT EDIT.
2 // Generated by gen_vk_format_table.py using data from vk_format_map.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 // vk_format_table_autogen.cpp:
9 //   Queries for full Vulkan format information based on GL format.
10 
11 #include "libANGLE/renderer/vulkan/vk_format_utils.h"
12 
13 #include "image_util/loadimage.h"
14 
15 using namespace angle;
16 
17 namespace rx
18 {
19 namespace vk
20 {
21 
initialize(Renderer * renderer,const angle::Format & angleFormat)22 void Format::initialize(Renderer *renderer, const angle::Format &angleFormat)
23 {
24     switch (angleFormat.id)
25     {
26         case angle::FormatID::A16_FLOAT:
27             mIntendedGLFormat              = GL_ALPHA16F_EXT;
28             mActualSampleOnlyImageFormatID = angle::FormatID::R16_FLOAT;
29             mImageInitializerFunction      = nullptr;
30 
31             break;
32 
33         case angle::FormatID::A1R5G5B5_UNORM:
34             mIntendedGLFormat              = GL_A1RGB5_ANGLEX;
35             mActualSampleOnlyImageFormatID = angle::FormatID::A1R5G5B5_UNORM;
36             mImageInitializerFunction      = nullptr;
37             mActualBufferFormatID          = angle::FormatID::A1R5G5B5_UNORM;
38             mVkBufferFormatIsPacked        = true;
39             mVertexLoadFunction            = CopyNativeVertexData<GLushort, 1, 1, 0>;
40             mVertexLoadRequiresConversion  = false;
41             break;
42 
43         case angle::FormatID::A2R10G10B10_SINT_VERTEX:
44             mIntendedGLFormat              = GL_INT_10_10_10_2_OES;
45             mActualSampleOnlyImageFormatID = angle::FormatID::NONE;
46             mImageInitializerFunction      = nullptr;
47             mActualBufferFormatID          = angle::FormatID::R16G16B16A16_FLOAT;
48             mVkBufferFormatIsPacked        = false;
49             mVertexLoadFunction            = CopyW2XYZ10ToXYZWFloatVertexData<true, false, true>;
50             mVertexLoadRequiresConversion  = true;
51             break;
52 
53         case angle::FormatID::A2R10G10B10_SNORM_VERTEX:
54             mIntendedGLFormat              = GL_A2_RGB10_SNORM_ANGLEX;
55             mActualSampleOnlyImageFormatID = angle::FormatID::NONE;
56             mImageInitializerFunction      = nullptr;
57             mActualBufferFormatID          = angle::FormatID::R16G16B16A16_FLOAT;
58             mVkBufferFormatIsPacked        = false;
59             mVertexLoadFunction            = CopyW2XYZ10ToXYZWFloatVertexData<true, true, true>;
60             mVertexLoadRequiresConversion  = true;
61             break;
62 
63         case angle::FormatID::A2R10G10B10_SSCALED_VERTEX:
64             mIntendedGLFormat              = GL_A2_RGB10_SSCALED_ANGLEX;
65             mActualSampleOnlyImageFormatID = angle::FormatID::NONE;
66             mImageInitializerFunction      = nullptr;
67             mActualBufferFormatID          = angle::FormatID::R16G16B16A16_FLOAT;
68             mVkBufferFormatIsPacked        = false;
69             mVertexLoadFunction            = CopyW2XYZ10ToXYZWFloatVertexData<true, false, true>;
70             mVertexLoadRequiresConversion  = true;
71             break;
72 
73         case angle::FormatID::A2R10G10B10_UINT_VERTEX:
74             mIntendedGLFormat              = GL_UNSIGNED_INT_10_10_10_2_OES;
75             mActualSampleOnlyImageFormatID = angle::FormatID::NONE;
76             mImageInitializerFunction      = nullptr;
77             mActualBufferFormatID          = angle::FormatID::R16G16B16A16_FLOAT;
78             mVkBufferFormatIsPacked        = false;
79             mVertexLoadFunction            = CopyW2XYZ10ToXYZWFloatVertexData<false, false, true>;
80             mVertexLoadRequiresConversion  = true;
81             break;
82 
83         case angle::FormatID::A2R10G10B10_UNORM_VERTEX:
84             mIntendedGLFormat              = GL_A2_RGB10_UNORM_ANGLEX;
85             mActualSampleOnlyImageFormatID = angle::FormatID::NONE;
86             mImageInitializerFunction      = nullptr;
87             mActualBufferFormatID          = angle::FormatID::R16G16B16A16_FLOAT;
88             mVkBufferFormatIsPacked        = false;
89             mVertexLoadFunction            = CopyW2XYZ10ToXYZWFloatVertexData<false, true, true>;
90             mVertexLoadRequiresConversion  = true;
91             break;
92 
93         case angle::FormatID::A2R10G10B10_USCALED_VERTEX:
94             mIntendedGLFormat              = GL_A2_RGB10_USCALED_ANGLEX;
95             mActualSampleOnlyImageFormatID = angle::FormatID::NONE;
96             mImageInitializerFunction      = nullptr;
97             mActualBufferFormatID          = angle::FormatID::R16G16B16A16_FLOAT;
98             mVkBufferFormatIsPacked        = false;
99             mVertexLoadFunction            = CopyW2XYZ10ToXYZWFloatVertexData<false, false, true>;
100             mVertexLoadRequiresConversion  = true;
101             break;
102 
103         case angle::FormatID::A32_FLOAT:
104             mIntendedGLFormat              = GL_ALPHA32F_EXT;
105             mActualSampleOnlyImageFormatID = angle::FormatID::R32_FLOAT;
106             mImageInitializerFunction      = nullptr;
107 
108             break;
109 
110         case angle::FormatID::A8_UNORM:
111             mIntendedGLFormat              = GL_ALPHA8_EXT;
112             mActualSampleOnlyImageFormatID = angle::FormatID::R8_UNORM;
113             mImageInitializerFunction      = nullptr;
114 
115             break;
116 
117         case angle::FormatID::ASTC_10x10_SRGB_BLOCK:
118             mIntendedGLFormat = GL_COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR;
119             {
120                 static constexpr ImageFormatInitInfo kInfo[] = {
121                     {angle::FormatID::ASTC_10x10_SRGB_BLOCK, nullptr},
122                     {angle::FormatID::R8G8B8A8_UNORM_SRGB, nullptr}};
123                 initImageFallback(renderer, kInfo, ArraySize(kInfo));
124             }
125             mActualBufferFormatID         = angle::FormatID::ASTC_10x10_SRGB_BLOCK;
126             mVkBufferFormatIsPacked       = false;
127             mVertexLoadFunction           = nullptr;
128             mVertexLoadRequiresConversion = false;
129             break;
130 
131         case angle::FormatID::ASTC_10x10_UNORM_BLOCK:
132             mIntendedGLFormat = GL_COMPRESSED_RGBA_ASTC_10x10_KHR;
133             {
134                 static constexpr ImageFormatInitInfo kInfo[] = {
135                     {angle::FormatID::ASTC_10x10_UNORM_BLOCK, nullptr},
136                     {angle::FormatID::R8G8B8A8_UNORM, nullptr}};
137                 initImageFallback(renderer, kInfo, ArraySize(kInfo));
138             }
139             mActualBufferFormatID         = angle::FormatID::ASTC_10x10_UNORM_BLOCK;
140             mVkBufferFormatIsPacked       = false;
141             mVertexLoadFunction           = nullptr;
142             mVertexLoadRequiresConversion = false;
143             break;
144 
145         case angle::FormatID::ASTC_10x5_SRGB_BLOCK:
146             mIntendedGLFormat = GL_COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR;
147             {
148                 static constexpr ImageFormatInitInfo kInfo[] = {
149                     {angle::FormatID::ASTC_10x5_SRGB_BLOCK, nullptr},
150                     {angle::FormatID::R8G8B8A8_UNORM_SRGB, nullptr}};
151                 initImageFallback(renderer, kInfo, ArraySize(kInfo));
152             }
153             mActualBufferFormatID         = angle::FormatID::ASTC_10x5_SRGB_BLOCK;
154             mVkBufferFormatIsPacked       = false;
155             mVertexLoadFunction           = nullptr;
156             mVertexLoadRequiresConversion = false;
157             break;
158 
159         case angle::FormatID::ASTC_10x5_UNORM_BLOCK:
160             mIntendedGLFormat = GL_COMPRESSED_RGBA_ASTC_10x5_KHR;
161             {
162                 static constexpr ImageFormatInitInfo kInfo[] = {
163                     {angle::FormatID::ASTC_10x5_UNORM_BLOCK, nullptr},
164                     {angle::FormatID::R8G8B8A8_UNORM, nullptr}};
165                 initImageFallback(renderer, kInfo, ArraySize(kInfo));
166             }
167             mActualBufferFormatID         = angle::FormatID::ASTC_10x5_UNORM_BLOCK;
168             mVkBufferFormatIsPacked       = false;
169             mVertexLoadFunction           = nullptr;
170             mVertexLoadRequiresConversion = false;
171             break;
172 
173         case angle::FormatID::ASTC_10x6_SRGB_BLOCK:
174             mIntendedGLFormat = GL_COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR;
175             {
176                 static constexpr ImageFormatInitInfo kInfo[] = {
177                     {angle::FormatID::ASTC_10x6_SRGB_BLOCK, nullptr},
178                     {angle::FormatID::R8G8B8A8_UNORM_SRGB, nullptr}};
179                 initImageFallback(renderer, kInfo, ArraySize(kInfo));
180             }
181             mActualBufferFormatID         = angle::FormatID::ASTC_10x6_SRGB_BLOCK;
182             mVkBufferFormatIsPacked       = false;
183             mVertexLoadFunction           = nullptr;
184             mVertexLoadRequiresConversion = false;
185             break;
186 
187         case angle::FormatID::ASTC_10x6_UNORM_BLOCK:
188             mIntendedGLFormat = GL_COMPRESSED_RGBA_ASTC_10x6_KHR;
189             {
190                 static constexpr ImageFormatInitInfo kInfo[] = {
191                     {angle::FormatID::ASTC_10x6_UNORM_BLOCK, nullptr},
192                     {angle::FormatID::R8G8B8A8_UNORM, nullptr}};
193                 initImageFallback(renderer, kInfo, ArraySize(kInfo));
194             }
195             mActualBufferFormatID         = angle::FormatID::ASTC_10x6_UNORM_BLOCK;
196             mVkBufferFormatIsPacked       = false;
197             mVertexLoadFunction           = nullptr;
198             mVertexLoadRequiresConversion = false;
199             break;
200 
201         case angle::FormatID::ASTC_10x8_SRGB_BLOCK:
202             mIntendedGLFormat = GL_COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR;
203             {
204                 static constexpr ImageFormatInitInfo kInfo[] = {
205                     {angle::FormatID::ASTC_10x8_SRGB_BLOCK, nullptr},
206                     {angle::FormatID::R8G8B8A8_UNORM_SRGB, nullptr}};
207                 initImageFallback(renderer, kInfo, ArraySize(kInfo));
208             }
209             mActualBufferFormatID         = angle::FormatID::ASTC_10x8_SRGB_BLOCK;
210             mVkBufferFormatIsPacked       = false;
211             mVertexLoadFunction           = nullptr;
212             mVertexLoadRequiresConversion = false;
213             break;
214 
215         case angle::FormatID::ASTC_10x8_UNORM_BLOCK:
216             mIntendedGLFormat = GL_COMPRESSED_RGBA_ASTC_10x8_KHR;
217             {
218                 static constexpr ImageFormatInitInfo kInfo[] = {
219                     {angle::FormatID::ASTC_10x8_UNORM_BLOCK, nullptr},
220                     {angle::FormatID::R8G8B8A8_UNORM, nullptr}};
221                 initImageFallback(renderer, kInfo, ArraySize(kInfo));
222             }
223             mActualBufferFormatID         = angle::FormatID::ASTC_10x8_UNORM_BLOCK;
224             mVkBufferFormatIsPacked       = false;
225             mVertexLoadFunction           = nullptr;
226             mVertexLoadRequiresConversion = false;
227             break;
228 
229         case angle::FormatID::ASTC_12x10_SRGB_BLOCK:
230             mIntendedGLFormat = GL_COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR;
231             {
232                 static constexpr ImageFormatInitInfo kInfo[] = {
233                     {angle::FormatID::ASTC_12x10_SRGB_BLOCK, nullptr},
234                     {angle::FormatID::R8G8B8A8_UNORM_SRGB, nullptr}};
235                 initImageFallback(renderer, kInfo, ArraySize(kInfo));
236             }
237             mActualBufferFormatID         = angle::FormatID::ASTC_12x10_SRGB_BLOCK;
238             mVkBufferFormatIsPacked       = false;
239             mVertexLoadFunction           = nullptr;
240             mVertexLoadRequiresConversion = false;
241             break;
242 
243         case angle::FormatID::ASTC_12x10_UNORM_BLOCK:
244             mIntendedGLFormat = GL_COMPRESSED_RGBA_ASTC_12x10_KHR;
245             {
246                 static constexpr ImageFormatInitInfo kInfo[] = {
247                     {angle::FormatID::ASTC_12x10_UNORM_BLOCK, nullptr},
248                     {angle::FormatID::R8G8B8A8_UNORM, nullptr}};
249                 initImageFallback(renderer, kInfo, ArraySize(kInfo));
250             }
251             mActualBufferFormatID         = angle::FormatID::ASTC_12x10_UNORM_BLOCK;
252             mVkBufferFormatIsPacked       = false;
253             mVertexLoadFunction           = nullptr;
254             mVertexLoadRequiresConversion = false;
255             break;
256 
257         case angle::FormatID::ASTC_12x12_SRGB_BLOCK:
258             mIntendedGLFormat = GL_COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR;
259             {
260                 static constexpr ImageFormatInitInfo kInfo[] = {
261                     {angle::FormatID::ASTC_12x12_SRGB_BLOCK, nullptr},
262                     {angle::FormatID::R8G8B8A8_UNORM_SRGB, nullptr}};
263                 initImageFallback(renderer, kInfo, ArraySize(kInfo));
264             }
265             mActualBufferFormatID         = angle::FormatID::ASTC_12x12_SRGB_BLOCK;
266             mVkBufferFormatIsPacked       = false;
267             mVertexLoadFunction           = nullptr;
268             mVertexLoadRequiresConversion = false;
269             break;
270 
271         case angle::FormatID::ASTC_12x12_UNORM_BLOCK:
272             mIntendedGLFormat = GL_COMPRESSED_RGBA_ASTC_12x12_KHR;
273             {
274                 static constexpr ImageFormatInitInfo kInfo[] = {
275                     {angle::FormatID::ASTC_12x12_UNORM_BLOCK, nullptr},
276                     {angle::FormatID::R8G8B8A8_UNORM, nullptr}};
277                 initImageFallback(renderer, kInfo, ArraySize(kInfo));
278             }
279             mActualBufferFormatID         = angle::FormatID::ASTC_12x12_UNORM_BLOCK;
280             mVkBufferFormatIsPacked       = false;
281             mVertexLoadFunction           = nullptr;
282             mVertexLoadRequiresConversion = false;
283             break;
284 
285         case angle::FormatID::ASTC_3x3x3_UNORM_BLOCK:
286             // This format is not implemented in Vulkan.
287             break;
288 
289         case angle::FormatID::ASTC_3x3x3_UNORM_SRGB_BLOCK:
290             // This format is not implemented in Vulkan.
291             break;
292 
293         case angle::FormatID::ASTC_4x3x3_UNORM_BLOCK:
294             // This format is not implemented in Vulkan.
295             break;
296 
297         case angle::FormatID::ASTC_4x3x3_UNORM_SRGB_BLOCK:
298             // This format is not implemented in Vulkan.
299             break;
300 
301         case angle::FormatID::ASTC_4x4_SRGB_BLOCK:
302             mIntendedGLFormat = GL_COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR;
303             {
304                 static constexpr ImageFormatInitInfo kInfo[] = {
305                     {angle::FormatID::ASTC_4x4_SRGB_BLOCK, nullptr},
306                     {angle::FormatID::R8G8B8A8_UNORM_SRGB, nullptr}};
307                 initImageFallback(renderer, kInfo, ArraySize(kInfo));
308             }
309             mActualBufferFormatID         = angle::FormatID::ASTC_4x4_SRGB_BLOCK;
310             mVkBufferFormatIsPacked       = false;
311             mVertexLoadFunction           = nullptr;
312             mVertexLoadRequiresConversion = false;
313             break;
314 
315         case angle::FormatID::ASTC_4x4_UNORM_BLOCK:
316             mIntendedGLFormat = GL_COMPRESSED_RGBA_ASTC_4x4_KHR;
317             {
318                 static constexpr ImageFormatInitInfo kInfo[] = {
319                     {angle::FormatID::ASTC_4x4_UNORM_BLOCK, nullptr},
320                     {angle::FormatID::R8G8B8A8_UNORM, nullptr}};
321                 initImageFallback(renderer, kInfo, ArraySize(kInfo));
322             }
323             mActualBufferFormatID         = angle::FormatID::ASTC_4x4_UNORM_BLOCK;
324             mVkBufferFormatIsPacked       = false;
325             mVertexLoadFunction           = nullptr;
326             mVertexLoadRequiresConversion = false;
327             break;
328 
329         case angle::FormatID::ASTC_4x4x3_UNORM_BLOCK:
330             // This format is not implemented in Vulkan.
331             break;
332 
333         case angle::FormatID::ASTC_4x4x3_UNORM_SRGB_BLOCK:
334             // This format is not implemented in Vulkan.
335             break;
336 
337         case angle::FormatID::ASTC_4x4x4_UNORM_BLOCK:
338             // This format is not implemented in Vulkan.
339             break;
340 
341         case angle::FormatID::ASTC_4x4x4_UNORM_SRGB_BLOCK:
342             // This format is not implemented in Vulkan.
343             break;
344 
345         case angle::FormatID::ASTC_5x4_SRGB_BLOCK:
346             mIntendedGLFormat = GL_COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR;
347             {
348                 static constexpr ImageFormatInitInfo kInfo[] = {
349                     {angle::FormatID::ASTC_5x4_SRGB_BLOCK, nullptr},
350                     {angle::FormatID::R8G8B8A8_UNORM_SRGB, nullptr}};
351                 initImageFallback(renderer, kInfo, ArraySize(kInfo));
352             }
353             mActualBufferFormatID         = angle::FormatID::ASTC_5x4_SRGB_BLOCK;
354             mVkBufferFormatIsPacked       = false;
355             mVertexLoadFunction           = nullptr;
356             mVertexLoadRequiresConversion = false;
357             break;
358 
359         case angle::FormatID::ASTC_5x4_UNORM_BLOCK:
360             mIntendedGLFormat = GL_COMPRESSED_RGBA_ASTC_5x4_KHR;
361             {
362                 static constexpr ImageFormatInitInfo kInfo[] = {
363                     {angle::FormatID::ASTC_5x4_UNORM_BLOCK, nullptr},
364                     {angle::FormatID::R8G8B8A8_UNORM, nullptr}};
365                 initImageFallback(renderer, kInfo, ArraySize(kInfo));
366             }
367             mActualBufferFormatID         = angle::FormatID::ASTC_5x4_UNORM_BLOCK;
368             mVkBufferFormatIsPacked       = false;
369             mVertexLoadFunction           = nullptr;
370             mVertexLoadRequiresConversion = false;
371             break;
372 
373         case angle::FormatID::ASTC_5x4x4_UNORM_BLOCK:
374             // This format is not implemented in Vulkan.
375             break;
376 
377         case angle::FormatID::ASTC_5x4x4_UNORM_SRGB_BLOCK:
378             // This format is not implemented in Vulkan.
379             break;
380 
381         case angle::FormatID::ASTC_5x5_SRGB_BLOCK:
382             mIntendedGLFormat = GL_COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR;
383             {
384                 static constexpr ImageFormatInitInfo kInfo[] = {
385                     {angle::FormatID::ASTC_5x5_SRGB_BLOCK, nullptr},
386                     {angle::FormatID::R8G8B8A8_UNORM_SRGB, nullptr}};
387                 initImageFallback(renderer, kInfo, ArraySize(kInfo));
388             }
389             mActualBufferFormatID         = angle::FormatID::ASTC_5x5_SRGB_BLOCK;
390             mVkBufferFormatIsPacked       = false;
391             mVertexLoadFunction           = nullptr;
392             mVertexLoadRequiresConversion = false;
393             break;
394 
395         case angle::FormatID::ASTC_5x5_UNORM_BLOCK:
396             mIntendedGLFormat = GL_COMPRESSED_RGBA_ASTC_5x5_KHR;
397             {
398                 static constexpr ImageFormatInitInfo kInfo[] = {
399                     {angle::FormatID::ASTC_5x5_UNORM_BLOCK, nullptr},
400                     {angle::FormatID::R8G8B8A8_UNORM, nullptr}};
401                 initImageFallback(renderer, kInfo, ArraySize(kInfo));
402             }
403             mActualBufferFormatID         = angle::FormatID::ASTC_5x5_UNORM_BLOCK;
404             mVkBufferFormatIsPacked       = false;
405             mVertexLoadFunction           = nullptr;
406             mVertexLoadRequiresConversion = false;
407             break;
408 
409         case angle::FormatID::ASTC_5x5x4_UNORM_BLOCK:
410             // This format is not implemented in Vulkan.
411             break;
412 
413         case angle::FormatID::ASTC_5x5x4_UNORM_SRGB_BLOCK:
414             // This format is not implemented in Vulkan.
415             break;
416 
417         case angle::FormatID::ASTC_5x5x5_UNORM_BLOCK:
418             // This format is not implemented in Vulkan.
419             break;
420 
421         case angle::FormatID::ASTC_5x5x5_UNORM_SRGB_BLOCK:
422             // This format is not implemented in Vulkan.
423             break;
424 
425         case angle::FormatID::ASTC_6x5_SRGB_BLOCK:
426             mIntendedGLFormat = GL_COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR;
427             {
428                 static constexpr ImageFormatInitInfo kInfo[] = {
429                     {angle::FormatID::ASTC_6x5_SRGB_BLOCK, nullptr},
430                     {angle::FormatID::R8G8B8A8_UNORM_SRGB, nullptr}};
431                 initImageFallback(renderer, kInfo, ArraySize(kInfo));
432             }
433             mActualBufferFormatID         = angle::FormatID::ASTC_6x5_SRGB_BLOCK;
434             mVkBufferFormatIsPacked       = false;
435             mVertexLoadFunction           = nullptr;
436             mVertexLoadRequiresConversion = false;
437             break;
438 
439         case angle::FormatID::ASTC_6x5_UNORM_BLOCK:
440             mIntendedGLFormat = GL_COMPRESSED_RGBA_ASTC_6x5_KHR;
441             {
442                 static constexpr ImageFormatInitInfo kInfo[] = {
443                     {angle::FormatID::ASTC_6x5_UNORM_BLOCK, nullptr},
444                     {angle::FormatID::R8G8B8A8_UNORM, nullptr}};
445                 initImageFallback(renderer, kInfo, ArraySize(kInfo));
446             }
447             mActualBufferFormatID         = angle::FormatID::ASTC_6x5_UNORM_BLOCK;
448             mVkBufferFormatIsPacked       = false;
449             mVertexLoadFunction           = nullptr;
450             mVertexLoadRequiresConversion = false;
451             break;
452 
453         case angle::FormatID::ASTC_6x5x5_UNORM_BLOCK:
454             // This format is not implemented in Vulkan.
455             break;
456 
457         case angle::FormatID::ASTC_6x5x5_UNORM_SRGB_BLOCK:
458             // This format is not implemented in Vulkan.
459             break;
460 
461         case angle::FormatID::ASTC_6x6_SRGB_BLOCK:
462             mIntendedGLFormat = GL_COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR;
463             {
464                 static constexpr ImageFormatInitInfo kInfo[] = {
465                     {angle::FormatID::ASTC_6x6_SRGB_BLOCK, nullptr},
466                     {angle::FormatID::R8G8B8A8_UNORM_SRGB, nullptr}};
467                 initImageFallback(renderer, kInfo, ArraySize(kInfo));
468             }
469             mActualBufferFormatID         = angle::FormatID::ASTC_6x6_SRGB_BLOCK;
470             mVkBufferFormatIsPacked       = false;
471             mVertexLoadFunction           = nullptr;
472             mVertexLoadRequiresConversion = false;
473             break;
474 
475         case angle::FormatID::ASTC_6x6_UNORM_BLOCK:
476             mIntendedGLFormat = GL_COMPRESSED_RGBA_ASTC_6x6_KHR;
477             {
478                 static constexpr ImageFormatInitInfo kInfo[] = {
479                     {angle::FormatID::ASTC_6x6_UNORM_BLOCK, nullptr},
480                     {angle::FormatID::R8G8B8A8_UNORM, nullptr}};
481                 initImageFallback(renderer, kInfo, ArraySize(kInfo));
482             }
483             mActualBufferFormatID         = angle::FormatID::ASTC_6x6_UNORM_BLOCK;
484             mVkBufferFormatIsPacked       = false;
485             mVertexLoadFunction           = nullptr;
486             mVertexLoadRequiresConversion = false;
487             break;
488 
489         case angle::FormatID::ASTC_6x6x5_UNORM_BLOCK:
490             // This format is not implemented in Vulkan.
491             break;
492 
493         case angle::FormatID::ASTC_6x6x5_UNORM_SRGB_BLOCK:
494             // This format is not implemented in Vulkan.
495             break;
496 
497         case angle::FormatID::ASTC_6x6x6_UNORM_BLOCK:
498             // This format is not implemented in Vulkan.
499             break;
500 
501         case angle::FormatID::ASTC_6x6x6_UNORM_SRGB_BLOCK:
502             // This format is not implemented in Vulkan.
503             break;
504 
505         case angle::FormatID::ASTC_8x5_SRGB_BLOCK:
506             mIntendedGLFormat = GL_COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR;
507             {
508                 static constexpr ImageFormatInitInfo kInfo[] = {
509                     {angle::FormatID::ASTC_8x5_SRGB_BLOCK, nullptr},
510                     {angle::FormatID::R8G8B8A8_UNORM_SRGB, nullptr}};
511                 initImageFallback(renderer, kInfo, ArraySize(kInfo));
512             }
513             mActualBufferFormatID         = angle::FormatID::ASTC_8x5_SRGB_BLOCK;
514             mVkBufferFormatIsPacked       = false;
515             mVertexLoadFunction           = nullptr;
516             mVertexLoadRequiresConversion = false;
517             break;
518 
519         case angle::FormatID::ASTC_8x5_UNORM_BLOCK:
520             mIntendedGLFormat = GL_COMPRESSED_RGBA_ASTC_8x5_KHR;
521             {
522                 static constexpr ImageFormatInitInfo kInfo[] = {
523                     {angle::FormatID::ASTC_8x5_UNORM_BLOCK, nullptr},
524                     {angle::FormatID::R8G8B8A8_UNORM, nullptr}};
525                 initImageFallback(renderer, kInfo, ArraySize(kInfo));
526             }
527             mActualBufferFormatID         = angle::FormatID::ASTC_8x5_UNORM_BLOCK;
528             mVkBufferFormatIsPacked       = false;
529             mVertexLoadFunction           = nullptr;
530             mVertexLoadRequiresConversion = false;
531             break;
532 
533         case angle::FormatID::ASTC_8x6_SRGB_BLOCK:
534             mIntendedGLFormat = GL_COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR;
535             {
536                 static constexpr ImageFormatInitInfo kInfo[] = {
537                     {angle::FormatID::ASTC_8x6_SRGB_BLOCK, nullptr},
538                     {angle::FormatID::R8G8B8A8_UNORM_SRGB, nullptr}};
539                 initImageFallback(renderer, kInfo, ArraySize(kInfo));
540             }
541             mActualBufferFormatID         = angle::FormatID::ASTC_8x6_SRGB_BLOCK;
542             mVkBufferFormatIsPacked       = false;
543             mVertexLoadFunction           = nullptr;
544             mVertexLoadRequiresConversion = false;
545             break;
546 
547         case angle::FormatID::ASTC_8x6_UNORM_BLOCK:
548             mIntendedGLFormat = GL_COMPRESSED_RGBA_ASTC_8x6_KHR;
549             {
550                 static constexpr ImageFormatInitInfo kInfo[] = {
551                     {angle::FormatID::ASTC_8x6_UNORM_BLOCK, nullptr},
552                     {angle::FormatID::R8G8B8A8_UNORM, nullptr}};
553                 initImageFallback(renderer, kInfo, ArraySize(kInfo));
554             }
555             mActualBufferFormatID         = angle::FormatID::ASTC_8x6_UNORM_BLOCK;
556             mVkBufferFormatIsPacked       = false;
557             mVertexLoadFunction           = nullptr;
558             mVertexLoadRequiresConversion = false;
559             break;
560 
561         case angle::FormatID::ASTC_8x8_SRGB_BLOCK:
562             mIntendedGLFormat = GL_COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR;
563             {
564                 static constexpr ImageFormatInitInfo kInfo[] = {
565                     {angle::FormatID::ASTC_8x8_SRGB_BLOCK, nullptr},
566                     {angle::FormatID::R8G8B8A8_UNORM_SRGB, nullptr}};
567                 initImageFallback(renderer, kInfo, ArraySize(kInfo));
568             }
569             mActualBufferFormatID         = angle::FormatID::ASTC_8x8_SRGB_BLOCK;
570             mVkBufferFormatIsPacked       = false;
571             mVertexLoadFunction           = nullptr;
572             mVertexLoadRequiresConversion = false;
573             break;
574 
575         case angle::FormatID::ASTC_8x8_UNORM_BLOCK:
576             mIntendedGLFormat = GL_COMPRESSED_RGBA_ASTC_8x8_KHR;
577             {
578                 static constexpr ImageFormatInitInfo kInfo[] = {
579                     {angle::FormatID::ASTC_8x8_UNORM_BLOCK, nullptr},
580                     {angle::FormatID::R8G8B8A8_UNORM, nullptr}};
581                 initImageFallback(renderer, kInfo, ArraySize(kInfo));
582             }
583             mActualBufferFormatID         = angle::FormatID::ASTC_8x8_UNORM_BLOCK;
584             mVkBufferFormatIsPacked       = false;
585             mVertexLoadFunction           = nullptr;
586             mVertexLoadRequiresConversion = false;
587             break;
588 
589         case angle::FormatID::B10G10R10A2_UNORM:
590             mIntendedGLFormat              = GL_BGR10_A2_ANGLEX;
591             mActualSampleOnlyImageFormatID = angle::FormatID::B10G10R10A2_UNORM;
592             mImageInitializerFunction      = nullptr;
593             mActualBufferFormatID          = angle::FormatID::B10G10R10A2_UNORM;
594             mVkBufferFormatIsPacked        = true;
595             mVertexLoadFunction            = CopyNativeVertexData<GLuint, 1, 1, 0>;
596             mVertexLoadRequiresConversion  = false;
597             break;
598 
599         case angle::FormatID::B4G4R4A4_UNORM:
600             mIntendedGLFormat              = GL_BGRA4_ANGLEX;
601             mActualSampleOnlyImageFormatID = angle::FormatID::B4G4R4A4_UNORM;
602             mImageInitializerFunction      = nullptr;
603             mActualBufferFormatID          = angle::FormatID::B4G4R4A4_UNORM;
604             mVkBufferFormatIsPacked        = true;
605             mVertexLoadFunction            = CopyNativeVertexData<GLushort, 1, 1, 0>;
606             mVertexLoadRequiresConversion  = false;
607             break;
608 
609         case angle::FormatID::B5G5R5A1_UNORM:
610             mIntendedGLFormat              = GL_BGR5_A1_ANGLEX;
611             mActualSampleOnlyImageFormatID = angle::FormatID::B5G5R5A1_UNORM;
612             mImageInitializerFunction      = nullptr;
613             mActualBufferFormatID          = angle::FormatID::B5G5R5A1_UNORM;
614             mVkBufferFormatIsPacked        = true;
615             mVertexLoadFunction            = CopyNativeVertexData<GLushort, 1, 1, 0>;
616             mVertexLoadRequiresConversion  = false;
617             break;
618 
619         case angle::FormatID::B5G6R5_UNORM:
620             mIntendedGLFormat              = GL_BGR565_ANGLEX;
621             mActualSampleOnlyImageFormatID = angle::FormatID::B5G6R5_UNORM;
622             mImageInitializerFunction      = nullptr;
623             mActualBufferFormatID          = angle::FormatID::B5G6R5_UNORM;
624             mVkBufferFormatIsPacked        = true;
625             mVertexLoadFunction            = CopyNativeVertexData<GLushort, 1, 1, 0>;
626             mVertexLoadRequiresConversion  = false;
627             break;
628 
629         case angle::FormatID::B8G8R8A8_TYPELESS:
630             // This format is not implemented in Vulkan.
631             break;
632 
633         case angle::FormatID::B8G8R8A8_TYPELESS_SRGB:
634             // This format is not implemented in Vulkan.
635             break;
636 
637         case angle::FormatID::B8G8R8A8_UNORM:
638             mIntendedGLFormat              = GL_BGRA8_EXT;
639             mActualSampleOnlyImageFormatID = angle::FormatID::B8G8R8A8_UNORM;
640             mImageInitializerFunction      = nullptr;
641             mActualBufferFormatID          = angle::FormatID::B8G8R8A8_UNORM;
642             mVkBufferFormatIsPacked        = false;
643             mVertexLoadFunction            = CopyNativeVertexData<GLubyte, 4, 4, 0>;
644             mVertexLoadRequiresConversion  = false;
645             break;
646 
647         case angle::FormatID::B8G8R8A8_UNORM_SRGB:
648             mIntendedGLFormat              = GL_BGRA8_SRGB_ANGLEX;
649             mActualSampleOnlyImageFormatID = angle::FormatID::B8G8R8A8_UNORM_SRGB;
650             mImageInitializerFunction      = nullptr;
651             mActualBufferFormatID          = angle::FormatID::B8G8R8A8_UNORM_SRGB;
652             mVkBufferFormatIsPacked        = false;
653             mVertexLoadFunction            = CopyNativeVertexData<GLubyte, 4, 4, 0>;
654             mVertexLoadRequiresConversion  = false;
655             break;
656 
657         case angle::FormatID::B8G8R8X8_UNORM:
658             mIntendedGLFormat              = GL_BGRX8_ANGLEX;
659             mActualSampleOnlyImageFormatID = angle::FormatID::B8G8R8A8_UNORM;
660             mImageInitializerFunction      = nullptr;
661             mActualBufferFormatID          = angle::FormatID::NONE;
662             mVkBufferFormatIsPacked        = false;
663             mVertexLoadFunction            = nullptr;
664             mVertexLoadRequiresConversion  = true;
665             break;
666 
667         case angle::FormatID::B8G8R8X8_UNORM_SRGB:
668             mIntendedGLFormat              = GL_BGRX8_SRGB_ANGLEX;
669             mActualSampleOnlyImageFormatID = angle::FormatID::B8G8R8A8_UNORM_SRGB;
670             mImageInitializerFunction      = nullptr;
671             mActualBufferFormatID          = angle::FormatID::NONE;
672             mVkBufferFormatIsPacked        = false;
673             mVertexLoadFunction            = nullptr;
674             mVertexLoadRequiresConversion  = true;
675             break;
676 
677         case angle::FormatID::BC1_RGBA_UNORM_BLOCK:
678             mIntendedGLFormat              = GL_COMPRESSED_RGBA_S3TC_DXT1_EXT;
679             mActualSampleOnlyImageFormatID = angle::FormatID::BC1_RGBA_UNORM_BLOCK;
680             mImageInitializerFunction      = nullptr;
681             mActualBufferFormatID          = angle::FormatID::BC1_RGBA_UNORM_BLOCK;
682             mVkBufferFormatIsPacked        = false;
683             mVertexLoadFunction            = nullptr;
684             mVertexLoadRequiresConversion  = false;
685             break;
686 
687         case angle::FormatID::BC1_RGBA_UNORM_SRGB_BLOCK:
688             mIntendedGLFormat              = GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT;
689             mActualSampleOnlyImageFormatID = angle::FormatID::BC1_RGBA_UNORM_SRGB_BLOCK;
690             mImageInitializerFunction      = nullptr;
691             mActualBufferFormatID          = angle::FormatID::BC1_RGBA_UNORM_SRGB_BLOCK;
692             mVkBufferFormatIsPacked        = false;
693             mVertexLoadFunction            = nullptr;
694             mVertexLoadRequiresConversion  = false;
695             break;
696 
697         case angle::FormatID::BC1_RGB_UNORM_BLOCK:
698             mIntendedGLFormat              = GL_COMPRESSED_RGB_S3TC_DXT1_EXT;
699             mActualSampleOnlyImageFormatID = angle::FormatID::BC1_RGB_UNORM_BLOCK;
700             mImageInitializerFunction      = nullptr;
701             mActualBufferFormatID          = angle::FormatID::BC1_RGB_UNORM_BLOCK;
702             mVkBufferFormatIsPacked        = false;
703             mVertexLoadFunction            = nullptr;
704             mVertexLoadRequiresConversion  = false;
705             break;
706 
707         case angle::FormatID::BC1_RGB_UNORM_SRGB_BLOCK:
708             mIntendedGLFormat              = GL_COMPRESSED_SRGB_S3TC_DXT1_EXT;
709             mActualSampleOnlyImageFormatID = angle::FormatID::BC1_RGB_UNORM_SRGB_BLOCK;
710             mImageInitializerFunction      = nullptr;
711             mActualBufferFormatID          = angle::FormatID::BC1_RGB_UNORM_SRGB_BLOCK;
712             mVkBufferFormatIsPacked        = false;
713             mVertexLoadFunction            = nullptr;
714             mVertexLoadRequiresConversion  = false;
715             break;
716 
717         case angle::FormatID::BC2_RGBA_UNORM_BLOCK:
718             mIntendedGLFormat              = GL_COMPRESSED_RGBA_S3TC_DXT3_ANGLE;
719             mActualSampleOnlyImageFormatID = angle::FormatID::BC2_RGBA_UNORM_BLOCK;
720             mImageInitializerFunction      = nullptr;
721             mActualBufferFormatID          = angle::FormatID::BC2_RGBA_UNORM_BLOCK;
722             mVkBufferFormatIsPacked        = false;
723             mVertexLoadFunction            = nullptr;
724             mVertexLoadRequiresConversion  = false;
725             break;
726 
727         case angle::FormatID::BC2_RGBA_UNORM_SRGB_BLOCK:
728             mIntendedGLFormat              = GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT;
729             mActualSampleOnlyImageFormatID = angle::FormatID::BC2_RGBA_UNORM_SRGB_BLOCK;
730             mImageInitializerFunction      = nullptr;
731             mActualBufferFormatID          = angle::FormatID::BC2_RGBA_UNORM_SRGB_BLOCK;
732             mVkBufferFormatIsPacked        = false;
733             mVertexLoadFunction            = nullptr;
734             mVertexLoadRequiresConversion  = false;
735             break;
736 
737         case angle::FormatID::BC3_RGBA_UNORM_BLOCK:
738             mIntendedGLFormat              = GL_COMPRESSED_RGBA_S3TC_DXT5_ANGLE;
739             mActualSampleOnlyImageFormatID = angle::FormatID::BC3_RGBA_UNORM_BLOCK;
740             mImageInitializerFunction      = nullptr;
741             mActualBufferFormatID          = angle::FormatID::BC3_RGBA_UNORM_BLOCK;
742             mVkBufferFormatIsPacked        = false;
743             mVertexLoadFunction            = nullptr;
744             mVertexLoadRequiresConversion  = false;
745             break;
746 
747         case angle::FormatID::BC3_RGBA_UNORM_SRGB_BLOCK:
748             mIntendedGLFormat              = GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT;
749             mActualSampleOnlyImageFormatID = angle::FormatID::BC3_RGBA_UNORM_SRGB_BLOCK;
750             mImageInitializerFunction      = nullptr;
751             mActualBufferFormatID          = angle::FormatID::BC3_RGBA_UNORM_SRGB_BLOCK;
752             mVkBufferFormatIsPacked        = false;
753             mVertexLoadFunction            = nullptr;
754             mVertexLoadRequiresConversion  = false;
755             break;
756 
757         case angle::FormatID::BC4_RED_SNORM_BLOCK:
758             mIntendedGLFormat              = GL_COMPRESSED_SIGNED_RED_RGTC1_EXT;
759             mActualSampleOnlyImageFormatID = angle::FormatID::BC4_RED_SNORM_BLOCK;
760             mImageInitializerFunction      = nullptr;
761             mActualBufferFormatID          = angle::FormatID::BC4_RED_SNORM_BLOCK;
762             mVkBufferFormatIsPacked        = false;
763             mVertexLoadFunction            = nullptr;
764             mVertexLoadRequiresConversion  = false;
765             break;
766 
767         case angle::FormatID::BC4_RED_UNORM_BLOCK:
768             mIntendedGLFormat              = GL_COMPRESSED_RED_RGTC1_EXT;
769             mActualSampleOnlyImageFormatID = angle::FormatID::BC4_RED_UNORM_BLOCK;
770             mImageInitializerFunction      = nullptr;
771             mActualBufferFormatID          = angle::FormatID::BC4_RED_UNORM_BLOCK;
772             mVkBufferFormatIsPacked        = false;
773             mVertexLoadFunction            = nullptr;
774             mVertexLoadRequiresConversion  = false;
775             break;
776 
777         case angle::FormatID::BC5_RG_SNORM_BLOCK:
778             mIntendedGLFormat              = GL_COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT;
779             mActualSampleOnlyImageFormatID = angle::FormatID::BC5_RG_SNORM_BLOCK;
780             mImageInitializerFunction      = nullptr;
781             mActualBufferFormatID          = angle::FormatID::BC5_RG_SNORM_BLOCK;
782             mVkBufferFormatIsPacked        = false;
783             mVertexLoadFunction            = nullptr;
784             mVertexLoadRequiresConversion  = false;
785             break;
786 
787         case angle::FormatID::BC5_RG_UNORM_BLOCK:
788             mIntendedGLFormat              = GL_COMPRESSED_RED_GREEN_RGTC2_EXT;
789             mActualSampleOnlyImageFormatID = angle::FormatID::BC5_RG_UNORM_BLOCK;
790             mImageInitializerFunction      = nullptr;
791             mActualBufferFormatID          = angle::FormatID::BC5_RG_UNORM_BLOCK;
792             mVkBufferFormatIsPacked        = false;
793             mVertexLoadFunction            = nullptr;
794             mVertexLoadRequiresConversion  = false;
795             break;
796 
797         case angle::FormatID::BC6H_RGB_SFLOAT_BLOCK:
798             mIntendedGLFormat              = GL_COMPRESSED_RGB_BPTC_SIGNED_FLOAT_EXT;
799             mActualSampleOnlyImageFormatID = angle::FormatID::BC6H_RGB_SFLOAT_BLOCK;
800             mImageInitializerFunction      = nullptr;
801             mActualBufferFormatID          = angle::FormatID::BC6H_RGB_SFLOAT_BLOCK;
802             mVkBufferFormatIsPacked        = false;
803             mVertexLoadFunction            = nullptr;
804             mVertexLoadRequiresConversion  = false;
805             break;
806 
807         case angle::FormatID::BC6H_RGB_UFLOAT_BLOCK:
808             mIntendedGLFormat              = GL_COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_EXT;
809             mActualSampleOnlyImageFormatID = angle::FormatID::BC6H_RGB_UFLOAT_BLOCK;
810             mImageInitializerFunction      = nullptr;
811             mActualBufferFormatID          = angle::FormatID::BC6H_RGB_UFLOAT_BLOCK;
812             mVkBufferFormatIsPacked        = false;
813             mVertexLoadFunction            = nullptr;
814             mVertexLoadRequiresConversion  = false;
815             break;
816 
817         case angle::FormatID::BC7_RGBA_UNORM_BLOCK:
818             mIntendedGLFormat              = GL_COMPRESSED_RGBA_BPTC_UNORM_EXT;
819             mActualSampleOnlyImageFormatID = angle::FormatID::BC7_RGBA_UNORM_BLOCK;
820             mImageInitializerFunction      = nullptr;
821             mActualBufferFormatID          = angle::FormatID::BC7_RGBA_UNORM_BLOCK;
822             mVkBufferFormatIsPacked        = false;
823             mVertexLoadFunction            = nullptr;
824             mVertexLoadRequiresConversion  = false;
825             break;
826 
827         case angle::FormatID::BC7_RGBA_UNORM_SRGB_BLOCK:
828             mIntendedGLFormat              = GL_COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT;
829             mActualSampleOnlyImageFormatID = angle::FormatID::BC7_RGBA_UNORM_SRGB_BLOCK;
830             mImageInitializerFunction      = nullptr;
831             mActualBufferFormatID          = angle::FormatID::BC7_RGBA_UNORM_SRGB_BLOCK;
832             mVkBufferFormatIsPacked        = false;
833             mVertexLoadFunction            = nullptr;
834             mVertexLoadRequiresConversion  = false;
835             break;
836 
837         case angle::FormatID::D16_UNORM:
838             mIntendedGLFormat              = GL_DEPTH_COMPONENT16;
839             mActualSampleOnlyImageFormatID = angle::FormatID::D16_UNORM;
840             mImageInitializerFunction      = nullptr;
841             mActualBufferFormatID          = angle::FormatID::D16_UNORM;
842             mVkBufferFormatIsPacked        = false;
843             mVertexLoadFunction            = nullptr;
844             mVertexLoadRequiresConversion  = false;
845             break;
846 
847         case angle::FormatID::D24_UNORM_S8_UINT:
848             mIntendedGLFormat = GL_DEPTH24_STENCIL8;
849             {
850                 static constexpr ImageFormatInitInfo kInfo[] = {
851                     {angle::FormatID::D24_UNORM_S8_UINT, nullptr},
852                     {angle::FormatID::D32_FLOAT_S8X24_UINT, nullptr}};
853                 initImageFallback(renderer, kInfo, ArraySize(kInfo));
854             }
855             mActualBufferFormatID         = angle::FormatID::D24_UNORM_S8_UINT;
856             mVkBufferFormatIsPacked       = false;
857             mVertexLoadFunction           = nullptr;
858             mVertexLoadRequiresConversion = false;
859             break;
860 
861         case angle::FormatID::D24_UNORM_X8_UINT:
862             mIntendedGLFormat = GL_DEPTH_COMPONENT24;
863             {
864                 static constexpr ImageFormatInitInfo kInfo[] = {
865                     {angle::FormatID::D24_UNORM_X8_UINT, nullptr},
866                     {angle::FormatID::D24_UNORM_S8_UINT, nullptr},
867                     {angle::FormatID::D32_FLOAT_S8X24_UINT, nullptr}};
868                 initImageFallback(renderer, kInfo, ArraySize(kInfo));
869             }
870             mActualBufferFormatID         = angle::FormatID::D24_UNORM_X8_UINT;
871             mVkBufferFormatIsPacked       = true;
872             mVertexLoadFunction           = CopyNativeVertexData<GLuint, 1, 1, 0>;
873             mVertexLoadRequiresConversion = false;
874             break;
875 
876         case angle::FormatID::D32_FLOAT:
877             mIntendedGLFormat              = GL_DEPTH_COMPONENT32F;
878             mActualSampleOnlyImageFormatID = angle::FormatID::D32_FLOAT;
879             mImageInitializerFunction      = nullptr;
880             mActualBufferFormatID          = angle::FormatID::D32_FLOAT;
881             mVkBufferFormatIsPacked        = false;
882             mVertexLoadFunction            = CopyNativeVertexData<GLfloat, 1, 1, 0>;
883             mVertexLoadRequiresConversion  = false;
884             break;
885 
886         case angle::FormatID::D32_FLOAT_S8X24_UINT:
887             mIntendedGLFormat = GL_DEPTH32F_STENCIL8;
888             {
889                 static constexpr ImageFormatInitInfo kInfo[] = {
890                     {angle::FormatID::D32_FLOAT_S8X24_UINT, nullptr},
891                     {angle::FormatID::D24_UNORM_S8_UINT, nullptr}};
892                 initImageFallback(renderer, kInfo, ArraySize(kInfo));
893             }
894             mActualBufferFormatID         = angle::FormatID::D32_FLOAT_S8X24_UINT;
895             mVkBufferFormatIsPacked       = false;
896             mVertexLoadFunction           = CopyNativeVertexData<GLfloat, 3, 3, 0>;
897             mVertexLoadRequiresConversion = false;
898             break;
899 
900         case angle::FormatID::D32_UNORM:
901             mIntendedGLFormat = GL_DEPTH_COMPONENT32_OES;
902             {
903                 static constexpr ImageFormatInitInfo kInfo[] = {
904                     {angle::FormatID::D24_UNORM_X8_UINT, nullptr},
905                     {angle::FormatID::D24_UNORM_S8_UINT, nullptr},
906                     {angle::FormatID::D32_FLOAT, nullptr}};
907                 initImageFallback(renderer, kInfo, ArraySize(kInfo));
908             }
909             mActualBufferFormatID         = angle::FormatID::NONE;
910             mVkBufferFormatIsPacked       = false;
911             mVertexLoadFunction           = nullptr;
912             mVertexLoadRequiresConversion = true;
913             break;
914 
915         case angle::FormatID::EAC_R11G11_SNORM_BLOCK:
916             mIntendedGLFormat = GL_COMPRESSED_SIGNED_RG11_EAC;
917             {
918                 static constexpr ImageFormatInitInfo kInfo[] = {
919                     {angle::FormatID::EAC_R11G11_SNORM_BLOCK, nullptr},
920                     {angle::FormatID::R16G16_SNORM, nullptr},
921                     {angle::FormatID::R16G16_FLOAT, nullptr}};
922                 initImageFallback(renderer, kInfo, ArraySize(kInfo));
923             }
924             mActualBufferFormatID         = angle::FormatID::EAC_R11G11_SNORM_BLOCK;
925             mVkBufferFormatIsPacked       = false;
926             mVertexLoadFunction           = nullptr;
927             mVertexLoadRequiresConversion = false;
928             break;
929 
930         case angle::FormatID::EAC_R11G11_UNORM_BLOCK:
931             mIntendedGLFormat = GL_COMPRESSED_RG11_EAC;
932             {
933                 static constexpr ImageFormatInitInfo kInfo[] = {
934                     {angle::FormatID::EAC_R11G11_UNORM_BLOCK, nullptr},
935                     {angle::FormatID::R16G16_UNORM, nullptr},
936                     {angle::FormatID::R16G16_FLOAT, nullptr}};
937                 initImageFallback(renderer, kInfo, ArraySize(kInfo));
938             }
939             mActualBufferFormatID         = angle::FormatID::EAC_R11G11_UNORM_BLOCK;
940             mVkBufferFormatIsPacked       = false;
941             mVertexLoadFunction           = nullptr;
942             mVertexLoadRequiresConversion = false;
943             break;
944 
945         case angle::FormatID::EAC_R11_SNORM_BLOCK:
946             mIntendedGLFormat = GL_COMPRESSED_SIGNED_R11_EAC;
947             {
948                 static constexpr ImageFormatInitInfo kInfo[] = {
949                     {angle::FormatID::EAC_R11_SNORM_BLOCK, nullptr},
950                     {angle::FormatID::R16_SNORM, nullptr},
951                     {angle::FormatID::R16_FLOAT, nullptr}};
952                 initImageFallback(renderer, kInfo, ArraySize(kInfo));
953             }
954             mActualBufferFormatID         = angle::FormatID::EAC_R11_SNORM_BLOCK;
955             mVkBufferFormatIsPacked       = false;
956             mVertexLoadFunction           = nullptr;
957             mVertexLoadRequiresConversion = false;
958             break;
959 
960         case angle::FormatID::EAC_R11_UNORM_BLOCK:
961             mIntendedGLFormat = GL_COMPRESSED_R11_EAC;
962             {
963                 static constexpr ImageFormatInitInfo kInfo[] = {
964                     {angle::FormatID::EAC_R11_UNORM_BLOCK, nullptr},
965                     {angle::FormatID::R16_UNORM, nullptr},
966                     {angle::FormatID::R16_FLOAT, nullptr}};
967                 initImageFallback(renderer, kInfo, ArraySize(kInfo));
968             }
969             mActualBufferFormatID         = angle::FormatID::EAC_R11_UNORM_BLOCK;
970             mVkBufferFormatIsPacked       = false;
971             mVertexLoadFunction           = nullptr;
972             mVertexLoadRequiresConversion = false;
973             break;
974 
975         case angle::FormatID::ETC1_LOSSY_DECODE_R8G8B8_UNORM_BLOCK:
976             // This format is not implemented in Vulkan.
977             break;
978 
979         case angle::FormatID::ETC1_R8G8B8_UNORM_BLOCK:
980             mIntendedGLFormat = GL_ETC1_RGB8_OES;
981             {
982                 static constexpr ImageFormatInitInfo kInfo[] = {
983                     {angle::FormatID::ETC2_R8G8B8_UNORM_BLOCK, nullptr},
984                     {angle::FormatID::R8G8B8A8_UNORM,
985                      Initialize4ComponentData<GLubyte, 0x00, 0x00, 0x00, 0xFF>}};
986                 initImageFallback(renderer, kInfo, ArraySize(kInfo));
987             }
988             mActualBufferFormatID         = angle::FormatID::NONE;
989             mVkBufferFormatIsPacked       = false;
990             mVertexLoadFunction           = nullptr;
991             mVertexLoadRequiresConversion = true;
992             break;
993 
994         case angle::FormatID::ETC2_R8G8B8A1_SRGB_BLOCK:
995             mIntendedGLFormat = GL_COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2;
996             {
997                 static constexpr ImageFormatInitInfo kInfo[] = {
998                     {angle::FormatID::ETC2_R8G8B8A1_SRGB_BLOCK, nullptr},
999                     {angle::FormatID::R8G8B8A8_UNORM_SRGB,
1000                      Initialize4ComponentData<GLubyte, 0x00, 0x00, 0x00, 0xFF>}};
1001                 initImageFallback(renderer, kInfo, ArraySize(kInfo));
1002             }
1003             mActualBufferFormatID         = angle::FormatID::ETC2_R8G8B8A1_SRGB_BLOCK;
1004             mVkBufferFormatIsPacked       = false;
1005             mVertexLoadFunction           = CopyNativeVertexData<GLbyte, 4, 4, 0>;
1006             mVertexLoadRequiresConversion = false;
1007             break;
1008 
1009         case angle::FormatID::ETC2_R8G8B8A1_UNORM_BLOCK:
1010             mIntendedGLFormat = GL_COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2;
1011             {
1012                 static constexpr ImageFormatInitInfo kInfo[] = {
1013                     {angle::FormatID::ETC2_R8G8B8A1_UNORM_BLOCK, nullptr},
1014                     {angle::FormatID::R8G8B8A8_UNORM,
1015                      Initialize4ComponentData<GLubyte, 0x00, 0x00, 0x00, 0xFF>}};
1016                 initImageFallback(renderer, kInfo, ArraySize(kInfo));
1017             }
1018             mActualBufferFormatID         = angle::FormatID::ETC2_R8G8B8A1_UNORM_BLOCK;
1019             mVkBufferFormatIsPacked       = false;
1020             mVertexLoadFunction           = CopyNativeVertexData<GLubyte, 4, 4, 0>;
1021             mVertexLoadRequiresConversion = false;
1022             break;
1023 
1024         case angle::FormatID::ETC2_R8G8B8A8_SRGB_BLOCK:
1025             mIntendedGLFormat = GL_COMPRESSED_SRGB8_ALPHA8_ETC2_EAC;
1026             {
1027                 static constexpr ImageFormatInitInfo kInfo[] = {
1028                     {angle::FormatID::ETC2_R8G8B8A8_SRGB_BLOCK, nullptr},
1029                     {angle::FormatID::R8G8B8A8_UNORM_SRGB, nullptr}};
1030                 initImageFallback(renderer, kInfo, ArraySize(kInfo));
1031             }
1032             mActualBufferFormatID         = angle::FormatID::ETC2_R8G8B8A8_SRGB_BLOCK;
1033             mVkBufferFormatIsPacked       = false;
1034             mVertexLoadFunction           = CopyNativeVertexData<GLbyte, 4, 4, 0>;
1035             mVertexLoadRequiresConversion = false;
1036             break;
1037 
1038         case angle::FormatID::ETC2_R8G8B8A8_UNORM_BLOCK:
1039             mIntendedGLFormat = GL_COMPRESSED_RGBA8_ETC2_EAC;
1040             {
1041                 static constexpr ImageFormatInitInfo kInfo[] = {
1042                     {angle::FormatID::ETC2_R8G8B8A8_UNORM_BLOCK, nullptr},
1043                     {angle::FormatID::R8G8B8A8_UNORM, nullptr}};
1044                 initImageFallback(renderer, kInfo, ArraySize(kInfo));
1045             }
1046             mActualBufferFormatID         = angle::FormatID::ETC2_R8G8B8A8_UNORM_BLOCK;
1047             mVkBufferFormatIsPacked       = false;
1048             mVertexLoadFunction           = CopyNativeVertexData<GLubyte, 4, 4, 0>;
1049             mVertexLoadRequiresConversion = false;
1050             break;
1051 
1052         case angle::FormatID::ETC2_R8G8B8_SRGB_BLOCK:
1053             mIntendedGLFormat = GL_COMPRESSED_SRGB8_ETC2;
1054             {
1055                 static constexpr ImageFormatInitInfo kInfo[] = {
1056                     {angle::FormatID::ETC2_R8G8B8_SRGB_BLOCK, nullptr},
1057                     {angle::FormatID::R8G8B8A8_UNORM_SRGB,
1058                      Initialize4ComponentData<GLubyte, 0x00, 0x00, 0x00, 0xFF>}};
1059                 initImageFallback(renderer, kInfo, ArraySize(kInfo));
1060             }
1061             mActualBufferFormatID         = angle::FormatID::ETC2_R8G8B8_SRGB_BLOCK;
1062             mVkBufferFormatIsPacked       = false;
1063             mVertexLoadFunction           = CopyNativeVertexData<GLbyte, 3, 3, 0>;
1064             mVertexLoadRequiresConversion = false;
1065             break;
1066 
1067         case angle::FormatID::ETC2_R8G8B8_UNORM_BLOCK:
1068             mIntendedGLFormat = GL_COMPRESSED_RGB8_ETC2;
1069             {
1070                 static constexpr ImageFormatInitInfo kInfo[] = {
1071                     {angle::FormatID::ETC2_R8G8B8_UNORM_BLOCK, nullptr},
1072                     {angle::FormatID::R8G8B8A8_UNORM,
1073                      Initialize4ComponentData<GLubyte, 0x00, 0x00, 0x00, 0xFF>}};
1074                 initImageFallback(renderer, kInfo, ArraySize(kInfo));
1075             }
1076             mActualBufferFormatID         = angle::FormatID::ETC2_R8G8B8_UNORM_BLOCK;
1077             mVkBufferFormatIsPacked       = false;
1078             mVertexLoadFunction           = CopyNativeVertexData<GLubyte, 3, 3, 0>;
1079             mVertexLoadRequiresConversion = false;
1080             break;
1081 
1082         case angle::FormatID::EXTERNAL0:
1083             mIntendedGLFormat              = GL_NONE;
1084             mActualSampleOnlyImageFormatID = angle::FormatID::EXTERNAL0;
1085             mActualRenderableImageFormatID = angle::FormatID::EXTERNAL0;
1086             mImageInitializerFunction      = nullptr;
1087             mActualBufferFormatID          = angle::FormatID::EXTERNAL0;
1088             mVkBufferFormatIsPacked        = false;
1089             mVertexLoadFunction            = CopyNativeVertexData<GLbyte, 4, 4, 0>;
1090             mVertexLoadRequiresConversion  = false;
1091             break;
1092 
1093         case angle::FormatID::EXTERNAL1:
1094             mIntendedGLFormat              = GL_NONE;
1095             mActualSampleOnlyImageFormatID = angle::FormatID::EXTERNAL1;
1096             mActualRenderableImageFormatID = angle::FormatID::EXTERNAL1;
1097             mImageInitializerFunction      = nullptr;
1098             mActualBufferFormatID          = angle::FormatID::EXTERNAL1;
1099             mVkBufferFormatIsPacked        = false;
1100             mVertexLoadFunction            = CopyNativeVertexData<GLbyte, 4, 4, 0>;
1101             mVertexLoadRequiresConversion  = false;
1102             break;
1103 
1104         case angle::FormatID::EXTERNAL2:
1105             mIntendedGLFormat              = GL_NONE;
1106             mActualSampleOnlyImageFormatID = angle::FormatID::EXTERNAL2;
1107             mActualRenderableImageFormatID = angle::FormatID::EXTERNAL2;
1108             mImageInitializerFunction      = nullptr;
1109             mActualBufferFormatID          = angle::FormatID::EXTERNAL2;
1110             mVkBufferFormatIsPacked        = false;
1111             mVertexLoadFunction            = CopyNativeVertexData<GLbyte, 4, 4, 0>;
1112             mVertexLoadRequiresConversion  = false;
1113             break;
1114 
1115         case angle::FormatID::EXTERNAL3:
1116             mIntendedGLFormat              = GL_NONE;
1117             mActualSampleOnlyImageFormatID = angle::FormatID::EXTERNAL3;
1118             mActualRenderableImageFormatID = angle::FormatID::EXTERNAL3;
1119             mImageInitializerFunction      = nullptr;
1120             mActualBufferFormatID          = angle::FormatID::EXTERNAL3;
1121             mVkBufferFormatIsPacked        = false;
1122             mVertexLoadFunction            = CopyNativeVertexData<GLbyte, 4, 4, 0>;
1123             mVertexLoadRequiresConversion  = false;
1124             break;
1125 
1126         case angle::FormatID::EXTERNAL4:
1127             mIntendedGLFormat              = GL_NONE;
1128             mActualSampleOnlyImageFormatID = angle::FormatID::EXTERNAL4;
1129             mActualRenderableImageFormatID = angle::FormatID::EXTERNAL4;
1130             mImageInitializerFunction      = nullptr;
1131             mActualBufferFormatID          = angle::FormatID::EXTERNAL4;
1132             mVkBufferFormatIsPacked        = false;
1133             mVertexLoadFunction            = CopyNativeVertexData<GLbyte, 4, 4, 0>;
1134             mVertexLoadRequiresConversion  = false;
1135             break;
1136 
1137         case angle::FormatID::EXTERNAL5:
1138             mIntendedGLFormat              = GL_NONE;
1139             mActualSampleOnlyImageFormatID = angle::FormatID::EXTERNAL5;
1140             mActualRenderableImageFormatID = angle::FormatID::EXTERNAL5;
1141             mImageInitializerFunction      = nullptr;
1142             mActualBufferFormatID          = angle::FormatID::EXTERNAL5;
1143             mVkBufferFormatIsPacked        = false;
1144             mVertexLoadFunction            = CopyNativeVertexData<GLbyte, 4, 4, 0>;
1145             mVertexLoadRequiresConversion  = false;
1146             break;
1147 
1148         case angle::FormatID::EXTERNAL6:
1149             mIntendedGLFormat              = GL_NONE;
1150             mActualSampleOnlyImageFormatID = angle::FormatID::EXTERNAL6;
1151             mActualRenderableImageFormatID = angle::FormatID::EXTERNAL6;
1152             mImageInitializerFunction      = nullptr;
1153             mActualBufferFormatID          = angle::FormatID::EXTERNAL6;
1154             mVkBufferFormatIsPacked        = false;
1155             mVertexLoadFunction            = CopyNativeVertexData<GLbyte, 4, 4, 0>;
1156             mVertexLoadRequiresConversion  = false;
1157             break;
1158 
1159         case angle::FormatID::EXTERNAL7:
1160             mIntendedGLFormat              = GL_NONE;
1161             mActualSampleOnlyImageFormatID = angle::FormatID::EXTERNAL7;
1162             mActualRenderableImageFormatID = angle::FormatID::EXTERNAL7;
1163             mImageInitializerFunction      = nullptr;
1164             mActualBufferFormatID          = angle::FormatID::EXTERNAL7;
1165             mVkBufferFormatIsPacked        = false;
1166             mVertexLoadFunction            = CopyNativeVertexData<GLbyte, 4, 4, 0>;
1167             mVertexLoadRequiresConversion  = false;
1168             break;
1169 
1170         case angle::FormatID::G8_B8R8_2PLANE_420_UNORM:
1171             mIntendedGLFormat              = GL_G8_B8R8_2PLANE_420_UNORM_ANGLE;
1172             mActualSampleOnlyImageFormatID = angle::FormatID::G8_B8R8_2PLANE_420_UNORM;
1173             mImageInitializerFunction      = nullptr;
1174             mActualBufferFormatID          = angle::FormatID::G8_B8R8_2PLANE_420_UNORM;
1175             mVkBufferFormatIsPacked        = false;
1176             mVertexLoadFunction            = CopyNativeVertexData<GLubyte, 3, 3, 0>;
1177             mVertexLoadRequiresConversion  = false;
1178             break;
1179 
1180         case angle::FormatID::G8_B8_R8_3PLANE_420_UNORM:
1181             mIntendedGLFormat              = GL_G8_B8_R8_3PLANE_420_UNORM_ANGLE;
1182             mActualSampleOnlyImageFormatID = angle::FormatID::G8_B8_R8_3PLANE_420_UNORM;
1183             mImageInitializerFunction      = nullptr;
1184             mActualBufferFormatID          = angle::FormatID::G8_B8_R8_3PLANE_420_UNORM;
1185             mVkBufferFormatIsPacked        = false;
1186             mVertexLoadFunction            = CopyNativeVertexData<GLubyte, 3, 3, 0>;
1187             mVertexLoadRequiresConversion  = false;
1188             break;
1189 
1190         case angle::FormatID::L16A16_FLOAT:
1191             mIntendedGLFormat              = GL_LUMINANCE_ALPHA16F_EXT;
1192             mActualSampleOnlyImageFormatID = angle::FormatID::R16G16_FLOAT;
1193             mImageInitializerFunction      = nullptr;
1194 
1195             break;
1196 
1197         case angle::FormatID::L16_FLOAT:
1198             mIntendedGLFormat              = GL_LUMINANCE16F_EXT;
1199             mActualSampleOnlyImageFormatID = angle::FormatID::R16_FLOAT;
1200             mImageInitializerFunction      = nullptr;
1201 
1202             break;
1203 
1204         case angle::FormatID::L32A32_FLOAT:
1205             mIntendedGLFormat              = GL_LUMINANCE_ALPHA32F_EXT;
1206             mActualSampleOnlyImageFormatID = angle::FormatID::R32G32_FLOAT;
1207             mImageInitializerFunction      = nullptr;
1208 
1209             break;
1210 
1211         case angle::FormatID::L32_FLOAT:
1212             mIntendedGLFormat              = GL_LUMINANCE32F_EXT;
1213             mActualSampleOnlyImageFormatID = angle::FormatID::R32_FLOAT;
1214             mImageInitializerFunction      = nullptr;
1215 
1216             break;
1217 
1218         case angle::FormatID::L4A4_UNORM:
1219             mIntendedGLFormat              = GL_LUMINANCE4_ALPHA4_OES;
1220             mActualSampleOnlyImageFormatID = angle::FormatID::R8G8_UNORM;
1221             mImageInitializerFunction      = nullptr;
1222 
1223             break;
1224 
1225         case angle::FormatID::L8A8_UNORM:
1226             mIntendedGLFormat              = GL_LUMINANCE8_ALPHA8_EXT;
1227             mActualSampleOnlyImageFormatID = angle::FormatID::R8G8_UNORM;
1228             mImageInitializerFunction      = nullptr;
1229 
1230             break;
1231 
1232         case angle::FormatID::L8_UNORM:
1233             mIntendedGLFormat              = GL_LUMINANCE8_EXT;
1234             mActualSampleOnlyImageFormatID = angle::FormatID::R8_UNORM;
1235             mImageInitializerFunction      = nullptr;
1236 
1237             break;
1238 
1239         case angle::FormatID::NONE:
1240             mIntendedGLFormat              = GL_NONE;
1241             mActualSampleOnlyImageFormatID = angle::FormatID::NONE;
1242             mImageInitializerFunction      = nullptr;
1243             mActualBufferFormatID          = angle::FormatID::NONE;
1244             mVkBufferFormatIsPacked        = false;
1245             mVertexLoadFunction            = nullptr;
1246             mVertexLoadRequiresConversion  = false;
1247             break;
1248 
1249         case angle::FormatID::PALETTE4_R4G4B4A4_UNORM:
1250             mIntendedGLFormat              = GL_PALETTE4_RGBA4_OES;
1251             mActualSampleOnlyImageFormatID = angle::FormatID::R8G8B8A8_UNORM;
1252             mImageInitializerFunction      = nullptr;
1253 
1254             break;
1255 
1256         case angle::FormatID::PALETTE4_R5G5B5A1_UNORM:
1257             mIntendedGLFormat              = GL_PALETTE4_RGB5_A1_OES;
1258             mActualSampleOnlyImageFormatID = angle::FormatID::R8G8B8A8_UNORM;
1259             mImageInitializerFunction      = nullptr;
1260 
1261             break;
1262 
1263         case angle::FormatID::PALETTE4_R5G6B5_UNORM:
1264             mIntendedGLFormat              = GL_PALETTE4_R5_G6_B5_OES;
1265             mActualSampleOnlyImageFormatID = angle::FormatID::R8G8B8A8_UNORM;
1266             mImageInitializerFunction      = nullptr;
1267 
1268             break;
1269 
1270         case angle::FormatID::PALETTE4_R8G8B8A8_UNORM:
1271             mIntendedGLFormat              = GL_PALETTE4_RGBA8_OES;
1272             mActualSampleOnlyImageFormatID = angle::FormatID::R8G8B8A8_UNORM;
1273             mImageInitializerFunction      = nullptr;
1274 
1275             break;
1276 
1277         case angle::FormatID::PALETTE4_R8G8B8_UNORM:
1278             mIntendedGLFormat              = GL_PALETTE4_RGB8_OES;
1279             mActualSampleOnlyImageFormatID = angle::FormatID::R8G8B8A8_UNORM;
1280             mImageInitializerFunction      = nullptr;
1281 
1282             break;
1283 
1284         case angle::FormatID::PALETTE8_R4G4B4A4_UNORM:
1285             mIntendedGLFormat              = GL_PALETTE8_RGBA4_OES;
1286             mActualSampleOnlyImageFormatID = angle::FormatID::R8G8B8A8_UNORM;
1287             mImageInitializerFunction      = nullptr;
1288 
1289             break;
1290 
1291         case angle::FormatID::PALETTE8_R5G5B5A1_UNORM:
1292             mIntendedGLFormat              = GL_PALETTE8_RGB5_A1_OES;
1293             mActualSampleOnlyImageFormatID = angle::FormatID::R8G8B8A8_UNORM;
1294             mImageInitializerFunction      = nullptr;
1295 
1296             break;
1297 
1298         case angle::FormatID::PALETTE8_R5G6B5_UNORM:
1299             mIntendedGLFormat              = GL_PALETTE8_R5_G6_B5_OES;
1300             mActualSampleOnlyImageFormatID = angle::FormatID::R8G8B8A8_UNORM;
1301             mImageInitializerFunction      = nullptr;
1302 
1303             break;
1304 
1305         case angle::FormatID::PALETTE8_R8G8B8A8_UNORM:
1306             mIntendedGLFormat              = GL_PALETTE8_RGBA8_OES;
1307             mActualSampleOnlyImageFormatID = angle::FormatID::R8G8B8A8_UNORM;
1308             mImageInitializerFunction      = nullptr;
1309 
1310             break;
1311 
1312         case angle::FormatID::PALETTE8_R8G8B8_UNORM:
1313             mIntendedGLFormat              = GL_PALETTE8_RGB8_OES;
1314             mActualSampleOnlyImageFormatID = angle::FormatID::R8G8B8A8_UNORM;
1315             mImageInitializerFunction      = nullptr;
1316 
1317             break;
1318 
1319         case angle::FormatID::PVRTC1_RGBA_2BPP_UNORM_BLOCK:
1320             // This format is not implemented in Vulkan.
1321             break;
1322 
1323         case angle::FormatID::PVRTC1_RGBA_2BPP_UNORM_SRGB_BLOCK:
1324             // This format is not implemented in Vulkan.
1325             break;
1326 
1327         case angle::FormatID::PVRTC1_RGBA_4BPP_UNORM_BLOCK:
1328             // This format is not implemented in Vulkan.
1329             break;
1330 
1331         case angle::FormatID::PVRTC1_RGBA_4BPP_UNORM_SRGB_BLOCK:
1332             // This format is not implemented in Vulkan.
1333             break;
1334 
1335         case angle::FormatID::PVRTC1_RGB_2BPP_UNORM_BLOCK:
1336             // This format is not implemented in Vulkan.
1337             break;
1338 
1339         case angle::FormatID::PVRTC1_RGB_2BPP_UNORM_SRGB_BLOCK:
1340             // This format is not implemented in Vulkan.
1341             break;
1342 
1343         case angle::FormatID::PVRTC1_RGB_4BPP_UNORM_BLOCK:
1344             // This format is not implemented in Vulkan.
1345             break;
1346 
1347         case angle::FormatID::PVRTC1_RGB_4BPP_UNORM_SRGB_BLOCK:
1348             // This format is not implemented in Vulkan.
1349             break;
1350 
1351         case angle::FormatID::R10G10B10A2_SINT:
1352             mIntendedGLFormat              = GL_RGB10_A2_SINT_ANGLEX;
1353             mActualSampleOnlyImageFormatID = angle::FormatID::R10G10B10A2_SINT;
1354             mImageInitializerFunction      = nullptr;
1355             {
1356                 static constexpr BufferFormatInitInfo kInfo[] = {
1357                     {angle::FormatID::R10G10B10A2_SINT, true, CopyNativeVertexData<GLuint, 1, 1, 0>,
1358                      false},
1359                     {angle::FormatID::R16G16B16A16_SINT, false,
1360                      CopyXYZ10W2ToXYZWFloatVertexData<true, false, false, false>, true}};
1361                 initBufferFallback(renderer, kInfo, ArraySize(kInfo), 2);
1362             }
1363             break;
1364 
1365         case angle::FormatID::R10G10B10A2_SNORM:
1366             mIntendedGLFormat              = GL_RGB10_A2_SNORM_ANGLEX;
1367             mActualSampleOnlyImageFormatID = angle::FormatID::R10G10B10A2_SNORM;
1368             mImageInitializerFunction      = nullptr;
1369             {
1370                 static constexpr BufferFormatInitInfo kInfo[] = {
1371                     {angle::FormatID::R10G10B10A2_SNORM, true,
1372                      CopyNativeVertexData<GLuint, 1, 1, 0>, false},
1373                     {angle::FormatID::R16G16B16A16_FLOAT, false,
1374                      CopyXYZ10W2ToXYZWFloatVertexData<true, true, true, true>, true}};
1375                 initBufferFallback(renderer, kInfo, ArraySize(kInfo), 2);
1376             }
1377             break;
1378 
1379         case angle::FormatID::R10G10B10A2_SSCALED:
1380             mIntendedGLFormat              = GL_RGB10_A2_SSCALED_ANGLEX;
1381             mActualSampleOnlyImageFormatID = angle::FormatID::R10G10B10A2_SSCALED;
1382             mImageInitializerFunction      = nullptr;
1383             {
1384                 static constexpr BufferFormatInitInfo kInfo[] = {
1385                     {angle::FormatID::R10G10B10A2_SSCALED, true,
1386                      CopyNativeVertexData<GLuint, 1, 1, 0>, false},
1387                     {angle::FormatID::R16G16B16A16_FLOAT, false,
1388                      CopyXYZ10W2ToXYZWFloatVertexData<true, false, true, true>, true}};
1389                 initBufferFallback(renderer, kInfo, ArraySize(kInfo), 2);
1390             }
1391             break;
1392 
1393         case angle::FormatID::R10G10B10A2_UINT:
1394             mIntendedGLFormat              = GL_RGB10_A2UI;
1395             mActualSampleOnlyImageFormatID = angle::FormatID::R10G10B10A2_UINT;
1396             mImageInitializerFunction      = nullptr;
1397             {
1398                 static constexpr BufferFormatInitInfo kInfo[] = {
1399                     {angle::FormatID::R10G10B10A2_UINT, true, CopyNativeVertexData<GLuint, 1, 1, 0>,
1400                      false},
1401                     {angle::FormatID::R16G16B16A16_UINT, false,
1402                      CopyXYZ10W2ToXYZWFloatVertexData<false, false, false, false>, true}};
1403                 initBufferFallback(renderer, kInfo, ArraySize(kInfo), 2);
1404             }
1405             break;
1406 
1407         case angle::FormatID::R10G10B10A2_UNORM:
1408             mIntendedGLFormat              = GL_RGB10_A2;
1409             mActualSampleOnlyImageFormatID = angle::FormatID::R10G10B10A2_UNORM;
1410             mImageInitializerFunction      = nullptr;
1411             mActualBufferFormatID          = angle::FormatID::R10G10B10A2_UNORM;
1412             mVkBufferFormatIsPacked        = true;
1413             mVertexLoadFunction            = CopyNativeVertexData<GLuint, 1, 1, 0>;
1414             mVertexLoadRequiresConversion  = false;
1415             break;
1416 
1417         case angle::FormatID::R10G10B10A2_USCALED:
1418             mIntendedGLFormat              = GL_RGB10_A2_USCALED_ANGLEX;
1419             mActualSampleOnlyImageFormatID = angle::FormatID::R10G10B10A2_USCALED;
1420             mImageInitializerFunction      = nullptr;
1421             {
1422                 static constexpr BufferFormatInitInfo kInfo[] = {
1423                     {angle::FormatID::R10G10B10A2_USCALED, true,
1424                      CopyNativeVertexData<GLuint, 1, 1, 0>, false},
1425                     {angle::FormatID::R16G16B16A16_FLOAT, false,
1426                      CopyXYZ10W2ToXYZWFloatVertexData<false, false, true, true>, true}};
1427                 initBufferFallback(renderer, kInfo, ArraySize(kInfo), 2);
1428             }
1429             break;
1430 
1431         case angle::FormatID::R10G10B10X2_UNORM:
1432             mIntendedGLFormat              = GL_RGB10_EXT;
1433             mActualSampleOnlyImageFormatID = angle::FormatID::R10G10B10A2_UNORM;
1434             mImageInitializerFunction      = nullptr;
1435             mActualBufferFormatID          = angle::FormatID::NONE;
1436             mVkBufferFormatIsPacked        = false;
1437             mVertexLoadFunction            = nullptr;
1438             mVertexLoadRequiresConversion  = true;
1439             break;
1440 
1441         case angle::FormatID::R11G11B10_FLOAT:
1442             mIntendedGLFormat              = GL_R11F_G11F_B10F;
1443             mActualSampleOnlyImageFormatID = angle::FormatID::R11G11B10_FLOAT;
1444             mImageInitializerFunction      = nullptr;
1445             mActualBufferFormatID          = angle::FormatID::R11G11B10_FLOAT;
1446             mVkBufferFormatIsPacked        = true;
1447             mVertexLoadFunction            = CopyNativeVertexData<GLuint, 1, 1, 0>;
1448             mVertexLoadRequiresConversion  = false;
1449             break;
1450 
1451         case angle::FormatID::R16G16B16A16_FLOAT:
1452             mIntendedGLFormat              = GL_RGBA16F;
1453             mActualSampleOnlyImageFormatID = angle::FormatID::R16G16B16A16_FLOAT;
1454             mImageInitializerFunction      = nullptr;
1455             mActualBufferFormatID          = angle::FormatID::R16G16B16A16_FLOAT;
1456             mVkBufferFormatIsPacked        = false;
1457             mVertexLoadFunction            = CopyNativeVertexData<GLhalf, 4, 4, 0>;
1458             mVertexLoadRequiresConversion  = false;
1459             break;
1460 
1461         case angle::FormatID::R16G16B16A16_SINT:
1462             mIntendedGLFormat              = GL_RGBA16I;
1463             mActualSampleOnlyImageFormatID = angle::FormatID::R16G16B16A16_SINT;
1464             mImageInitializerFunction      = nullptr;
1465             mActualBufferFormatID          = angle::FormatID::R16G16B16A16_SINT;
1466             mVkBufferFormatIsPacked        = false;
1467             mVertexLoadFunction            = CopyNativeVertexData<GLshort, 4, 4, 0>;
1468             mVertexLoadRequiresConversion  = false;
1469             break;
1470 
1471         case angle::FormatID::R16G16B16A16_SNORM:
1472             mIntendedGLFormat              = GL_RGBA16_SNORM_EXT;
1473             mActualSampleOnlyImageFormatID = angle::FormatID::R16G16B16A16_SNORM;
1474             mImageInitializerFunction      = nullptr;
1475             mActualBufferFormatID          = angle::FormatID::R16G16B16A16_SNORM;
1476             mVkBufferFormatIsPacked        = false;
1477             mVertexLoadFunction            = CopyNativeVertexData<GLshort, 4, 4, 0>;
1478             mVertexLoadRequiresConversion  = false;
1479             break;
1480 
1481         case angle::FormatID::R16G16B16A16_SSCALED:
1482             mIntendedGLFormat              = GL_RGBA16_SSCALED_ANGLEX;
1483             mActualSampleOnlyImageFormatID = angle::FormatID::R16G16B16A16_SSCALED;
1484             mImageInitializerFunction      = nullptr;
1485             {
1486                 static constexpr BufferFormatInitInfo kInfo[] = {
1487                     {angle::FormatID::R16G16B16A16_SSCALED, false,
1488                      CopyNativeVertexData<GLshort, 4, 4, 0>, false},
1489                     {angle::FormatID::R32G32B32A32_FLOAT, false,
1490                      CopyToFloatVertexData<GLshort, 4, 4, false, false>, true},
1491                     {angle::FormatID::R16G16B16A16_FLOAT, false,
1492                      CopyToFloatVertexData<GLshort, 4, 4, false, true>, true}};
1493                 initBufferFallback(renderer, kInfo, ArraySize(kInfo), 2);
1494             }
1495             break;
1496 
1497         case angle::FormatID::R16G16B16A16_UINT:
1498             mIntendedGLFormat              = GL_RGBA16UI;
1499             mActualSampleOnlyImageFormatID = angle::FormatID::R16G16B16A16_UINT;
1500             mImageInitializerFunction      = nullptr;
1501             mActualBufferFormatID          = angle::FormatID::R16G16B16A16_UINT;
1502             mVkBufferFormatIsPacked        = false;
1503             mVertexLoadFunction            = CopyNativeVertexData<GLushort, 4, 4, 0>;
1504             mVertexLoadRequiresConversion  = false;
1505             break;
1506 
1507         case angle::FormatID::R16G16B16A16_UNORM:
1508             mIntendedGLFormat              = GL_RGBA16_EXT;
1509             mActualSampleOnlyImageFormatID = angle::FormatID::R16G16B16A16_UNORM;
1510             mImageInitializerFunction      = nullptr;
1511             mActualBufferFormatID          = angle::FormatID::R16G16B16A16_UNORM;
1512             mVkBufferFormatIsPacked        = false;
1513             mVertexLoadFunction            = CopyNativeVertexData<GLushort, 4, 4, 0>;
1514             mVertexLoadRequiresConversion  = false;
1515             break;
1516 
1517         case angle::FormatID::R16G16B16A16_USCALED:
1518             mIntendedGLFormat              = GL_RGBA16_USCALED_ANGLEX;
1519             mActualSampleOnlyImageFormatID = angle::FormatID::R16G16B16A16_USCALED;
1520             mImageInitializerFunction      = nullptr;
1521             {
1522                 static constexpr BufferFormatInitInfo kInfo[] = {
1523                     {angle::FormatID::R16G16B16A16_USCALED, false,
1524                      CopyNativeVertexData<GLushort, 4, 4, 0>, false},
1525                     {angle::FormatID::R32G32B32A32_FLOAT, false,
1526                      CopyToFloatVertexData<GLushort, 4, 4, false, false>, true},
1527                     {angle::FormatID::R16G16B16A16_FLOAT, false,
1528                      CopyToFloatVertexData<GLushort, 4, 4, false, true>, true}};
1529                 initBufferFallback(renderer, kInfo, ArraySize(kInfo), 2);
1530             }
1531             break;
1532 
1533         case angle::FormatID::R16G16B16_FLOAT:
1534             mIntendedGLFormat = GL_RGB16F;
1535             {
1536                 static constexpr ImageFormatInitInfo kInfo[] = {
1537                     {angle::FormatID::R16G16B16_FLOAT, nullptr},
1538                     {angle::FormatID::R16G16B16A16_FLOAT,
1539                      Initialize4ComponentData<GLhalf, 0x0000, 0x0000, 0x0000, gl::Float16One>}};
1540                 initImageFallback(renderer, kInfo, ArraySize(kInfo));
1541             }
1542             {
1543                 static constexpr BufferFormatInitInfo kInfo[] = {
1544                     {angle::FormatID::R16G16B16_FLOAT, false, CopyNativeVertexData<GLhalf, 3, 3, 0>,
1545                      false},
1546                     {angle::FormatID::R16G16B16A16_FLOAT, false,
1547                      CopyNativeVertexData<GLhalf, 3, 4, gl::Float16One>, true}};
1548                 initBufferFallback(renderer, kInfo, ArraySize(kInfo), 2);
1549             }
1550             break;
1551 
1552         case angle::FormatID::R16G16B16_SINT:
1553             mIntendedGLFormat = GL_RGB16I;
1554             {
1555                 static constexpr ImageFormatInitInfo kInfo[] = {
1556                     {angle::FormatID::R16G16B16_SINT, nullptr},
1557                     {angle::FormatID::R16G16B16A16_SINT,
1558                      Initialize4ComponentData<GLshort, 0x0000, 0x0000, 0x0000, 0x0001>}};
1559                 initImageFallback(renderer, kInfo, ArraySize(kInfo));
1560             }
1561             {
1562                 static constexpr BufferFormatInitInfo kInfo[] = {
1563                     {angle::FormatID::R16G16B16_SINT, false, CopyNativeVertexData<GLshort, 3, 3, 0>,
1564                      false},
1565                     {angle::FormatID::R16G16B16A16_SINT, false,
1566                      CopyNativeVertexData<GLshort, 3, 4, 1>, true}};
1567                 initBufferFallback(renderer, kInfo, ArraySize(kInfo), 2);
1568             }
1569             break;
1570 
1571         case angle::FormatID::R16G16B16_SNORM:
1572             mIntendedGLFormat = GL_RGB16_SNORM_EXT;
1573             {
1574                 static constexpr ImageFormatInitInfo kInfo[] = {
1575                     {angle::FormatID::R16G16B16_SNORM, nullptr},
1576                     {angle::FormatID::R16G16B16A16_SNORM,
1577                      Initialize4ComponentData<GLushort, 0x0000, 0x0000, 0x0000, 0x7FFF>},
1578                     {angle::FormatID::R32G32B32_FLOAT, nullptr},
1579                     {angle::FormatID::R32G32B32A32_FLOAT,
1580                      Initialize4ComponentData<GLfloat, 0x00000000, 0x00000000, 0x00000000,
1581                                               gl::Float32One>}};
1582                 initImageFallback(renderer, kInfo, ArraySize(kInfo));
1583             }
1584             {
1585                 static constexpr BufferFormatInitInfo kInfo[] = {
1586                     {angle::FormatID::R16G16B16_SNORM, false,
1587                      CopyNativeVertexData<GLshort, 3, 3, 0>, false},
1588                     {angle::FormatID::R16G16B16A16_SNORM, false,
1589                      CopyNativeVertexData<GLshort, 3, 4, std::numeric_limits<GLshort>::max()>,
1590                      true},
1591                     {angle::FormatID::R32G32B32_FLOAT, false,
1592                      CopyToFloatVertexData<GLshort, 3, 3, true, false>, true},
1593                     {angle::FormatID::R16G16B16_FLOAT, false,
1594                      CopyToFloatVertexData<GLshort, 3, 3, true, true>, true},
1595                     {angle::FormatID::R16G16B16A16_FLOAT, false,
1596                      CopyToFloatVertexData<GLshort, 3, 4, true, true>, true}};
1597                 initBufferFallback(renderer, kInfo, ArraySize(kInfo), 3);
1598             }
1599             break;
1600 
1601         case angle::FormatID::R16G16B16_SSCALED:
1602             mIntendedGLFormat              = GL_RGB16_SSCALED_ANGLEX;
1603             mActualSampleOnlyImageFormatID = angle::FormatID::R16G16B16_SSCALED;
1604             mImageInitializerFunction      = nullptr;
1605             {
1606                 static constexpr BufferFormatInitInfo kInfo[] = {
1607                     {angle::FormatID::R16G16B16_SSCALED, false,
1608                      CopyNativeVertexData<GLshort, 3, 3, 0>, false},
1609                     {angle::FormatID::R16G16B16A16_SSCALED, false,
1610                      CopyNativeVertexData<GLshort, 3, 4, 1>, true},
1611                     {angle::FormatID::R32G32B32_FLOAT, false,
1612                      CopyToFloatVertexData<GLshort, 3, 3, false, false>, true},
1613                     {angle::FormatID::R16G16B16_FLOAT, false,
1614                      CopyToFloatVertexData<GLshort, 3, 3, false, true>, true},
1615                     {angle::FormatID::R16G16B16A16_FLOAT, false,
1616                      CopyToFloatVertexData<GLshort, 3, 4, false, true>, true}};
1617                 initBufferFallback(renderer, kInfo, ArraySize(kInfo), 3);
1618             }
1619             break;
1620 
1621         case angle::FormatID::R16G16B16_UINT:
1622             mIntendedGLFormat = GL_RGB16UI;
1623             {
1624                 static constexpr ImageFormatInitInfo kInfo[] = {
1625                     {angle::FormatID::R16G16B16_UINT, nullptr},
1626                     {angle::FormatID::R16G16B16A16_UINT,
1627                      Initialize4ComponentData<GLushort, 0x0000, 0x0000, 0x0000, 0x0001>}};
1628                 initImageFallback(renderer, kInfo, ArraySize(kInfo));
1629             }
1630             {
1631                 static constexpr BufferFormatInitInfo kInfo[] = {
1632                     {angle::FormatID::R16G16B16_UINT, false,
1633                      CopyNativeVertexData<GLushort, 3, 3, 0>, false},
1634                     {angle::FormatID::R16G16B16A16_UINT, false,
1635                      CopyNativeVertexData<GLushort, 3, 4, 1>, true}};
1636                 initBufferFallback(renderer, kInfo, ArraySize(kInfo), 2);
1637             }
1638             break;
1639 
1640         case angle::FormatID::R16G16B16_UNORM:
1641             mIntendedGLFormat = GL_RGB16_EXT;
1642             {
1643                 static constexpr ImageFormatInitInfo kInfo[] = {
1644                     {angle::FormatID::R16G16B16_UNORM, nullptr},
1645                     {angle::FormatID::R16G16B16A16_UNORM,
1646                      Initialize4ComponentData<GLushort, 0x0000, 0x0000, 0x0000, 0xFFFF>},
1647                     {angle::FormatID::R32G32B32_FLOAT, nullptr},
1648                     {angle::FormatID::R32G32B32A32_FLOAT,
1649                      Initialize4ComponentData<GLfloat, 0x00000000, 0x00000000, 0x00000000,
1650                                               gl::Float32One>}};
1651                 initImageFallback(renderer, kInfo, ArraySize(kInfo));
1652             }
1653             {
1654                 static constexpr BufferFormatInitInfo kInfo[] = {
1655                     {angle::FormatID::R16G16B16_UNORM, false,
1656                      CopyNativeVertexData<GLushort, 3, 3, 0>, false},
1657                     {angle::FormatID::R16G16B16A16_UNORM, false,
1658                      CopyNativeVertexData<GLushort, 3, 4, std::numeric_limits<GLushort>::max()>,
1659                      true},
1660                     {angle::FormatID::R32G32B32_FLOAT, false,
1661                      CopyToFloatVertexData<GLushort, 3, 3, true, false>, true},
1662                     {angle::FormatID::R16G16B16_FLOAT, false,
1663                      CopyToFloatVertexData<GLushort, 3, 3, true, true>, true},
1664                     {angle::FormatID::R16G16B16A16_FLOAT, false,
1665                      CopyToFloatVertexData<GLushort, 3, 4, true, true>, true}};
1666                 initBufferFallback(renderer, kInfo, ArraySize(kInfo), 3);
1667             }
1668             break;
1669 
1670         case angle::FormatID::R16G16B16_USCALED:
1671             mIntendedGLFormat              = GL_RGB16_USCALED_ANGLEX;
1672             mActualSampleOnlyImageFormatID = angle::FormatID::R16G16B16_USCALED;
1673             mImageInitializerFunction      = nullptr;
1674             {
1675                 static constexpr BufferFormatInitInfo kInfo[] = {
1676                     {angle::FormatID::R16G16B16_USCALED, false,
1677                      CopyNativeVertexData<GLushort, 3, 3, 0>, false},
1678                     {angle::FormatID::R16G16B16A16_USCALED, false,
1679                      CopyNativeVertexData<GLushort, 3, 4, 1>, true},
1680                     {angle::FormatID::R32G32B32_FLOAT, false,
1681                      CopyToFloatVertexData<GLushort, 3, 3, false, false>, true},
1682                     {angle::FormatID::R16G16B16_FLOAT, false,
1683                      CopyToFloatVertexData<GLushort, 3, 3, false, true>, true},
1684                     {angle::FormatID::R16G16B16A16_FLOAT, false,
1685                      CopyToFloatVertexData<GLushort, 3, 4, false, true>, true}};
1686                 initBufferFallback(renderer, kInfo, ArraySize(kInfo), 3);
1687             }
1688             break;
1689 
1690         case angle::FormatID::R16G16_FLOAT:
1691             mIntendedGLFormat              = GL_RG16F;
1692             mActualSampleOnlyImageFormatID = angle::FormatID::R16G16_FLOAT;
1693             mImageInitializerFunction      = nullptr;
1694             mActualBufferFormatID          = angle::FormatID::R16G16_FLOAT;
1695             mVkBufferFormatIsPacked        = false;
1696             mVertexLoadFunction            = CopyNativeVertexData<GLhalf, 2, 2, 0>;
1697             mVertexLoadRequiresConversion  = false;
1698             break;
1699 
1700         case angle::FormatID::R16G16_SINT:
1701             mIntendedGLFormat              = GL_RG16I;
1702             mActualSampleOnlyImageFormatID = angle::FormatID::R16G16_SINT;
1703             mImageInitializerFunction      = nullptr;
1704             mActualBufferFormatID          = angle::FormatID::R16G16_SINT;
1705             mVkBufferFormatIsPacked        = false;
1706             mVertexLoadFunction            = CopyNativeVertexData<GLshort, 2, 2, 0>;
1707             mVertexLoadRequiresConversion  = false;
1708             break;
1709 
1710         case angle::FormatID::R16G16_SNORM:
1711             mIntendedGLFormat              = GL_RG16_SNORM_EXT;
1712             mActualSampleOnlyImageFormatID = angle::FormatID::R16G16_SNORM;
1713             mImageInitializerFunction      = nullptr;
1714             mActualBufferFormatID          = angle::FormatID::R16G16_SNORM;
1715             mVkBufferFormatIsPacked        = false;
1716             mVertexLoadFunction            = CopyNativeVertexData<GLshort, 2, 2, 0>;
1717             mVertexLoadRequiresConversion  = false;
1718             break;
1719 
1720         case angle::FormatID::R16G16_SSCALED:
1721             mIntendedGLFormat              = GL_RG16_SSCALED_ANGLEX;
1722             mActualSampleOnlyImageFormatID = angle::FormatID::R16G16_SSCALED;
1723             mImageInitializerFunction      = nullptr;
1724             {
1725                 static constexpr BufferFormatInitInfo kInfo[] = {
1726                     {angle::FormatID::R16G16_SSCALED, false, CopyNativeVertexData<GLshort, 2, 2, 0>,
1727                      false},
1728                     {angle::FormatID::R16G16B16_SSCALED, false,
1729                      CopyNativeVertexData<GLshort, 2, 3, 0>, true},
1730                     {angle::FormatID::R32G32_FLOAT, false,
1731                      CopyToFloatVertexData<GLshort, 2, 2, false, false>, true},
1732                     {angle::FormatID::R16G16_FLOAT, false,
1733                      CopyToFloatVertexData<GLshort, 2, 2, false, true>, true}};
1734                 initBufferFallback(renderer, kInfo, ArraySize(kInfo), 3);
1735             }
1736             break;
1737 
1738         case angle::FormatID::R16G16_UINT:
1739             mIntendedGLFormat              = GL_RG16UI;
1740             mActualSampleOnlyImageFormatID = angle::FormatID::R16G16_UINT;
1741             mImageInitializerFunction      = nullptr;
1742             mActualBufferFormatID          = angle::FormatID::R16G16_UINT;
1743             mVkBufferFormatIsPacked        = false;
1744             mVertexLoadFunction            = CopyNativeVertexData<GLushort, 2, 2, 0>;
1745             mVertexLoadRequiresConversion  = false;
1746             break;
1747 
1748         case angle::FormatID::R16G16_UNORM:
1749             mIntendedGLFormat              = GL_RG16_EXT;
1750             mActualSampleOnlyImageFormatID = angle::FormatID::R16G16_UNORM;
1751             mImageInitializerFunction      = nullptr;
1752             mActualBufferFormatID          = angle::FormatID::R16G16_UNORM;
1753             mVkBufferFormatIsPacked        = false;
1754             mVertexLoadFunction            = CopyNativeVertexData<GLushort, 2, 2, 0>;
1755             mVertexLoadRequiresConversion  = false;
1756             break;
1757 
1758         case angle::FormatID::R16G16_USCALED:
1759             mIntendedGLFormat              = GL_RG16_USCALED_ANGLEX;
1760             mActualSampleOnlyImageFormatID = angle::FormatID::R16G16_USCALED;
1761             mImageInitializerFunction      = nullptr;
1762             {
1763                 static constexpr BufferFormatInitInfo kInfo[] = {
1764                     {angle::FormatID::R16G16_USCALED, false,
1765                      CopyNativeVertexData<GLushort, 2, 2, 0>, false},
1766                     {angle::FormatID::R16G16B16_USCALED, false,
1767                      CopyNativeVertexData<GLushort, 2, 3, 0>, true},
1768                     {angle::FormatID::R32G32_FLOAT, false,
1769                      CopyToFloatVertexData<GLushort, 2, 2, false, false>, true},
1770                     {angle::FormatID::R16G16_FLOAT, false,
1771                      CopyToFloatVertexData<GLushort, 2, 2, false, true>, true}};
1772                 initBufferFallback(renderer, kInfo, ArraySize(kInfo), 3);
1773             }
1774             break;
1775 
1776         case angle::FormatID::R16_FLOAT:
1777             mIntendedGLFormat              = GL_R16F;
1778             mActualSampleOnlyImageFormatID = angle::FormatID::R16_FLOAT;
1779             mImageInitializerFunction      = nullptr;
1780             mActualBufferFormatID          = angle::FormatID::R16_FLOAT;
1781             mVkBufferFormatIsPacked        = false;
1782             mVertexLoadFunction            = CopyNativeVertexData<GLhalf, 1, 1, 0>;
1783             mVertexLoadRequiresConversion  = false;
1784             break;
1785 
1786         case angle::FormatID::R16_SINT:
1787             mIntendedGLFormat              = GL_R16I;
1788             mActualSampleOnlyImageFormatID = angle::FormatID::R16_SINT;
1789             mImageInitializerFunction      = nullptr;
1790             mActualBufferFormatID          = angle::FormatID::R16_SINT;
1791             mVkBufferFormatIsPacked        = false;
1792             mVertexLoadFunction            = CopyNativeVertexData<GLshort, 1, 1, 0>;
1793             mVertexLoadRequiresConversion  = false;
1794             break;
1795 
1796         case angle::FormatID::R16_SNORM:
1797             mIntendedGLFormat              = GL_R16_SNORM_EXT;
1798             mActualSampleOnlyImageFormatID = angle::FormatID::R16_SNORM;
1799             mImageInitializerFunction      = nullptr;
1800             mActualBufferFormatID          = angle::FormatID::R16_SNORM;
1801             mVkBufferFormatIsPacked        = false;
1802             mVertexLoadFunction            = CopyNativeVertexData<GLshort, 1, 1, 0>;
1803             mVertexLoadRequiresConversion  = false;
1804             break;
1805 
1806         case angle::FormatID::R16_SSCALED:
1807             mIntendedGLFormat              = GL_R16_SSCALED_ANGLEX;
1808             mActualSampleOnlyImageFormatID = angle::FormatID::R16_SSCALED;
1809             mImageInitializerFunction      = nullptr;
1810             {
1811                 static constexpr BufferFormatInitInfo kInfo[] = {
1812                     {angle::FormatID::R16_SSCALED, false, CopyNativeVertexData<GLshort, 1, 1, 0>,
1813                      false},
1814                     {angle::FormatID::R32_FLOAT, false,
1815                      CopyToFloatVertexData<GLshort, 1, 1, false, false>, true},
1816                     {angle::FormatID::R16_FLOAT, false,
1817                      CopyToFloatVertexData<GLshort, 1, 1, false, true>, true}};
1818                 initBufferFallback(renderer, kInfo, ArraySize(kInfo), 2);
1819             }
1820             break;
1821 
1822         case angle::FormatID::R16_UINT:
1823             mIntendedGLFormat              = GL_R16UI;
1824             mActualSampleOnlyImageFormatID = angle::FormatID::R16_UINT;
1825             mImageInitializerFunction      = nullptr;
1826             mActualBufferFormatID          = angle::FormatID::R16_UINT;
1827             mVkBufferFormatIsPacked        = false;
1828             mVertexLoadFunction            = CopyNativeVertexData<GLushort, 1, 1, 0>;
1829             mVertexLoadRequiresConversion  = false;
1830             break;
1831 
1832         case angle::FormatID::R16_UNORM:
1833             mIntendedGLFormat              = GL_R16_EXT;
1834             mActualSampleOnlyImageFormatID = angle::FormatID::R16_UNORM;
1835             mImageInitializerFunction      = nullptr;
1836             mActualBufferFormatID          = angle::FormatID::R16_UNORM;
1837             mVkBufferFormatIsPacked        = false;
1838             mVertexLoadFunction            = CopyNativeVertexData<GLushort, 1, 1, 0>;
1839             mVertexLoadRequiresConversion  = false;
1840             break;
1841 
1842         case angle::FormatID::R16_USCALED:
1843             mIntendedGLFormat              = GL_R16_USCALED_ANGLEX;
1844             mActualSampleOnlyImageFormatID = angle::FormatID::R16_USCALED;
1845             mImageInitializerFunction      = nullptr;
1846             {
1847                 static constexpr BufferFormatInitInfo kInfo[] = {
1848                     {angle::FormatID::R16_USCALED, false, CopyNativeVertexData<GLushort, 1, 1, 0>,
1849                      false},
1850                     {angle::FormatID::R32_FLOAT, false,
1851                      CopyToFloatVertexData<GLushort, 1, 1, false, false>, true},
1852                     {angle::FormatID::R16_FLOAT, false,
1853                      CopyToFloatVertexData<GLushort, 1, 1, false, true>, true}};
1854                 initBufferFallback(renderer, kInfo, ArraySize(kInfo), 2);
1855             }
1856             break;
1857 
1858         case angle::FormatID::R32G32B32A32_FIXED:
1859             mIntendedGLFormat = GL_RGBA32_FIXED_ANGLEX;
1860 
1861             mActualBufferFormatID         = angle::FormatID::R32G32B32A32_FLOAT;
1862             mVkBufferFormatIsPacked       = false;
1863             mVertexLoadFunction           = Copy32FixedTo32FVertexData<4, 4>;
1864             mVertexLoadRequiresConversion = true;
1865             break;
1866 
1867         case angle::FormatID::R32G32B32A32_FLOAT:
1868             mIntendedGLFormat              = GL_RGBA32F;
1869             mActualSampleOnlyImageFormatID = angle::FormatID::R32G32B32A32_FLOAT;
1870             mImageInitializerFunction      = nullptr;
1871             {
1872                 static constexpr BufferFormatInitInfo kInfo[] = {
1873                     {angle::FormatID::R32G32B32A32_FLOAT, false,
1874                      CopyNativeVertexData<GLfloat, 4, 4, 0>, false},
1875                     {angle::FormatID::R16G16B16A16_FLOAT, false,
1876                      CopyToFloatVertexData<GLfloat, 4, 4, false, true>, true}};
1877                 initBufferFallback(renderer, kInfo, ArraySize(kInfo), 1);
1878             }
1879             break;
1880 
1881         case angle::FormatID::R32G32B32A32_SINT:
1882             mIntendedGLFormat              = GL_RGBA32I;
1883             mActualSampleOnlyImageFormatID = angle::FormatID::R32G32B32A32_SINT;
1884             mImageInitializerFunction      = nullptr;
1885             mActualBufferFormatID          = angle::FormatID::R32G32B32A32_SINT;
1886             mVkBufferFormatIsPacked        = false;
1887             mVertexLoadFunction            = CopyNativeVertexData<GLint, 4, 4, 0>;
1888             mVertexLoadRequiresConversion  = false;
1889             break;
1890 
1891         case angle::FormatID::R32G32B32A32_SNORM:
1892             mIntendedGLFormat = GL_RGBA32_SNORM_ANGLEX;
1893 
1894             mActualBufferFormatID         = angle::FormatID::R32G32B32A32_FLOAT;
1895             mVkBufferFormatIsPacked       = false;
1896             mVertexLoadFunction           = CopyToFloatVertexData<GLint, 4, 4, true, false>;
1897             mVertexLoadRequiresConversion = true;
1898             break;
1899 
1900         case angle::FormatID::R32G32B32A32_SSCALED:
1901             mIntendedGLFormat = GL_RGBA32_SSCALED_ANGLEX;
1902 
1903             mActualBufferFormatID         = angle::FormatID::R32G32B32A32_FLOAT;
1904             mVkBufferFormatIsPacked       = false;
1905             mVertexLoadFunction           = CopyToFloatVertexData<GLint, 4, 4, false, false>;
1906             mVertexLoadRequiresConversion = true;
1907             break;
1908 
1909         case angle::FormatID::R32G32B32A32_UINT:
1910             mIntendedGLFormat              = GL_RGBA32UI;
1911             mActualSampleOnlyImageFormatID = angle::FormatID::R32G32B32A32_UINT;
1912             mImageInitializerFunction      = nullptr;
1913             mActualBufferFormatID          = angle::FormatID::R32G32B32A32_UINT;
1914             mVkBufferFormatIsPacked        = false;
1915             mVertexLoadFunction            = CopyNativeVertexData<GLuint, 4, 4, 0>;
1916             mVertexLoadRequiresConversion  = false;
1917             break;
1918 
1919         case angle::FormatID::R32G32B32A32_UNORM:
1920             mIntendedGLFormat = GL_RGBA32_UNORM_ANGLEX;
1921 
1922             mActualBufferFormatID         = angle::FormatID::R32G32B32A32_FLOAT;
1923             mVkBufferFormatIsPacked       = false;
1924             mVertexLoadFunction           = CopyToFloatVertexData<GLuint, 4, 4, true, false>;
1925             mVertexLoadRequiresConversion = true;
1926             break;
1927 
1928         case angle::FormatID::R32G32B32A32_USCALED:
1929             mIntendedGLFormat = GL_RGBA32_USCALED_ANGLEX;
1930 
1931             mActualBufferFormatID         = angle::FormatID::R32G32B32A32_FLOAT;
1932             mVkBufferFormatIsPacked       = false;
1933             mVertexLoadFunction           = CopyToFloatVertexData<GLuint, 4, 4, false, false>;
1934             mVertexLoadRequiresConversion = true;
1935             break;
1936 
1937         case angle::FormatID::R32G32B32_FIXED:
1938             mIntendedGLFormat = GL_RGB32_FIXED_ANGLEX;
1939 
1940             mActualBufferFormatID         = angle::FormatID::R32G32B32_FLOAT;
1941             mVkBufferFormatIsPacked       = false;
1942             mVertexLoadFunction           = Copy32FixedTo32FVertexData<3, 3>;
1943             mVertexLoadRequiresConversion = true;
1944             break;
1945 
1946         case angle::FormatID::R32G32B32_FLOAT:
1947             mIntendedGLFormat = GL_RGB32F;
1948             {
1949                 static constexpr ImageFormatInitInfo kInfo[] = {
1950                     {angle::FormatID::R32G32B32_FLOAT, nullptr},
1951                     {angle::FormatID::R32G32B32A32_FLOAT,
1952                      Initialize4ComponentData<GLfloat, 0x00000000, 0x00000000, 0x00000000,
1953                                               gl::Float32One>}};
1954                 initImageFallback(renderer, kInfo, ArraySize(kInfo));
1955             }
1956             {
1957                 static constexpr BufferFormatInitInfo kInfo[] = {
1958                     {angle::FormatID::R32G32B32_FLOAT, false,
1959                      CopyNativeVertexData<GLfloat, 3, 3, 0>, false},
1960                     {angle::FormatID::R16G16B16_FLOAT, false,
1961                      CopyToFloatVertexData<GLfloat, 3, 3, false, true>, true},
1962                     {angle::FormatID::R16G16B16A16_FLOAT, false,
1963                      CopyToFloatVertexData<GLfloat, 3, 4, false, true>, true}};
1964                 initBufferFallback(renderer, kInfo, ArraySize(kInfo), 1);
1965             }
1966             break;
1967 
1968         case angle::FormatID::R32G32B32_SINT:
1969             mIntendedGLFormat = GL_RGB32I;
1970             {
1971                 static constexpr ImageFormatInitInfo kInfo[] = {
1972                     {angle::FormatID::R32G32B32_SINT, nullptr},
1973                     {angle::FormatID::R32G32B32A32_SINT,
1974                      Initialize4ComponentData<GLint, 0x00000000, 0x00000000, 0x00000000,
1975                                               0x00000001>}};
1976                 initImageFallback(renderer, kInfo, ArraySize(kInfo));
1977             }
1978             mActualBufferFormatID         = angle::FormatID::R32G32B32_SINT;
1979             mVkBufferFormatIsPacked       = false;
1980             mVertexLoadFunction           = CopyNativeVertexData<GLint, 3, 3, 0>;
1981             mVertexLoadRequiresConversion = false;
1982             break;
1983 
1984         case angle::FormatID::R32G32B32_SNORM:
1985             mIntendedGLFormat = GL_RGB32_SNORM_ANGLEX;
1986 
1987             mActualBufferFormatID         = angle::FormatID::R32G32B32_FLOAT;
1988             mVkBufferFormatIsPacked       = false;
1989             mVertexLoadFunction           = CopyToFloatVertexData<GLint, 3, 3, true, false>;
1990             mVertexLoadRequiresConversion = true;
1991             break;
1992 
1993         case angle::FormatID::R32G32B32_SSCALED:
1994             mIntendedGLFormat = GL_RGB32_SSCALED_ANGLEX;
1995 
1996             mActualBufferFormatID         = angle::FormatID::R32G32B32_FLOAT;
1997             mVkBufferFormatIsPacked       = false;
1998             mVertexLoadFunction           = CopyToFloatVertexData<GLint, 3, 3, false, false>;
1999             mVertexLoadRequiresConversion = true;
2000             break;
2001 
2002         case angle::FormatID::R32G32B32_UINT:
2003             mIntendedGLFormat = GL_RGB32UI;
2004             {
2005                 static constexpr ImageFormatInitInfo kInfo[] = {
2006                     {angle::FormatID::R32G32B32_UINT, nullptr},
2007                     {angle::FormatID::R32G32B32A32_UINT,
2008                      Initialize4ComponentData<GLuint, 0x00000000, 0x00000000, 0x00000000,
2009                                               0x00000001>}};
2010                 initImageFallback(renderer, kInfo, ArraySize(kInfo));
2011             }
2012             mActualBufferFormatID         = angle::FormatID::R32G32B32_UINT;
2013             mVkBufferFormatIsPacked       = false;
2014             mVertexLoadFunction           = CopyNativeVertexData<GLuint, 3, 3, 0>;
2015             mVertexLoadRequiresConversion = false;
2016             break;
2017 
2018         case angle::FormatID::R32G32B32_UNORM:
2019             mIntendedGLFormat = GL_RGB32_UNORM_ANGLEX;
2020 
2021             mActualBufferFormatID         = angle::FormatID::R32G32B32_FLOAT;
2022             mVkBufferFormatIsPacked       = false;
2023             mVertexLoadFunction           = CopyToFloatVertexData<GLuint, 3, 3, true, false>;
2024             mVertexLoadRequiresConversion = true;
2025             break;
2026 
2027         case angle::FormatID::R32G32B32_USCALED:
2028             mIntendedGLFormat = GL_RGB32_USCALED_ANGLEX;
2029 
2030             mActualBufferFormatID         = angle::FormatID::R32G32B32_FLOAT;
2031             mVkBufferFormatIsPacked       = false;
2032             mVertexLoadFunction           = CopyToFloatVertexData<GLuint, 3, 3, false, false>;
2033             mVertexLoadRequiresConversion = true;
2034             break;
2035 
2036         case angle::FormatID::R32G32_FIXED:
2037             mIntendedGLFormat = GL_RG32_FIXED_ANGLEX;
2038 
2039             mActualBufferFormatID         = angle::FormatID::R32G32_FLOAT;
2040             mVkBufferFormatIsPacked       = false;
2041             mVertexLoadFunction           = Copy32FixedTo32FVertexData<2, 2>;
2042             mVertexLoadRequiresConversion = true;
2043             break;
2044 
2045         case angle::FormatID::R32G32_FLOAT:
2046             mIntendedGLFormat              = GL_RG32F;
2047             mActualSampleOnlyImageFormatID = angle::FormatID::R32G32_FLOAT;
2048             mImageInitializerFunction      = nullptr;
2049             {
2050                 static constexpr BufferFormatInitInfo kInfo[] = {
2051                     {angle::FormatID::R32G32_FLOAT, false, CopyNativeVertexData<GLfloat, 2, 2, 0>,
2052                      false},
2053                     {angle::FormatID::R16G16_FLOAT, false,
2054                      CopyToFloatVertexData<GLfloat, 2, 2, false, true>, true}};
2055                 initBufferFallback(renderer, kInfo, ArraySize(kInfo), 1);
2056             }
2057             break;
2058 
2059         case angle::FormatID::R32G32_SINT:
2060             mIntendedGLFormat              = GL_RG32I;
2061             mActualSampleOnlyImageFormatID = angle::FormatID::R32G32_SINT;
2062             mImageInitializerFunction      = nullptr;
2063             mActualBufferFormatID          = angle::FormatID::R32G32_SINT;
2064             mVkBufferFormatIsPacked        = false;
2065             mVertexLoadFunction            = CopyNativeVertexData<GLint, 2, 2, 0>;
2066             mVertexLoadRequiresConversion  = false;
2067             break;
2068 
2069         case angle::FormatID::R32G32_SNORM:
2070             mIntendedGLFormat = GL_RG32_SNORM_ANGLEX;
2071 
2072             mActualBufferFormatID         = angle::FormatID::R32G32_FLOAT;
2073             mVkBufferFormatIsPacked       = false;
2074             mVertexLoadFunction           = CopyToFloatVertexData<GLint, 2, 2, true, false>;
2075             mVertexLoadRequiresConversion = true;
2076             break;
2077 
2078         case angle::FormatID::R32G32_SSCALED:
2079             mIntendedGLFormat = GL_RG32_SSCALED_ANGLEX;
2080 
2081             mActualBufferFormatID         = angle::FormatID::R32G32_FLOAT;
2082             mVkBufferFormatIsPacked       = false;
2083             mVertexLoadFunction           = CopyToFloatVertexData<GLint, 2, 2, false, false>;
2084             mVertexLoadRequiresConversion = true;
2085             break;
2086 
2087         case angle::FormatID::R32G32_UINT:
2088             mIntendedGLFormat              = GL_RG32UI;
2089             mActualSampleOnlyImageFormatID = angle::FormatID::R32G32_UINT;
2090             mImageInitializerFunction      = nullptr;
2091             mActualBufferFormatID          = angle::FormatID::R32G32_UINT;
2092             mVkBufferFormatIsPacked        = false;
2093             mVertexLoadFunction            = CopyNativeVertexData<GLuint, 2, 2, 0>;
2094             mVertexLoadRequiresConversion  = false;
2095             break;
2096 
2097         case angle::FormatID::R32G32_UNORM:
2098             mIntendedGLFormat = GL_RG32_UNORM_ANGLEX;
2099 
2100             mActualBufferFormatID         = angle::FormatID::R32G32_FLOAT;
2101             mVkBufferFormatIsPacked       = false;
2102             mVertexLoadFunction           = CopyToFloatVertexData<GLuint, 2, 2, true, false>;
2103             mVertexLoadRequiresConversion = true;
2104             break;
2105 
2106         case angle::FormatID::R32G32_USCALED:
2107             mIntendedGLFormat = GL_RG32_USCALED_ANGLEX;
2108 
2109             mActualBufferFormatID         = angle::FormatID::R32G32_FLOAT;
2110             mVkBufferFormatIsPacked       = false;
2111             mVertexLoadFunction           = CopyToFloatVertexData<GLuint, 2, 2, false, false>;
2112             mVertexLoadRequiresConversion = true;
2113             break;
2114 
2115         case angle::FormatID::R32_FIXED:
2116             mIntendedGLFormat = GL_R32_FIXED_ANGLEX;
2117 
2118             mActualBufferFormatID         = angle::FormatID::R32_FLOAT;
2119             mVkBufferFormatIsPacked       = false;
2120             mVertexLoadFunction           = Copy32FixedTo32FVertexData<1, 1>;
2121             mVertexLoadRequiresConversion = true;
2122             break;
2123 
2124         case angle::FormatID::R32_FLOAT:
2125             mIntendedGLFormat              = GL_R32F;
2126             mActualSampleOnlyImageFormatID = angle::FormatID::R32_FLOAT;
2127             mImageInitializerFunction      = nullptr;
2128             {
2129                 static constexpr BufferFormatInitInfo kInfo[] = {
2130                     {angle::FormatID::R32_FLOAT, false, CopyNativeVertexData<GLfloat, 1, 1, 0>,
2131                      false},
2132                     {angle::FormatID::R16_FLOAT, false,
2133                      CopyToFloatVertexData<GLfloat, 1, 1, false, true>, true}};
2134                 initBufferFallback(renderer, kInfo, ArraySize(kInfo), 1);
2135             }
2136             break;
2137 
2138         case angle::FormatID::R32_SINT:
2139             mIntendedGLFormat              = GL_R32I;
2140             mActualSampleOnlyImageFormatID = angle::FormatID::R32_SINT;
2141             mImageInitializerFunction      = nullptr;
2142             mActualBufferFormatID          = angle::FormatID::R32_SINT;
2143             mVkBufferFormatIsPacked        = false;
2144             mVertexLoadFunction            = CopyNativeVertexData<GLint, 1, 1, 0>;
2145             mVertexLoadRequiresConversion  = false;
2146             break;
2147 
2148         case angle::FormatID::R32_SNORM:
2149             mIntendedGLFormat = GL_R32_SNORM_ANGLEX;
2150 
2151             mActualBufferFormatID         = angle::FormatID::R32_FLOAT;
2152             mVkBufferFormatIsPacked       = false;
2153             mVertexLoadFunction           = CopyToFloatVertexData<GLint, 1, 1, true, false>;
2154             mVertexLoadRequiresConversion = true;
2155             break;
2156 
2157         case angle::FormatID::R32_SSCALED:
2158             mIntendedGLFormat = GL_R32_SSCALED_ANGLEX;
2159 
2160             mActualBufferFormatID         = angle::FormatID::R32_FLOAT;
2161             mVkBufferFormatIsPacked       = false;
2162             mVertexLoadFunction           = CopyToFloatVertexData<GLint, 1, 1, false, false>;
2163             mVertexLoadRequiresConversion = true;
2164             break;
2165 
2166         case angle::FormatID::R32_UINT:
2167             mIntendedGLFormat              = GL_R32UI;
2168             mActualSampleOnlyImageFormatID = angle::FormatID::R32_UINT;
2169             mImageInitializerFunction      = nullptr;
2170             mActualBufferFormatID          = angle::FormatID::R32_UINT;
2171             mVkBufferFormatIsPacked        = false;
2172             mVertexLoadFunction            = CopyNativeVertexData<GLuint, 1, 1, 0>;
2173             mVertexLoadRequiresConversion  = false;
2174             break;
2175 
2176         case angle::FormatID::R32_UNORM:
2177             mIntendedGLFormat = GL_R32_UNORM_ANGLEX;
2178 
2179             mActualBufferFormatID         = angle::FormatID::R32_FLOAT;
2180             mVkBufferFormatIsPacked       = false;
2181             mVertexLoadFunction           = CopyToFloatVertexData<GLuint, 1, 1, true, false>;
2182             mVertexLoadRequiresConversion = true;
2183             break;
2184 
2185         case angle::FormatID::R32_USCALED:
2186             mIntendedGLFormat = GL_R32_USCALED_ANGLEX;
2187 
2188             mActualBufferFormatID         = angle::FormatID::R32_FLOAT;
2189             mVkBufferFormatIsPacked       = false;
2190             mVertexLoadFunction           = CopyToFloatVertexData<GLuint, 1, 1, false, false>;
2191             mVertexLoadRequiresConversion = true;
2192             break;
2193 
2194         case angle::FormatID::R4G4B4A4_UNORM:
2195             mIntendedGLFormat = GL_RGBA4;
2196             {
2197                 static constexpr ImageFormatInitInfo kInfo[] = {
2198                     {angle::FormatID::R4G4B4A4_UNORM, nullptr},
2199                     {angle::FormatID::R8G8B8A8_UNORM, nullptr}};
2200                 initImageFallback(renderer, kInfo, ArraySize(kInfo));
2201             }
2202             mActualBufferFormatID         = angle::FormatID::R4G4B4A4_UNORM;
2203             mVkBufferFormatIsPacked       = true;
2204             mVertexLoadFunction           = CopyNativeVertexData<GLushort, 1, 1, 0>;
2205             mVertexLoadRequiresConversion = false;
2206             break;
2207 
2208         case angle::FormatID::R5G5B5A1_UNORM:
2209             mIntendedGLFormat = GL_RGB5_A1;
2210             {
2211                 static constexpr ImageFormatInitInfo kInfo[] = {
2212                     {angle::FormatID::R5G5B5A1_UNORM, nullptr},
2213                     {angle::FormatID::A1R5G5B5_UNORM, nullptr}};
2214                 initImageFallback(renderer, kInfo, ArraySize(kInfo));
2215             }
2216             mActualBufferFormatID         = angle::FormatID::R5G5B5A1_UNORM;
2217             mVkBufferFormatIsPacked       = true;
2218             mVertexLoadFunction           = CopyNativeVertexData<GLushort, 1, 1, 0>;
2219             mVertexLoadRequiresConversion = false;
2220             break;
2221 
2222         case angle::FormatID::R5G6B5_UNORM:
2223             mIntendedGLFormat              = GL_RGB565;
2224             mActualSampleOnlyImageFormatID = angle::FormatID::R5G6B5_UNORM;
2225             mImageInitializerFunction      = nullptr;
2226             mActualBufferFormatID          = angle::FormatID::R5G6B5_UNORM;
2227             mVkBufferFormatIsPacked        = true;
2228             mVertexLoadFunction            = CopyNativeVertexData<GLushort, 1, 1, 0>;
2229             mVertexLoadRequiresConversion  = false;
2230             break;
2231 
2232         case angle::FormatID::R8G8B8A8_SINT:
2233             mIntendedGLFormat              = GL_RGBA8I;
2234             mActualSampleOnlyImageFormatID = angle::FormatID::R8G8B8A8_SINT;
2235             mImageInitializerFunction      = nullptr;
2236             mActualBufferFormatID          = angle::FormatID::R8G8B8A8_SINT;
2237             mVkBufferFormatIsPacked        = false;
2238             mVertexLoadFunction            = CopyNativeVertexData<GLbyte, 4, 4, 0>;
2239             mVertexLoadRequiresConversion  = false;
2240             break;
2241 
2242         case angle::FormatID::R8G8B8A8_SNORM:
2243             mIntendedGLFormat              = GL_RGBA8_SNORM;
2244             mActualSampleOnlyImageFormatID = angle::FormatID::R8G8B8A8_SNORM;
2245             mImageInitializerFunction      = nullptr;
2246             mActualBufferFormatID          = angle::FormatID::R8G8B8A8_SNORM;
2247             mVkBufferFormatIsPacked        = false;
2248             mVertexLoadFunction            = CopyNativeVertexData<GLbyte, 4, 4, 0>;
2249             mVertexLoadRequiresConversion  = false;
2250             break;
2251 
2252         case angle::FormatID::R8G8B8A8_SSCALED:
2253             mIntendedGLFormat              = GL_RGBA8_SSCALED_ANGLEX;
2254             mActualSampleOnlyImageFormatID = angle::FormatID::R8G8B8A8_SSCALED;
2255             mImageInitializerFunction      = nullptr;
2256             {
2257                 static constexpr BufferFormatInitInfo kInfo[] = {
2258                     {angle::FormatID::R8G8B8A8_SSCALED, false,
2259                      CopyNativeVertexData<GLbyte, 4, 4, 0>, false},
2260                     {angle::FormatID::R16G16B16A16_FLOAT, false,
2261                      CopyToFloatVertexData<GLbyte, 4, 4, false, true>, true}};
2262                 initBufferFallback(renderer, kInfo, ArraySize(kInfo), 2);
2263             }
2264             break;
2265 
2266         case angle::FormatID::R8G8B8A8_TYPELESS:
2267             // This format is not implemented in Vulkan.
2268             break;
2269 
2270         case angle::FormatID::R8G8B8A8_TYPELESS_SRGB:
2271             // This format is not implemented in Vulkan.
2272             break;
2273 
2274         case angle::FormatID::R8G8B8A8_UINT:
2275             mIntendedGLFormat              = GL_RGBA8UI;
2276             mActualSampleOnlyImageFormatID = angle::FormatID::R8G8B8A8_UINT;
2277             mImageInitializerFunction      = nullptr;
2278             mActualBufferFormatID          = angle::FormatID::R8G8B8A8_UINT;
2279             mVkBufferFormatIsPacked        = false;
2280             mVertexLoadFunction            = CopyNativeVertexData<GLubyte, 4, 4, 0>;
2281             mVertexLoadRequiresConversion  = false;
2282             break;
2283 
2284         case angle::FormatID::R8G8B8A8_UNORM:
2285             mIntendedGLFormat              = GL_RGBA8;
2286             mActualSampleOnlyImageFormatID = angle::FormatID::R8G8B8A8_UNORM;
2287             mImageInitializerFunction      = nullptr;
2288             mActualBufferFormatID          = angle::FormatID::R8G8B8A8_UNORM;
2289             mVkBufferFormatIsPacked        = false;
2290             mVertexLoadFunction            = CopyNativeVertexData<GLubyte, 4, 4, 0>;
2291             mVertexLoadRequiresConversion  = false;
2292             break;
2293 
2294         case angle::FormatID::R8G8B8A8_UNORM_SRGB:
2295             mIntendedGLFormat              = GL_SRGB8_ALPHA8;
2296             mActualSampleOnlyImageFormatID = angle::FormatID::R8G8B8A8_UNORM_SRGB;
2297             mImageInitializerFunction      = nullptr;
2298             mActualBufferFormatID          = angle::FormatID::R8G8B8A8_UNORM_SRGB;
2299             mVkBufferFormatIsPacked        = false;
2300             mVertexLoadFunction            = CopyNativeVertexData<GLubyte, 4, 4, 0>;
2301             mVertexLoadRequiresConversion  = false;
2302             break;
2303 
2304         case angle::FormatID::R8G8B8A8_USCALED:
2305             mIntendedGLFormat              = GL_RGBA8_USCALED_ANGLEX;
2306             mActualSampleOnlyImageFormatID = angle::FormatID::R8G8B8A8_USCALED;
2307             mImageInitializerFunction      = nullptr;
2308             {
2309                 static constexpr BufferFormatInitInfo kInfo[] = {
2310                     {angle::FormatID::R8G8B8A8_USCALED, false,
2311                      CopyNativeVertexData<GLubyte, 4, 4, 0>, false},
2312                     {angle::FormatID::R16G16B16A16_FLOAT, false,
2313                      CopyToFloatVertexData<GLubyte, 4, 4, false, true>, true}};
2314                 initBufferFallback(renderer, kInfo, ArraySize(kInfo), 2);
2315             }
2316             break;
2317 
2318         case angle::FormatID::R8G8B8X8_UNORM:
2319             mIntendedGLFormat              = GL_RGBX8_ANGLE;
2320             mActualSampleOnlyImageFormatID = angle::FormatID::R8G8B8A8_UNORM;
2321             mImageInitializerFunction      = nullptr;
2322             mActualBufferFormatID          = angle::FormatID::NONE;
2323             mVkBufferFormatIsPacked        = false;
2324             mVertexLoadFunction            = nullptr;
2325             mVertexLoadRequiresConversion  = true;
2326             break;
2327 
2328         case angle::FormatID::R8G8B8X8_UNORM_SRGB:
2329             mIntendedGLFormat              = GL_RGBX8_SRGB_ANGLEX;
2330             mActualSampleOnlyImageFormatID = angle::FormatID::R8G8B8A8_UNORM_SRGB;
2331             mImageInitializerFunction      = nullptr;
2332             mActualBufferFormatID          = angle::FormatID::NONE;
2333             mVkBufferFormatIsPacked        = false;
2334             mVertexLoadFunction            = nullptr;
2335             mVertexLoadRequiresConversion  = true;
2336             break;
2337 
2338         case angle::FormatID::R8G8B8_SINT:
2339             mIntendedGLFormat = GL_RGB8I;
2340             {
2341                 static constexpr ImageFormatInitInfo kInfo[] = {
2342                     {angle::FormatID::R8G8B8_SINT, nullptr},
2343                     {angle::FormatID::R8G8B8A8_SINT,
2344                      Initialize4ComponentData<GLbyte, 0x00, 0x00, 0x00, 0x01>}};
2345                 initImageFallback(renderer, kInfo, ArraySize(kInfo));
2346             }
2347             {
2348                 static constexpr BufferFormatInitInfo kInfo[] = {
2349                     {angle::FormatID::R8G8B8_SINT, false, CopyNativeVertexData<GLbyte, 3, 3, 0>,
2350                      false},
2351                     {angle::FormatID::R8G8B8A8_SINT, false, CopyNativeVertexData<GLbyte, 3, 4, 1>,
2352                      true}};
2353                 initBufferFallback(renderer, kInfo, ArraySize(kInfo), 2);
2354             }
2355             break;
2356 
2357         case angle::FormatID::R8G8B8_SNORM:
2358             mIntendedGLFormat = GL_RGB8_SNORM;
2359             {
2360                 static constexpr ImageFormatInitInfo kInfo[] = {
2361                     {angle::FormatID::R8G8B8_SNORM, nullptr},
2362                     {angle::FormatID::R8G8B8A8_SNORM,
2363                      Initialize4ComponentData<GLbyte, 0x00, 0x00, 0x00, 0x7F>}};
2364                 initImageFallback(renderer, kInfo, ArraySize(kInfo));
2365             }
2366             {
2367                 static constexpr BufferFormatInitInfo kInfo[] = {
2368                     {angle::FormatID::R8G8B8_SNORM, false, CopyNativeVertexData<GLbyte, 3, 3, 0>,
2369                      false},
2370                     {angle::FormatID::R8G8B8A8_SNORM, false,
2371                      CopyNativeVertexData<GLbyte, 3, 4, std::numeric_limits<GLbyte>::max()>, true}};
2372                 initBufferFallback(renderer, kInfo, ArraySize(kInfo), 2);
2373             }
2374             break;
2375 
2376         case angle::FormatID::R8G8B8_SSCALED:
2377             mIntendedGLFormat              = GL_RGB8_SSCALED_ANGLEX;
2378             mActualSampleOnlyImageFormatID = angle::FormatID::R8G8B8_SSCALED;
2379             mImageInitializerFunction      = nullptr;
2380             {
2381                 static constexpr BufferFormatInitInfo kInfo[] = {
2382                     {angle::FormatID::R8G8B8_SSCALED, false, CopyNativeVertexData<GLbyte, 3, 3, 0>,
2383                      false},
2384                     {angle::FormatID::R8G8B8A8_SSCALED, false,
2385                      CopyNativeVertexData<GLbyte, 3, 4, 1>, true},
2386                     {angle::FormatID::R16G16B16_FLOAT, false,
2387                      CopyToFloatVertexData<GLbyte, 3, 3, false, true>, true},
2388                     {angle::FormatID::R16G16B16A16_FLOAT, false,
2389                      CopyToFloatVertexData<GLbyte, 3, 4, false, true>, true}};
2390                 initBufferFallback(renderer, kInfo, ArraySize(kInfo), 4);
2391             }
2392             break;
2393 
2394         case angle::FormatID::R8G8B8_UINT:
2395             mIntendedGLFormat = GL_RGB8UI;
2396             {
2397                 static constexpr ImageFormatInitInfo kInfo[] = {
2398                     {angle::FormatID::R8G8B8_UINT, nullptr},
2399                     {angle::FormatID::R8G8B8A8_UINT,
2400                      Initialize4ComponentData<GLubyte, 0x00, 0x00, 0x00, 0x01>}};
2401                 initImageFallback(renderer, kInfo, ArraySize(kInfo));
2402             }
2403             {
2404                 static constexpr BufferFormatInitInfo kInfo[] = {
2405                     {angle::FormatID::R8G8B8_UINT, false, CopyNativeVertexData<GLubyte, 3, 3, 0>,
2406                      false},
2407                     {angle::FormatID::R8G8B8A8_UINT, false, CopyNativeVertexData<GLubyte, 3, 4, 1>,
2408                      true}};
2409                 initBufferFallback(renderer, kInfo, ArraySize(kInfo), 2);
2410             }
2411             break;
2412 
2413         case angle::FormatID::R8G8B8_UNORM:
2414             mIntendedGLFormat = GL_RGB8;
2415             {
2416                 static constexpr ImageFormatInitInfo kInfo[] = {
2417                     {angle::FormatID::R8G8B8_UNORM, nullptr},
2418                     {angle::FormatID::R8G8B8A8_UNORM,
2419                      Initialize4ComponentData<GLubyte, 0x00, 0x00, 0x00, 0xFF>}};
2420                 initImageFallback(renderer, kInfo, ArraySize(kInfo));
2421             }
2422             {
2423                 static constexpr BufferFormatInitInfo kInfo[] = {
2424                     {angle::FormatID::R8G8B8_UNORM, false, CopyNativeVertexData<GLubyte, 3, 3, 0>,
2425                      false},
2426                     {angle::FormatID::R8G8B8A8_UNORM, false,
2427                      CopyNativeVertexData<GLubyte, 3, 4, std::numeric_limits<GLubyte>::max()>,
2428                      true}};
2429                 initBufferFallback(renderer, kInfo, ArraySize(kInfo), 2);
2430             }
2431             break;
2432 
2433         case angle::FormatID::R8G8B8_UNORM_SRGB:
2434             mIntendedGLFormat = GL_SRGB8;
2435             {
2436                 static constexpr ImageFormatInitInfo kInfo[] = {
2437                     {angle::FormatID::R8G8B8_UNORM_SRGB, nullptr},
2438                     {angle::FormatID::R8G8B8A8_UNORM_SRGB,
2439                      Initialize4ComponentData<GLubyte, 0x00, 0x00, 0x00, 0xFF>}};
2440                 initImageFallback(renderer, kInfo, ArraySize(kInfo));
2441             }
2442             mActualBufferFormatID         = angle::FormatID::R8G8B8_UNORM_SRGB;
2443             mVkBufferFormatIsPacked       = false;
2444             mVertexLoadFunction           = CopyNativeVertexData<GLubyte, 3, 3, 0>;
2445             mVertexLoadRequiresConversion = false;
2446             break;
2447 
2448         case angle::FormatID::R8G8B8_USCALED:
2449             mIntendedGLFormat              = GL_RGB8_USCALED_ANGLEX;
2450             mActualSampleOnlyImageFormatID = angle::FormatID::R8G8B8_USCALED;
2451             mImageInitializerFunction      = nullptr;
2452             {
2453                 static constexpr BufferFormatInitInfo kInfo[] = {
2454                     {angle::FormatID::R8G8B8_USCALED, false, CopyNativeVertexData<GLubyte, 3, 3, 0>,
2455                      false},
2456                     {angle::FormatID::R8G8B8A8_USCALED, false,
2457                      CopyNativeVertexData<GLubyte, 3, 4, 1>, true},
2458                     {angle::FormatID::R16G16B16_FLOAT, false,
2459                      CopyToFloatVertexData<GLubyte, 3, 3, false, true>, true},
2460                     {angle::FormatID::R16G16B16A16_FLOAT, false,
2461                      CopyToFloatVertexData<GLubyte, 3, 4, false, true>, true}};
2462                 initBufferFallback(renderer, kInfo, ArraySize(kInfo), 4);
2463             }
2464             break;
2465 
2466         case angle::FormatID::R8G8_SINT:
2467             mIntendedGLFormat              = GL_RG8I;
2468             mActualSampleOnlyImageFormatID = angle::FormatID::R8G8_SINT;
2469             mImageInitializerFunction      = nullptr;
2470             mActualBufferFormatID          = angle::FormatID::R8G8_SINT;
2471             mVkBufferFormatIsPacked        = false;
2472             mVertexLoadFunction            = CopyNativeVertexData<GLbyte, 2, 2, 0>;
2473             mVertexLoadRequiresConversion  = false;
2474             break;
2475 
2476         case angle::FormatID::R8G8_SNORM:
2477             mIntendedGLFormat              = GL_RG8_SNORM;
2478             mActualSampleOnlyImageFormatID = angle::FormatID::R8G8_SNORM;
2479             mImageInitializerFunction      = nullptr;
2480             mActualBufferFormatID          = angle::FormatID::R8G8_SNORM;
2481             mVkBufferFormatIsPacked        = false;
2482             mVertexLoadFunction            = CopyNativeVertexData<GLbyte, 2, 2, 0>;
2483             mVertexLoadRequiresConversion  = false;
2484             break;
2485 
2486         case angle::FormatID::R8G8_SSCALED:
2487             mIntendedGLFormat              = GL_RG8_SSCALED_ANGLEX;
2488             mActualSampleOnlyImageFormatID = angle::FormatID::R8G8_SSCALED;
2489             mImageInitializerFunction      = nullptr;
2490             {
2491                 static constexpr BufferFormatInitInfo kInfo[] = {
2492                     {angle::FormatID::R8G8_SSCALED, false, CopyNativeVertexData<GLbyte, 2, 2, 0>,
2493                      false},
2494                     {angle::FormatID::R8G8B8_SSCALED, false, CopyNativeVertexData<GLbyte, 2, 3, 0>,
2495                      true},
2496                     {angle::FormatID::R16G16_FLOAT, false,
2497                      CopyToFloatVertexData<GLbyte, 2, 2, false, true>, true}};
2498                 initBufferFallback(renderer, kInfo, ArraySize(kInfo), 3);
2499             }
2500             break;
2501 
2502         case angle::FormatID::R8G8_UINT:
2503             mIntendedGLFormat              = GL_RG8UI;
2504             mActualSampleOnlyImageFormatID = angle::FormatID::R8G8_UINT;
2505             mImageInitializerFunction      = nullptr;
2506             mActualBufferFormatID          = angle::FormatID::R8G8_UINT;
2507             mVkBufferFormatIsPacked        = false;
2508             mVertexLoadFunction            = CopyNativeVertexData<GLubyte, 2, 2, 0>;
2509             mVertexLoadRequiresConversion  = false;
2510             break;
2511 
2512         case angle::FormatID::R8G8_UNORM:
2513             mIntendedGLFormat              = GL_RG8;
2514             mActualSampleOnlyImageFormatID = angle::FormatID::R8G8_UNORM;
2515             mImageInitializerFunction      = nullptr;
2516             mActualBufferFormatID          = angle::FormatID::R8G8_UNORM;
2517             mVkBufferFormatIsPacked        = false;
2518             mVertexLoadFunction            = CopyNativeVertexData<GLubyte, 2, 2, 0>;
2519             mVertexLoadRequiresConversion  = false;
2520             break;
2521 
2522         case angle::FormatID::R8G8_UNORM_SRGB:
2523             mIntendedGLFormat              = GL_SRG8_EXT;
2524             mActualSampleOnlyImageFormatID = angle::FormatID::R8G8_UNORM_SRGB;
2525             mImageInitializerFunction      = nullptr;
2526             mActualBufferFormatID          = angle::FormatID::R8G8_UNORM_SRGB;
2527             mVkBufferFormatIsPacked        = false;
2528             mVertexLoadFunction            = CopyNativeVertexData<GLubyte, 2, 2, 0>;
2529             mVertexLoadRequiresConversion  = false;
2530             break;
2531 
2532         case angle::FormatID::R8G8_USCALED:
2533             mIntendedGLFormat              = GL_RG8_USCALED_ANGLEX;
2534             mActualSampleOnlyImageFormatID = angle::FormatID::R8G8_USCALED;
2535             mImageInitializerFunction      = nullptr;
2536             {
2537                 static constexpr BufferFormatInitInfo kInfo[] = {
2538                     {angle::FormatID::R8G8_USCALED, false, CopyNativeVertexData<GLubyte, 2, 2, 0>,
2539                      false},
2540                     {angle::FormatID::R8G8B8_USCALED, false, CopyNativeVertexData<GLubyte, 2, 3, 0>,
2541                      true},
2542                     {angle::FormatID::R16G16_FLOAT, false,
2543                      CopyToFloatVertexData<GLubyte, 2, 2, false, true>, true}};
2544                 initBufferFallback(renderer, kInfo, ArraySize(kInfo), 3);
2545             }
2546             break;
2547 
2548         case angle::FormatID::R8_SINT:
2549             mIntendedGLFormat              = GL_R8I;
2550             mActualSampleOnlyImageFormatID = angle::FormatID::R8_SINT;
2551             mImageInitializerFunction      = nullptr;
2552             mActualBufferFormatID          = angle::FormatID::R8_SINT;
2553             mVkBufferFormatIsPacked        = false;
2554             mVertexLoadFunction            = CopyNativeVertexData<GLbyte, 1, 1, 0>;
2555             mVertexLoadRequiresConversion  = false;
2556             break;
2557 
2558         case angle::FormatID::R8_SNORM:
2559             mIntendedGLFormat              = GL_R8_SNORM;
2560             mActualSampleOnlyImageFormatID = angle::FormatID::R8_SNORM;
2561             mImageInitializerFunction      = nullptr;
2562             mActualBufferFormatID          = angle::FormatID::R8_SNORM;
2563             mVkBufferFormatIsPacked        = false;
2564             mVertexLoadFunction            = CopyNativeVertexData<GLbyte, 1, 1, 0>;
2565             mVertexLoadRequiresConversion  = false;
2566             break;
2567 
2568         case angle::FormatID::R8_SSCALED:
2569             mIntendedGLFormat              = GL_R8_SSCALED_ANGLEX;
2570             mActualSampleOnlyImageFormatID = angle::FormatID::R8_SSCALED;
2571             mImageInitializerFunction      = nullptr;
2572             {
2573                 static constexpr BufferFormatInitInfo kInfo[] = {
2574                     {angle::FormatID::R8_SSCALED, false, CopyNativeVertexData<GLbyte, 1, 1, 0>,
2575                      false},
2576                     {angle::FormatID::R16_FLOAT, false,
2577                      CopyToFloatVertexData<GLbyte, 1, 1, false, true>, true}};
2578                 initBufferFallback(renderer, kInfo, ArraySize(kInfo), 2);
2579             }
2580             break;
2581 
2582         case angle::FormatID::R8_UINT:
2583             mIntendedGLFormat              = GL_R8UI;
2584             mActualSampleOnlyImageFormatID = angle::FormatID::R8_UINT;
2585             mImageInitializerFunction      = nullptr;
2586             mActualBufferFormatID          = angle::FormatID::R8_UINT;
2587             mVkBufferFormatIsPacked        = false;
2588             mVertexLoadFunction            = CopyNativeVertexData<GLubyte, 1, 1, 0>;
2589             mVertexLoadRequiresConversion  = false;
2590             break;
2591 
2592         case angle::FormatID::R8_UNORM:
2593             mIntendedGLFormat              = GL_R8;
2594             mActualSampleOnlyImageFormatID = angle::FormatID::R8_UNORM;
2595             mImageInitializerFunction      = nullptr;
2596             mActualBufferFormatID          = angle::FormatID::R8_UNORM;
2597             mVkBufferFormatIsPacked        = false;
2598             mVertexLoadFunction            = CopyNativeVertexData<GLubyte, 1, 1, 0>;
2599             mVertexLoadRequiresConversion  = false;
2600             break;
2601 
2602         case angle::FormatID::R8_UNORM_SRGB:
2603             mIntendedGLFormat              = GL_SR8_EXT;
2604             mActualSampleOnlyImageFormatID = angle::FormatID::R8_UNORM_SRGB;
2605             mImageInitializerFunction      = nullptr;
2606             mActualBufferFormatID          = angle::FormatID::R8_UNORM_SRGB;
2607             mVkBufferFormatIsPacked        = false;
2608             mVertexLoadFunction            = CopyNativeVertexData<GLubyte, 1, 1, 0>;
2609             mVertexLoadRequiresConversion  = false;
2610             break;
2611 
2612         case angle::FormatID::R8_USCALED:
2613             mIntendedGLFormat              = GL_R8_USCALED_ANGLEX;
2614             mActualSampleOnlyImageFormatID = angle::FormatID::R8_USCALED;
2615             mImageInitializerFunction      = nullptr;
2616             {
2617                 static constexpr BufferFormatInitInfo kInfo[] = {
2618                     {angle::FormatID::R8_USCALED, false, CopyNativeVertexData<GLubyte, 1, 1, 0>,
2619                      false},
2620                     {angle::FormatID::R16_FLOAT, false,
2621                      CopyToFloatVertexData<GLubyte, 1, 1, false, true>, true}};
2622                 initBufferFallback(renderer, kInfo, ArraySize(kInfo), 2);
2623             }
2624             break;
2625 
2626         case angle::FormatID::R9G9B9E5_SHAREDEXP:
2627             mIntendedGLFormat              = GL_RGB9_E5;
2628             mActualSampleOnlyImageFormatID = angle::FormatID::R9G9B9E5_SHAREDEXP;
2629             mImageInitializerFunction      = nullptr;
2630             mActualBufferFormatID          = angle::FormatID::R9G9B9E5_SHAREDEXP;
2631             mVkBufferFormatIsPacked        = true;
2632             mVertexLoadFunction            = CopyNativeVertexData<GLuint, 1, 1, 0>;
2633             mVertexLoadRequiresConversion  = false;
2634             break;
2635 
2636         case angle::FormatID::S8_UINT:
2637             mIntendedGLFormat = GL_STENCIL_INDEX8;
2638             {
2639                 static constexpr ImageFormatInitInfo kInfo[] = {
2640                     {angle::FormatID::S8_UINT, nullptr},
2641                     {angle::FormatID::D24_UNORM_S8_UINT, nullptr},
2642                     {angle::FormatID::D32_FLOAT_S8X24_UINT, nullptr}};
2643                 initImageFallback(renderer, kInfo, ArraySize(kInfo));
2644             }
2645             mActualBufferFormatID         = angle::FormatID::S8_UINT;
2646             mVkBufferFormatIsPacked       = false;
2647             mVertexLoadFunction           = nullptr;
2648             mVertexLoadRequiresConversion = false;
2649             break;
2650 
2651         case angle::FormatID::X2R10G10B10_SINT_VERTEX:
2652             mIntendedGLFormat              = GL_X2_RGB10_SINT_ANGLEX;
2653             mActualSampleOnlyImageFormatID = angle::FormatID::NONE;
2654             mImageInitializerFunction      = nullptr;
2655             mActualBufferFormatID          = angle::FormatID::R16G16B16A16_FLOAT;
2656             mVkBufferFormatIsPacked        = false;
2657             mVertexLoadFunction            = CopyXYZ10ToXYZWFloatVertexData<true, false, true>;
2658             mVertexLoadRequiresConversion  = true;
2659             break;
2660 
2661         case angle::FormatID::X2R10G10B10_SNORM_VERTEX:
2662             mIntendedGLFormat              = GL_X2_RGB10_SNORM_ANGLEX;
2663             mActualSampleOnlyImageFormatID = angle::FormatID::NONE;
2664             mImageInitializerFunction      = nullptr;
2665             mActualBufferFormatID          = angle::FormatID::R16G16B16A16_FLOAT;
2666             mVkBufferFormatIsPacked        = false;
2667             mVertexLoadFunction            = CopyXYZ10ToXYZWFloatVertexData<true, true, true>;
2668             mVertexLoadRequiresConversion  = true;
2669             break;
2670 
2671         case angle::FormatID::X2R10G10B10_SSCALED_VERTEX:
2672             mIntendedGLFormat              = GL_X2_RGB10_SSCALED_ANGLEX;
2673             mActualSampleOnlyImageFormatID = angle::FormatID::NONE;
2674             mImageInitializerFunction      = nullptr;
2675             mActualBufferFormatID          = angle::FormatID::R16G16B16A16_FLOAT;
2676             mVkBufferFormatIsPacked        = false;
2677             mVertexLoadFunction            = CopyXYZ10ToXYZWFloatVertexData<true, false, true>;
2678             mVertexLoadRequiresConversion  = true;
2679             break;
2680 
2681         case angle::FormatID::X2R10G10B10_UINT_VERTEX:
2682             mIntendedGLFormat              = GL_X2_RGB10_UINT_ANGLEX;
2683             mActualSampleOnlyImageFormatID = angle::FormatID::NONE;
2684             mImageInitializerFunction      = nullptr;
2685             mActualBufferFormatID          = angle::FormatID::R16G16B16A16_FLOAT;
2686             mVkBufferFormatIsPacked        = false;
2687             mVertexLoadFunction            = CopyXYZ10ToXYZWFloatVertexData<false, false, true>;
2688             mVertexLoadRequiresConversion  = true;
2689             break;
2690 
2691         case angle::FormatID::X2R10G10B10_UNORM_VERTEX:
2692             mIntendedGLFormat              = GL_X2_RGB10_UNORM_ANGLEX;
2693             mActualSampleOnlyImageFormatID = angle::FormatID::NONE;
2694             mImageInitializerFunction      = nullptr;
2695             mActualBufferFormatID          = angle::FormatID::R16G16B16A16_FLOAT;
2696             mVkBufferFormatIsPacked        = false;
2697             mVertexLoadFunction            = CopyXYZ10ToXYZWFloatVertexData<false, true, true>;
2698             mVertexLoadRequiresConversion  = true;
2699             break;
2700 
2701         case angle::FormatID::X2R10G10B10_USCALED_VERTEX:
2702             mIntendedGLFormat              = GL_X2_RGB10_USCALED_ANGLEX;
2703             mActualSampleOnlyImageFormatID = angle::FormatID::NONE;
2704             mImageInitializerFunction      = nullptr;
2705             mActualBufferFormatID          = angle::FormatID::R16G16B16A16_FLOAT;
2706             mVkBufferFormatIsPacked        = false;
2707             mVertexLoadFunction            = CopyXYZ10ToXYZWFloatVertexData<false, false, true>;
2708             mVertexLoadRequiresConversion  = true;
2709             break;
2710 
2711         default:
2712             UNREACHABLE();
2713             break;
2714     }
2715 }
2716 
GetVkFormatFromFormatID(const Renderer * renderer,angle::FormatID formatID)2717 VkFormat GetVkFormatFromFormatID(const Renderer *renderer, angle::FormatID formatID)
2718 {
2719     static constexpr angle::FormatMap<VkFormat> kMap = {
2720         {angle::FormatID::A1R5G5B5_UNORM, VK_FORMAT_A1R5G5B5_UNORM_PACK16},
2721         {angle::FormatID::ASTC_10x10_SRGB_BLOCK, VK_FORMAT_ASTC_10x10_SRGB_BLOCK},
2722         {angle::FormatID::ASTC_10x10_UNORM_BLOCK, VK_FORMAT_ASTC_10x10_UNORM_BLOCK},
2723         {angle::FormatID::ASTC_10x5_SRGB_BLOCK, VK_FORMAT_ASTC_10x5_SRGB_BLOCK},
2724         {angle::FormatID::ASTC_10x5_UNORM_BLOCK, VK_FORMAT_ASTC_10x5_UNORM_BLOCK},
2725         {angle::FormatID::ASTC_10x6_SRGB_BLOCK, VK_FORMAT_ASTC_10x6_SRGB_BLOCK},
2726         {angle::FormatID::ASTC_10x6_UNORM_BLOCK, VK_FORMAT_ASTC_10x6_UNORM_BLOCK},
2727         {angle::FormatID::ASTC_10x8_SRGB_BLOCK, VK_FORMAT_ASTC_10x8_SRGB_BLOCK},
2728         {angle::FormatID::ASTC_10x8_UNORM_BLOCK, VK_FORMAT_ASTC_10x8_UNORM_BLOCK},
2729         {angle::FormatID::ASTC_12x10_SRGB_BLOCK, VK_FORMAT_ASTC_12x10_SRGB_BLOCK},
2730         {angle::FormatID::ASTC_12x10_UNORM_BLOCK, VK_FORMAT_ASTC_12x10_UNORM_BLOCK},
2731         {angle::FormatID::ASTC_12x12_SRGB_BLOCK, VK_FORMAT_ASTC_12x12_SRGB_BLOCK},
2732         {angle::FormatID::ASTC_12x12_UNORM_BLOCK, VK_FORMAT_ASTC_12x12_UNORM_BLOCK},
2733         {angle::FormatID::ASTC_4x4_SRGB_BLOCK, VK_FORMAT_ASTC_4x4_SRGB_BLOCK},
2734         {angle::FormatID::ASTC_4x4_UNORM_BLOCK, VK_FORMAT_ASTC_4x4_UNORM_BLOCK},
2735         {angle::FormatID::ASTC_5x4_SRGB_BLOCK, VK_FORMAT_ASTC_5x4_SRGB_BLOCK},
2736         {angle::FormatID::ASTC_5x4_UNORM_BLOCK, VK_FORMAT_ASTC_5x4_UNORM_BLOCK},
2737         {angle::FormatID::ASTC_5x5_SRGB_BLOCK, VK_FORMAT_ASTC_5x5_SRGB_BLOCK},
2738         {angle::FormatID::ASTC_5x5_UNORM_BLOCK, VK_FORMAT_ASTC_5x5_UNORM_BLOCK},
2739         {angle::FormatID::ASTC_6x5_SRGB_BLOCK, VK_FORMAT_ASTC_6x5_SRGB_BLOCK},
2740         {angle::FormatID::ASTC_6x5_UNORM_BLOCK, VK_FORMAT_ASTC_6x5_UNORM_BLOCK},
2741         {angle::FormatID::ASTC_6x6_SRGB_BLOCK, VK_FORMAT_ASTC_6x6_SRGB_BLOCK},
2742         {angle::FormatID::ASTC_6x6_UNORM_BLOCK, VK_FORMAT_ASTC_6x6_UNORM_BLOCK},
2743         {angle::FormatID::ASTC_8x5_SRGB_BLOCK, VK_FORMAT_ASTC_8x5_SRGB_BLOCK},
2744         {angle::FormatID::ASTC_8x5_UNORM_BLOCK, VK_FORMAT_ASTC_8x5_UNORM_BLOCK},
2745         {angle::FormatID::ASTC_8x6_SRGB_BLOCK, VK_FORMAT_ASTC_8x6_SRGB_BLOCK},
2746         {angle::FormatID::ASTC_8x6_UNORM_BLOCK, VK_FORMAT_ASTC_8x6_UNORM_BLOCK},
2747         {angle::FormatID::ASTC_8x8_SRGB_BLOCK, VK_FORMAT_ASTC_8x8_SRGB_BLOCK},
2748         {angle::FormatID::ASTC_8x8_UNORM_BLOCK, VK_FORMAT_ASTC_8x8_UNORM_BLOCK},
2749         {angle::FormatID::B10G10R10A2_UNORM, VK_FORMAT_A2R10G10B10_UNORM_PACK32},
2750         {angle::FormatID::B4G4R4A4_UNORM, VK_FORMAT_B4G4R4A4_UNORM_PACK16},
2751         {angle::FormatID::B5G5R5A1_UNORM, VK_FORMAT_B5G5R5A1_UNORM_PACK16},
2752         {angle::FormatID::B5G6R5_UNORM, VK_FORMAT_B5G6R5_UNORM_PACK16},
2753         {angle::FormatID::B8G8R8A8_UNORM, VK_FORMAT_B8G8R8A8_UNORM},
2754         {angle::FormatID::B8G8R8A8_UNORM_SRGB, VK_FORMAT_B8G8R8A8_SRGB},
2755         {angle::FormatID::BC1_RGBA_UNORM_BLOCK, VK_FORMAT_BC1_RGBA_UNORM_BLOCK},
2756         {angle::FormatID::BC1_RGBA_UNORM_SRGB_BLOCK, VK_FORMAT_BC1_RGBA_SRGB_BLOCK},
2757         {angle::FormatID::BC1_RGB_UNORM_BLOCK, VK_FORMAT_BC1_RGB_UNORM_BLOCK},
2758         {angle::FormatID::BC1_RGB_UNORM_SRGB_BLOCK, VK_FORMAT_BC1_RGB_SRGB_BLOCK},
2759         {angle::FormatID::BC2_RGBA_UNORM_BLOCK, VK_FORMAT_BC2_UNORM_BLOCK},
2760         {angle::FormatID::BC2_RGBA_UNORM_SRGB_BLOCK, VK_FORMAT_BC2_SRGB_BLOCK},
2761         {angle::FormatID::BC3_RGBA_UNORM_BLOCK, VK_FORMAT_BC3_UNORM_BLOCK},
2762         {angle::FormatID::BC3_RGBA_UNORM_SRGB_BLOCK, VK_FORMAT_BC3_SRGB_BLOCK},
2763         {angle::FormatID::BC4_RED_SNORM_BLOCK, VK_FORMAT_BC4_SNORM_BLOCK},
2764         {angle::FormatID::BC4_RED_UNORM_BLOCK, VK_FORMAT_BC4_UNORM_BLOCK},
2765         {angle::FormatID::BC5_RG_SNORM_BLOCK, VK_FORMAT_BC5_SNORM_BLOCK},
2766         {angle::FormatID::BC5_RG_UNORM_BLOCK, VK_FORMAT_BC5_UNORM_BLOCK},
2767         {angle::FormatID::BC6H_RGB_SFLOAT_BLOCK, VK_FORMAT_BC6H_SFLOAT_BLOCK},
2768         {angle::FormatID::BC6H_RGB_UFLOAT_BLOCK, VK_FORMAT_BC6H_UFLOAT_BLOCK},
2769         {angle::FormatID::BC7_RGBA_UNORM_BLOCK, VK_FORMAT_BC7_UNORM_BLOCK},
2770         {angle::FormatID::BC7_RGBA_UNORM_SRGB_BLOCK, VK_FORMAT_BC7_SRGB_BLOCK},
2771         {angle::FormatID::D16_UNORM, VK_FORMAT_D16_UNORM},
2772         {angle::FormatID::D24_UNORM_S8_UINT, VK_FORMAT_D24_UNORM_S8_UINT},
2773         {angle::FormatID::D24_UNORM_X8_UINT, VK_FORMAT_X8_D24_UNORM_PACK32},
2774         {angle::FormatID::D32_FLOAT, VK_FORMAT_D32_SFLOAT},
2775         {angle::FormatID::D32_FLOAT_S8X24_UINT, VK_FORMAT_D32_SFLOAT_S8_UINT},
2776         {angle::FormatID::EAC_R11G11_SNORM_BLOCK, VK_FORMAT_EAC_R11G11_SNORM_BLOCK},
2777         {angle::FormatID::EAC_R11G11_UNORM_BLOCK, VK_FORMAT_EAC_R11G11_UNORM_BLOCK},
2778         {angle::FormatID::EAC_R11_SNORM_BLOCK, VK_FORMAT_EAC_R11_SNORM_BLOCK},
2779         {angle::FormatID::EAC_R11_UNORM_BLOCK, VK_FORMAT_EAC_R11_UNORM_BLOCK},
2780         {angle::FormatID::ETC2_R8G8B8A1_SRGB_BLOCK, VK_FORMAT_ETC2_R8G8B8A1_SRGB_BLOCK},
2781         {angle::FormatID::ETC2_R8G8B8A1_UNORM_BLOCK, VK_FORMAT_ETC2_R8G8B8A1_UNORM_BLOCK},
2782         {angle::FormatID::ETC2_R8G8B8A8_SRGB_BLOCK, VK_FORMAT_ETC2_R8G8B8A8_SRGB_BLOCK},
2783         {angle::FormatID::ETC2_R8G8B8A8_UNORM_BLOCK, VK_FORMAT_ETC2_R8G8B8A8_UNORM_BLOCK},
2784         {angle::FormatID::ETC2_R8G8B8_SRGB_BLOCK, VK_FORMAT_ETC2_R8G8B8_SRGB_BLOCK},
2785         {angle::FormatID::ETC2_R8G8B8_UNORM_BLOCK, VK_FORMAT_ETC2_R8G8B8_UNORM_BLOCK},
2786         {angle::FormatID::EXTERNAL0, VK_FORMAT_UNDEFINED},
2787         {angle::FormatID::EXTERNAL1, VK_FORMAT_UNDEFINED},
2788         {angle::FormatID::EXTERNAL2, VK_FORMAT_UNDEFINED},
2789         {angle::FormatID::EXTERNAL3, VK_FORMAT_UNDEFINED},
2790         {angle::FormatID::EXTERNAL4, VK_FORMAT_UNDEFINED},
2791         {angle::FormatID::EXTERNAL5, VK_FORMAT_UNDEFINED},
2792         {angle::FormatID::EXTERNAL6, VK_FORMAT_UNDEFINED},
2793         {angle::FormatID::EXTERNAL7, VK_FORMAT_UNDEFINED},
2794         {angle::FormatID::G8_B8R8_2PLANE_420_UNORM, VK_FORMAT_G8_B8R8_2PLANE_420_UNORM},
2795         {angle::FormatID::G8_B8_R8_3PLANE_420_UNORM, VK_FORMAT_G8_B8_R8_3PLANE_420_UNORM},
2796         {angle::FormatID::NONE, VK_FORMAT_UNDEFINED},
2797         {angle::FormatID::R10G10B10A2_SINT, VK_FORMAT_A2B10G10R10_SINT_PACK32},
2798         {angle::FormatID::R10G10B10A2_SNORM, VK_FORMAT_A2B10G10R10_SNORM_PACK32},
2799         {angle::FormatID::R10G10B10A2_SSCALED, VK_FORMAT_A2B10G10R10_SSCALED_PACK32},
2800         {angle::FormatID::R10G10B10A2_UINT, VK_FORMAT_A2B10G10R10_UINT_PACK32},
2801         {angle::FormatID::R10G10B10A2_UNORM, VK_FORMAT_A2B10G10R10_UNORM_PACK32},
2802         {angle::FormatID::R10G10B10A2_USCALED, VK_FORMAT_A2B10G10R10_USCALED_PACK32},
2803         {angle::FormatID::R11G11B10_FLOAT, VK_FORMAT_B10G11R11_UFLOAT_PACK32},
2804         {angle::FormatID::R16G16B16A16_FLOAT, VK_FORMAT_R16G16B16A16_SFLOAT},
2805         {angle::FormatID::R16G16B16A16_SINT, VK_FORMAT_R16G16B16A16_SINT},
2806         {angle::FormatID::R16G16B16A16_SNORM, VK_FORMAT_R16G16B16A16_SNORM},
2807         {angle::FormatID::R16G16B16A16_SSCALED, VK_FORMAT_R16G16B16A16_SSCALED},
2808         {angle::FormatID::R16G16B16A16_UINT, VK_FORMAT_R16G16B16A16_UINT},
2809         {angle::FormatID::R16G16B16A16_UNORM, VK_FORMAT_R16G16B16A16_UNORM},
2810         {angle::FormatID::R16G16B16A16_USCALED, VK_FORMAT_R16G16B16A16_USCALED},
2811         {angle::FormatID::R16G16B16_FLOAT, VK_FORMAT_R16G16B16_SFLOAT},
2812         {angle::FormatID::R16G16B16_SINT, VK_FORMAT_R16G16B16_SINT},
2813         {angle::FormatID::R16G16B16_SNORM, VK_FORMAT_R16G16B16_SNORM},
2814         {angle::FormatID::R16G16B16_SSCALED, VK_FORMAT_R16G16B16_SSCALED},
2815         {angle::FormatID::R16G16B16_UINT, VK_FORMAT_R16G16B16_UINT},
2816         {angle::FormatID::R16G16B16_UNORM, VK_FORMAT_R16G16B16_UNORM},
2817         {angle::FormatID::R16G16B16_USCALED, VK_FORMAT_R16G16B16_USCALED},
2818         {angle::FormatID::R16G16_FLOAT, VK_FORMAT_R16G16_SFLOAT},
2819         {angle::FormatID::R16G16_SINT, VK_FORMAT_R16G16_SINT},
2820         {angle::FormatID::R16G16_SNORM, VK_FORMAT_R16G16_SNORM},
2821         {angle::FormatID::R16G16_SSCALED, VK_FORMAT_R16G16_SSCALED},
2822         {angle::FormatID::R16G16_UINT, VK_FORMAT_R16G16_UINT},
2823         {angle::FormatID::R16G16_UNORM, VK_FORMAT_R16G16_UNORM},
2824         {angle::FormatID::R16G16_USCALED, VK_FORMAT_R16G16_USCALED},
2825         {angle::FormatID::R16_FLOAT, VK_FORMAT_R16_SFLOAT},
2826         {angle::FormatID::R16_SINT, VK_FORMAT_R16_SINT},
2827         {angle::FormatID::R16_SNORM, VK_FORMAT_R16_SNORM},
2828         {angle::FormatID::R16_SSCALED, VK_FORMAT_R16_SSCALED},
2829         {angle::FormatID::R16_UINT, VK_FORMAT_R16_UINT},
2830         {angle::FormatID::R16_UNORM, VK_FORMAT_R16_UNORM},
2831         {angle::FormatID::R16_USCALED, VK_FORMAT_R16_USCALED},
2832         {angle::FormatID::R32G32B32A32_FLOAT, VK_FORMAT_R32G32B32A32_SFLOAT},
2833         {angle::FormatID::R32G32B32A32_SINT, VK_FORMAT_R32G32B32A32_SINT},
2834         {angle::FormatID::R32G32B32A32_UINT, VK_FORMAT_R32G32B32A32_UINT},
2835         {angle::FormatID::R32G32B32_FLOAT, VK_FORMAT_R32G32B32_SFLOAT},
2836         {angle::FormatID::R32G32B32_SINT, VK_FORMAT_R32G32B32_SINT},
2837         {angle::FormatID::R32G32B32_UINT, VK_FORMAT_R32G32B32_UINT},
2838         {angle::FormatID::R32G32_FLOAT, VK_FORMAT_R32G32_SFLOAT},
2839         {angle::FormatID::R32G32_SINT, VK_FORMAT_R32G32_SINT},
2840         {angle::FormatID::R32G32_UINT, VK_FORMAT_R32G32_UINT},
2841         {angle::FormatID::R32_FLOAT, VK_FORMAT_R32_SFLOAT},
2842         {angle::FormatID::R32_SINT, VK_FORMAT_R32_SINT},
2843         {angle::FormatID::R32_UINT, VK_FORMAT_R32_UINT},
2844         {angle::FormatID::R4G4B4A4_UNORM, VK_FORMAT_R4G4B4A4_UNORM_PACK16},
2845         {angle::FormatID::R5G5B5A1_UNORM, VK_FORMAT_R5G5B5A1_UNORM_PACK16},
2846         {angle::FormatID::R5G6B5_UNORM, VK_FORMAT_R5G6B5_UNORM_PACK16},
2847         {angle::FormatID::R8G8B8A8_SINT, VK_FORMAT_R8G8B8A8_SINT},
2848         {angle::FormatID::R8G8B8A8_SNORM, VK_FORMAT_R8G8B8A8_SNORM},
2849         {angle::FormatID::R8G8B8A8_SSCALED, VK_FORMAT_R8G8B8A8_SSCALED},
2850         {angle::FormatID::R8G8B8A8_UINT, VK_FORMAT_R8G8B8A8_UINT},
2851         {angle::FormatID::R8G8B8A8_UNORM, VK_FORMAT_R8G8B8A8_UNORM},
2852         {angle::FormatID::R8G8B8A8_UNORM_SRGB, VK_FORMAT_R8G8B8A8_SRGB},
2853         {angle::FormatID::R8G8B8A8_USCALED, VK_FORMAT_R8G8B8A8_USCALED},
2854         {angle::FormatID::R8G8B8_SINT, VK_FORMAT_R8G8B8_SINT},
2855         {angle::FormatID::R8G8B8_SNORM, VK_FORMAT_R8G8B8_SNORM},
2856         {angle::FormatID::R8G8B8_SSCALED, VK_FORMAT_R8G8B8_SSCALED},
2857         {angle::FormatID::R8G8B8_UINT, VK_FORMAT_R8G8B8_UINT},
2858         {angle::FormatID::R8G8B8_UNORM, VK_FORMAT_R8G8B8_UNORM},
2859         {angle::FormatID::R8G8B8_UNORM_SRGB, VK_FORMAT_R8G8B8_SRGB},
2860         {angle::FormatID::R8G8B8_USCALED, VK_FORMAT_R8G8B8_USCALED},
2861         {angle::FormatID::R8G8_SINT, VK_FORMAT_R8G8_SINT},
2862         {angle::FormatID::R8G8_SNORM, VK_FORMAT_R8G8_SNORM},
2863         {angle::FormatID::R8G8_SSCALED, VK_FORMAT_R8G8_SSCALED},
2864         {angle::FormatID::R8G8_UINT, VK_FORMAT_R8G8_UINT},
2865         {angle::FormatID::R8G8_UNORM, VK_FORMAT_R8G8_UNORM},
2866         {angle::FormatID::R8G8_UNORM_SRGB, VK_FORMAT_R8G8_SRGB},
2867         {angle::FormatID::R8G8_USCALED, VK_FORMAT_R8G8_USCALED},
2868         {angle::FormatID::R8_SINT, VK_FORMAT_R8_SINT},
2869         {angle::FormatID::R8_SNORM, VK_FORMAT_R8_SNORM},
2870         {angle::FormatID::R8_SSCALED, VK_FORMAT_R8_SSCALED},
2871         {angle::FormatID::R8_UINT, VK_FORMAT_R8_UINT},
2872         {angle::FormatID::R8_UNORM, VK_FORMAT_R8_UNORM},
2873         {angle::FormatID::R8_UNORM_SRGB, VK_FORMAT_R8_SRGB},
2874         {angle::FormatID::R8_USCALED, VK_FORMAT_R8_USCALED},
2875         {angle::FormatID::R9G9B9E5_SHAREDEXP, VK_FORMAT_E5B9G9R9_UFLOAT_PACK32},
2876         {angle::FormatID::S8_UINT, VK_FORMAT_S8_UINT}};
2877 
2878     return AdjustASTCFormatForHDR(renderer, kMap[formatID]);
2879 }
2880 
GetFormatIDFromVkFormat(VkFormat vkFormat)2881 angle::FormatID GetFormatIDFromVkFormat(VkFormat vkFormat)
2882 {
2883     switch (vkFormat)
2884     {
2885         case VK_FORMAT_A1R5G5B5_UNORM_PACK16:
2886             return angle::FormatID::A1R5G5B5_UNORM;
2887         case VK_FORMAT_ASTC_10x10_SRGB_BLOCK:
2888             return angle::FormatID::ASTC_10x10_SRGB_BLOCK;
2889         case VK_FORMAT_ASTC_10x10_UNORM_BLOCK:
2890             return angle::FormatID::ASTC_10x10_UNORM_BLOCK;
2891         case VK_FORMAT_ASTC_10x5_SRGB_BLOCK:
2892             return angle::FormatID::ASTC_10x5_SRGB_BLOCK;
2893         case VK_FORMAT_ASTC_10x5_UNORM_BLOCK:
2894             return angle::FormatID::ASTC_10x5_UNORM_BLOCK;
2895         case VK_FORMAT_ASTC_10x6_SRGB_BLOCK:
2896             return angle::FormatID::ASTC_10x6_SRGB_BLOCK;
2897         case VK_FORMAT_ASTC_10x6_UNORM_BLOCK:
2898             return angle::FormatID::ASTC_10x6_UNORM_BLOCK;
2899         case VK_FORMAT_ASTC_10x8_SRGB_BLOCK:
2900             return angle::FormatID::ASTC_10x8_SRGB_BLOCK;
2901         case VK_FORMAT_ASTC_10x8_UNORM_BLOCK:
2902             return angle::FormatID::ASTC_10x8_UNORM_BLOCK;
2903         case VK_FORMAT_ASTC_12x10_SRGB_BLOCK:
2904             return angle::FormatID::ASTC_12x10_SRGB_BLOCK;
2905         case VK_FORMAT_ASTC_12x10_UNORM_BLOCK:
2906             return angle::FormatID::ASTC_12x10_UNORM_BLOCK;
2907         case VK_FORMAT_ASTC_12x12_SRGB_BLOCK:
2908             return angle::FormatID::ASTC_12x12_SRGB_BLOCK;
2909         case VK_FORMAT_ASTC_12x12_UNORM_BLOCK:
2910             return angle::FormatID::ASTC_12x12_UNORM_BLOCK;
2911         case VK_FORMAT_ASTC_4x4_SRGB_BLOCK:
2912             return angle::FormatID::ASTC_4x4_SRGB_BLOCK;
2913         case VK_FORMAT_ASTC_4x4_UNORM_BLOCK:
2914             return angle::FormatID::ASTC_4x4_UNORM_BLOCK;
2915         case VK_FORMAT_ASTC_5x4_SRGB_BLOCK:
2916             return angle::FormatID::ASTC_5x4_SRGB_BLOCK;
2917         case VK_FORMAT_ASTC_5x4_UNORM_BLOCK:
2918             return angle::FormatID::ASTC_5x4_UNORM_BLOCK;
2919         case VK_FORMAT_ASTC_5x5_SRGB_BLOCK:
2920             return angle::FormatID::ASTC_5x5_SRGB_BLOCK;
2921         case VK_FORMAT_ASTC_5x5_UNORM_BLOCK:
2922             return angle::FormatID::ASTC_5x5_UNORM_BLOCK;
2923         case VK_FORMAT_ASTC_6x5_SRGB_BLOCK:
2924             return angle::FormatID::ASTC_6x5_SRGB_BLOCK;
2925         case VK_FORMAT_ASTC_6x5_UNORM_BLOCK:
2926             return angle::FormatID::ASTC_6x5_UNORM_BLOCK;
2927         case VK_FORMAT_ASTC_6x6_SRGB_BLOCK:
2928             return angle::FormatID::ASTC_6x6_SRGB_BLOCK;
2929         case VK_FORMAT_ASTC_6x6_UNORM_BLOCK:
2930             return angle::FormatID::ASTC_6x6_UNORM_BLOCK;
2931         case VK_FORMAT_ASTC_8x5_SRGB_BLOCK:
2932             return angle::FormatID::ASTC_8x5_SRGB_BLOCK;
2933         case VK_FORMAT_ASTC_8x5_UNORM_BLOCK:
2934             return angle::FormatID::ASTC_8x5_UNORM_BLOCK;
2935         case VK_FORMAT_ASTC_8x6_SRGB_BLOCK:
2936             return angle::FormatID::ASTC_8x6_SRGB_BLOCK;
2937         case VK_FORMAT_ASTC_8x6_UNORM_BLOCK:
2938             return angle::FormatID::ASTC_8x6_UNORM_BLOCK;
2939         case VK_FORMAT_ASTC_8x8_SRGB_BLOCK:
2940             return angle::FormatID::ASTC_8x8_SRGB_BLOCK;
2941         case VK_FORMAT_ASTC_8x8_UNORM_BLOCK:
2942             return angle::FormatID::ASTC_8x8_UNORM_BLOCK;
2943         case VK_FORMAT_A2R10G10B10_UNORM_PACK32:
2944             return angle::FormatID::B10G10R10A2_UNORM;
2945         case VK_FORMAT_B4G4R4A4_UNORM_PACK16:
2946             return angle::FormatID::B4G4R4A4_UNORM;
2947         case VK_FORMAT_B5G5R5A1_UNORM_PACK16:
2948             return angle::FormatID::B5G5R5A1_UNORM;
2949         case VK_FORMAT_B5G6R5_UNORM_PACK16:
2950             return angle::FormatID::B5G6R5_UNORM;
2951         case VK_FORMAT_B8G8R8A8_UNORM:
2952             return angle::FormatID::B8G8R8A8_UNORM;
2953         case VK_FORMAT_B8G8R8A8_SRGB:
2954             return angle::FormatID::B8G8R8A8_UNORM_SRGB;
2955         case VK_FORMAT_BC1_RGBA_UNORM_BLOCK:
2956             return angle::FormatID::BC1_RGBA_UNORM_BLOCK;
2957         case VK_FORMAT_BC1_RGBA_SRGB_BLOCK:
2958             return angle::FormatID::BC1_RGBA_UNORM_SRGB_BLOCK;
2959         case VK_FORMAT_BC1_RGB_UNORM_BLOCK:
2960             return angle::FormatID::BC1_RGB_UNORM_BLOCK;
2961         case VK_FORMAT_BC1_RGB_SRGB_BLOCK:
2962             return angle::FormatID::BC1_RGB_UNORM_SRGB_BLOCK;
2963         case VK_FORMAT_BC2_UNORM_BLOCK:
2964             return angle::FormatID::BC2_RGBA_UNORM_BLOCK;
2965         case VK_FORMAT_BC2_SRGB_BLOCK:
2966             return angle::FormatID::BC2_RGBA_UNORM_SRGB_BLOCK;
2967         case VK_FORMAT_BC3_UNORM_BLOCK:
2968             return angle::FormatID::BC3_RGBA_UNORM_BLOCK;
2969         case VK_FORMAT_BC3_SRGB_BLOCK:
2970             return angle::FormatID::BC3_RGBA_UNORM_SRGB_BLOCK;
2971         case VK_FORMAT_BC4_SNORM_BLOCK:
2972             return angle::FormatID::BC4_RED_SNORM_BLOCK;
2973         case VK_FORMAT_BC4_UNORM_BLOCK:
2974             return angle::FormatID::BC4_RED_UNORM_BLOCK;
2975         case VK_FORMAT_BC5_SNORM_BLOCK:
2976             return angle::FormatID::BC5_RG_SNORM_BLOCK;
2977         case VK_FORMAT_BC5_UNORM_BLOCK:
2978             return angle::FormatID::BC5_RG_UNORM_BLOCK;
2979         case VK_FORMAT_BC6H_SFLOAT_BLOCK:
2980             return angle::FormatID::BC6H_RGB_SFLOAT_BLOCK;
2981         case VK_FORMAT_BC6H_UFLOAT_BLOCK:
2982             return angle::FormatID::BC6H_RGB_UFLOAT_BLOCK;
2983         case VK_FORMAT_BC7_UNORM_BLOCK:
2984             return angle::FormatID::BC7_RGBA_UNORM_BLOCK;
2985         case VK_FORMAT_BC7_SRGB_BLOCK:
2986             return angle::FormatID::BC7_RGBA_UNORM_SRGB_BLOCK;
2987         case VK_FORMAT_D16_UNORM:
2988             return angle::FormatID::D16_UNORM;
2989         case VK_FORMAT_D24_UNORM_S8_UINT:
2990             return angle::FormatID::D24_UNORM_S8_UINT;
2991         case VK_FORMAT_X8_D24_UNORM_PACK32:
2992             return angle::FormatID::D24_UNORM_X8_UINT;
2993         case VK_FORMAT_D32_SFLOAT:
2994             return angle::FormatID::D32_FLOAT;
2995         case VK_FORMAT_D32_SFLOAT_S8_UINT:
2996             return angle::FormatID::D32_FLOAT_S8X24_UINT;
2997         case VK_FORMAT_EAC_R11G11_SNORM_BLOCK:
2998             return angle::FormatID::EAC_R11G11_SNORM_BLOCK;
2999         case VK_FORMAT_EAC_R11G11_UNORM_BLOCK:
3000             return angle::FormatID::EAC_R11G11_UNORM_BLOCK;
3001         case VK_FORMAT_EAC_R11_SNORM_BLOCK:
3002             return angle::FormatID::EAC_R11_SNORM_BLOCK;
3003         case VK_FORMAT_EAC_R11_UNORM_BLOCK:
3004             return angle::FormatID::EAC_R11_UNORM_BLOCK;
3005         case VK_FORMAT_ETC2_R8G8B8A1_SRGB_BLOCK:
3006             return angle::FormatID::ETC2_R8G8B8A1_SRGB_BLOCK;
3007         case VK_FORMAT_ETC2_R8G8B8A1_UNORM_BLOCK:
3008             return angle::FormatID::ETC2_R8G8B8A1_UNORM_BLOCK;
3009         case VK_FORMAT_ETC2_R8G8B8A8_SRGB_BLOCK:
3010             return angle::FormatID::ETC2_R8G8B8A8_SRGB_BLOCK;
3011         case VK_FORMAT_ETC2_R8G8B8A8_UNORM_BLOCK:
3012             return angle::FormatID::ETC2_R8G8B8A8_UNORM_BLOCK;
3013         case VK_FORMAT_ETC2_R8G8B8_SRGB_BLOCK:
3014             return angle::FormatID::ETC2_R8G8B8_SRGB_BLOCK;
3015         case VK_FORMAT_ETC2_R8G8B8_UNORM_BLOCK:
3016             return angle::FormatID::ETC2_R8G8B8_UNORM_BLOCK;
3017         case VK_FORMAT_G8_B8R8_2PLANE_420_UNORM:
3018             return angle::FormatID::G8_B8R8_2PLANE_420_UNORM;
3019         case VK_FORMAT_G8_B8_R8_3PLANE_420_UNORM:
3020             return angle::FormatID::G8_B8_R8_3PLANE_420_UNORM;
3021         case VK_FORMAT_UNDEFINED:
3022             return angle::FormatID::NONE;
3023         case VK_FORMAT_A2B10G10R10_SINT_PACK32:
3024             return angle::FormatID::R10G10B10A2_SINT;
3025         case VK_FORMAT_A2B10G10R10_SNORM_PACK32:
3026             return angle::FormatID::R10G10B10A2_SNORM;
3027         case VK_FORMAT_A2B10G10R10_SSCALED_PACK32:
3028             return angle::FormatID::R10G10B10A2_SSCALED;
3029         case VK_FORMAT_A2B10G10R10_UINT_PACK32:
3030             return angle::FormatID::R10G10B10A2_UINT;
3031         case VK_FORMAT_A2B10G10R10_UNORM_PACK32:
3032             return angle::FormatID::R10G10B10A2_UNORM;
3033         case VK_FORMAT_A2B10G10R10_USCALED_PACK32:
3034             return angle::FormatID::R10G10B10A2_USCALED;
3035         case VK_FORMAT_B10G11R11_UFLOAT_PACK32:
3036             return angle::FormatID::R11G11B10_FLOAT;
3037         case VK_FORMAT_R16G16B16A16_SFLOAT:
3038             return angle::FormatID::R16G16B16A16_FLOAT;
3039         case VK_FORMAT_R16G16B16A16_SINT:
3040             return angle::FormatID::R16G16B16A16_SINT;
3041         case VK_FORMAT_R16G16B16A16_SNORM:
3042             return angle::FormatID::R16G16B16A16_SNORM;
3043         case VK_FORMAT_R16G16B16A16_SSCALED:
3044             return angle::FormatID::R16G16B16A16_SSCALED;
3045         case VK_FORMAT_R16G16B16A16_UINT:
3046             return angle::FormatID::R16G16B16A16_UINT;
3047         case VK_FORMAT_R16G16B16A16_UNORM:
3048             return angle::FormatID::R16G16B16A16_UNORM;
3049         case VK_FORMAT_R16G16B16A16_USCALED:
3050             return angle::FormatID::R16G16B16A16_USCALED;
3051         case VK_FORMAT_R16G16B16_SFLOAT:
3052             return angle::FormatID::R16G16B16_FLOAT;
3053         case VK_FORMAT_R16G16B16_SINT:
3054             return angle::FormatID::R16G16B16_SINT;
3055         case VK_FORMAT_R16G16B16_SNORM:
3056             return angle::FormatID::R16G16B16_SNORM;
3057         case VK_FORMAT_R16G16B16_SSCALED:
3058             return angle::FormatID::R16G16B16_SSCALED;
3059         case VK_FORMAT_R16G16B16_UINT:
3060             return angle::FormatID::R16G16B16_UINT;
3061         case VK_FORMAT_R16G16B16_UNORM:
3062             return angle::FormatID::R16G16B16_UNORM;
3063         case VK_FORMAT_R16G16B16_USCALED:
3064             return angle::FormatID::R16G16B16_USCALED;
3065         case VK_FORMAT_R16G16_SFLOAT:
3066             return angle::FormatID::R16G16_FLOAT;
3067         case VK_FORMAT_R16G16_SINT:
3068             return angle::FormatID::R16G16_SINT;
3069         case VK_FORMAT_R16G16_SNORM:
3070             return angle::FormatID::R16G16_SNORM;
3071         case VK_FORMAT_R16G16_SSCALED:
3072             return angle::FormatID::R16G16_SSCALED;
3073         case VK_FORMAT_R16G16_UINT:
3074             return angle::FormatID::R16G16_UINT;
3075         case VK_FORMAT_R16G16_UNORM:
3076             return angle::FormatID::R16G16_UNORM;
3077         case VK_FORMAT_R16G16_USCALED:
3078             return angle::FormatID::R16G16_USCALED;
3079         case VK_FORMAT_R16_SFLOAT:
3080             return angle::FormatID::R16_FLOAT;
3081         case VK_FORMAT_R16_SINT:
3082             return angle::FormatID::R16_SINT;
3083         case VK_FORMAT_R16_SNORM:
3084             return angle::FormatID::R16_SNORM;
3085         case VK_FORMAT_R16_SSCALED:
3086             return angle::FormatID::R16_SSCALED;
3087         case VK_FORMAT_R16_UINT:
3088             return angle::FormatID::R16_UINT;
3089         case VK_FORMAT_R16_UNORM:
3090             return angle::FormatID::R16_UNORM;
3091         case VK_FORMAT_R16_USCALED:
3092             return angle::FormatID::R16_USCALED;
3093         case VK_FORMAT_R32G32B32A32_SFLOAT:
3094             return angle::FormatID::R32G32B32A32_FLOAT;
3095         case VK_FORMAT_R32G32B32A32_SINT:
3096             return angle::FormatID::R32G32B32A32_SINT;
3097         case VK_FORMAT_R32G32B32A32_UINT:
3098             return angle::FormatID::R32G32B32A32_UINT;
3099         case VK_FORMAT_R32G32B32_SFLOAT:
3100             return angle::FormatID::R32G32B32_FLOAT;
3101         case VK_FORMAT_R32G32B32_SINT:
3102             return angle::FormatID::R32G32B32_SINT;
3103         case VK_FORMAT_R32G32B32_UINT:
3104             return angle::FormatID::R32G32B32_UINT;
3105         case VK_FORMAT_R32G32_SFLOAT:
3106             return angle::FormatID::R32G32_FLOAT;
3107         case VK_FORMAT_R32G32_SINT:
3108             return angle::FormatID::R32G32_SINT;
3109         case VK_FORMAT_R32G32_UINT:
3110             return angle::FormatID::R32G32_UINT;
3111         case VK_FORMAT_R32_SFLOAT:
3112             return angle::FormatID::R32_FLOAT;
3113         case VK_FORMAT_R32_SINT:
3114             return angle::FormatID::R32_SINT;
3115         case VK_FORMAT_R32_UINT:
3116             return angle::FormatID::R32_UINT;
3117         case VK_FORMAT_R4G4B4A4_UNORM_PACK16:
3118             return angle::FormatID::R4G4B4A4_UNORM;
3119         case VK_FORMAT_R5G5B5A1_UNORM_PACK16:
3120             return angle::FormatID::R5G5B5A1_UNORM;
3121         case VK_FORMAT_R5G6B5_UNORM_PACK16:
3122             return angle::FormatID::R5G6B5_UNORM;
3123         case VK_FORMAT_R8G8B8A8_SINT:
3124             return angle::FormatID::R8G8B8A8_SINT;
3125         case VK_FORMAT_R8G8B8A8_SNORM:
3126             return angle::FormatID::R8G8B8A8_SNORM;
3127         case VK_FORMAT_R8G8B8A8_SSCALED:
3128             return angle::FormatID::R8G8B8A8_SSCALED;
3129         case VK_FORMAT_R8G8B8A8_UINT:
3130             return angle::FormatID::R8G8B8A8_UINT;
3131         case VK_FORMAT_R8G8B8A8_UNORM:
3132             return angle::FormatID::R8G8B8A8_UNORM;
3133         case VK_FORMAT_R8G8B8A8_SRGB:
3134             return angle::FormatID::R8G8B8A8_UNORM_SRGB;
3135         case VK_FORMAT_R8G8B8A8_USCALED:
3136             return angle::FormatID::R8G8B8A8_USCALED;
3137         case VK_FORMAT_R8G8B8_SINT:
3138             return angle::FormatID::R8G8B8_SINT;
3139         case VK_FORMAT_R8G8B8_SNORM:
3140             return angle::FormatID::R8G8B8_SNORM;
3141         case VK_FORMAT_R8G8B8_SSCALED:
3142             return angle::FormatID::R8G8B8_SSCALED;
3143         case VK_FORMAT_R8G8B8_UINT:
3144             return angle::FormatID::R8G8B8_UINT;
3145         case VK_FORMAT_R8G8B8_UNORM:
3146             return angle::FormatID::R8G8B8_UNORM;
3147         case VK_FORMAT_R8G8B8_SRGB:
3148             return angle::FormatID::R8G8B8_UNORM_SRGB;
3149         case VK_FORMAT_R8G8B8_USCALED:
3150             return angle::FormatID::R8G8B8_USCALED;
3151         case VK_FORMAT_R8G8_SINT:
3152             return angle::FormatID::R8G8_SINT;
3153         case VK_FORMAT_R8G8_SNORM:
3154             return angle::FormatID::R8G8_SNORM;
3155         case VK_FORMAT_R8G8_SSCALED:
3156             return angle::FormatID::R8G8_SSCALED;
3157         case VK_FORMAT_R8G8_UINT:
3158             return angle::FormatID::R8G8_UINT;
3159         case VK_FORMAT_R8G8_UNORM:
3160             return angle::FormatID::R8G8_UNORM;
3161         case VK_FORMAT_R8G8_SRGB:
3162             return angle::FormatID::R8G8_UNORM_SRGB;
3163         case VK_FORMAT_R8G8_USCALED:
3164             return angle::FormatID::R8G8_USCALED;
3165         case VK_FORMAT_R8_SINT:
3166             return angle::FormatID::R8_SINT;
3167         case VK_FORMAT_R8_SNORM:
3168             return angle::FormatID::R8_SNORM;
3169         case VK_FORMAT_R8_SSCALED:
3170             return angle::FormatID::R8_SSCALED;
3171         case VK_FORMAT_R8_UINT:
3172             return angle::FormatID::R8_UINT;
3173         case VK_FORMAT_R8_UNORM:
3174             return angle::FormatID::R8_UNORM;
3175         case VK_FORMAT_R8_SRGB:
3176             return angle::FormatID::R8_UNORM_SRGB;
3177         case VK_FORMAT_R8_USCALED:
3178             return angle::FormatID::R8_USCALED;
3179         case VK_FORMAT_E5B9G9R9_UFLOAT_PACK32:
3180             return angle::FormatID::R9G9B9E5_SHAREDEXP;
3181         case VK_FORMAT_S8_UINT:
3182             return angle::FormatID::S8_UINT;
3183 
3184         default:
3185             UNREACHABLE();
3186             return angle::FormatID::NONE;
3187     }
3188 }
3189 }  // namespace vk
3190 }  // namespace rx
3191