• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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(RendererVk * renderer,const angle::Format & angleFormat)22 void Format::initialize(RendererVk *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::BC1_RGBA_UNORM_BLOCK:
668             mIntendedGLFormat              = GL_COMPRESSED_RGBA_S3TC_DXT1_EXT;
669             mActualSampleOnlyImageFormatID = angle::FormatID::BC1_RGBA_UNORM_BLOCK;
670             mImageInitializerFunction      = nullptr;
671             mActualBufferFormatID          = angle::FormatID::BC1_RGBA_UNORM_BLOCK;
672             mVkBufferFormatIsPacked        = false;
673             mVertexLoadFunction            = nullptr;
674             mVertexLoadRequiresConversion  = false;
675             break;
676 
677         case angle::FormatID::BC1_RGBA_UNORM_SRGB_BLOCK:
678             mIntendedGLFormat              = GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT;
679             mActualSampleOnlyImageFormatID = angle::FormatID::BC1_RGBA_UNORM_SRGB_BLOCK;
680             mImageInitializerFunction      = nullptr;
681             mActualBufferFormatID          = angle::FormatID::BC1_RGBA_UNORM_SRGB_BLOCK;
682             mVkBufferFormatIsPacked        = false;
683             mVertexLoadFunction            = nullptr;
684             mVertexLoadRequiresConversion  = false;
685             break;
686 
687         case angle::FormatID::BC1_RGB_UNORM_BLOCK:
688             mIntendedGLFormat              = GL_COMPRESSED_RGB_S3TC_DXT1_EXT;
689             mActualSampleOnlyImageFormatID = angle::FormatID::BC1_RGB_UNORM_BLOCK;
690             mImageInitializerFunction      = nullptr;
691             mActualBufferFormatID          = angle::FormatID::BC1_RGB_UNORM_BLOCK;
692             mVkBufferFormatIsPacked        = false;
693             mVertexLoadFunction            = nullptr;
694             mVertexLoadRequiresConversion  = false;
695             break;
696 
697         case angle::FormatID::BC1_RGB_UNORM_SRGB_BLOCK:
698             mIntendedGLFormat              = GL_COMPRESSED_SRGB_S3TC_DXT1_EXT;
699             mActualSampleOnlyImageFormatID = angle::FormatID::BC1_RGB_UNORM_SRGB_BLOCK;
700             mImageInitializerFunction      = nullptr;
701             mActualBufferFormatID          = angle::FormatID::BC1_RGB_UNORM_SRGB_BLOCK;
702             mVkBufferFormatIsPacked        = false;
703             mVertexLoadFunction            = nullptr;
704             mVertexLoadRequiresConversion  = false;
705             break;
706 
707         case angle::FormatID::BC2_RGBA_UNORM_BLOCK:
708             mIntendedGLFormat              = GL_COMPRESSED_RGBA_S3TC_DXT3_ANGLE;
709             mActualSampleOnlyImageFormatID = angle::FormatID::BC2_RGBA_UNORM_BLOCK;
710             mImageInitializerFunction      = nullptr;
711             mActualBufferFormatID          = angle::FormatID::BC2_RGBA_UNORM_BLOCK;
712             mVkBufferFormatIsPacked        = false;
713             mVertexLoadFunction            = nullptr;
714             mVertexLoadRequiresConversion  = false;
715             break;
716 
717         case angle::FormatID::BC2_RGBA_UNORM_SRGB_BLOCK:
718             mIntendedGLFormat              = GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT;
719             mActualSampleOnlyImageFormatID = angle::FormatID::BC2_RGBA_UNORM_SRGB_BLOCK;
720             mImageInitializerFunction      = nullptr;
721             mActualBufferFormatID          = angle::FormatID::BC2_RGBA_UNORM_SRGB_BLOCK;
722             mVkBufferFormatIsPacked        = false;
723             mVertexLoadFunction            = nullptr;
724             mVertexLoadRequiresConversion  = false;
725             break;
726 
727         case angle::FormatID::BC3_RGBA_UNORM_BLOCK:
728             mIntendedGLFormat              = GL_COMPRESSED_RGBA_S3TC_DXT5_ANGLE;
729             mActualSampleOnlyImageFormatID = angle::FormatID::BC3_RGBA_UNORM_BLOCK;
730             mImageInitializerFunction      = nullptr;
731             mActualBufferFormatID          = angle::FormatID::BC3_RGBA_UNORM_BLOCK;
732             mVkBufferFormatIsPacked        = false;
733             mVertexLoadFunction            = nullptr;
734             mVertexLoadRequiresConversion  = false;
735             break;
736 
737         case angle::FormatID::BC3_RGBA_UNORM_SRGB_BLOCK:
738             mIntendedGLFormat              = GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT;
739             mActualSampleOnlyImageFormatID = angle::FormatID::BC3_RGBA_UNORM_SRGB_BLOCK;
740             mImageInitializerFunction      = nullptr;
741             mActualBufferFormatID          = angle::FormatID::BC3_RGBA_UNORM_SRGB_BLOCK;
742             mVkBufferFormatIsPacked        = false;
743             mVertexLoadFunction            = nullptr;
744             mVertexLoadRequiresConversion  = false;
745             break;
746 
747         case angle::FormatID::BC4_RED_SNORM_BLOCK:
748             mIntendedGLFormat              = GL_COMPRESSED_SIGNED_RED_RGTC1_EXT;
749             mActualSampleOnlyImageFormatID = angle::FormatID::BC4_RED_SNORM_BLOCK;
750             mImageInitializerFunction      = nullptr;
751             mActualBufferFormatID          = angle::FormatID::BC4_RED_SNORM_BLOCK;
752             mVkBufferFormatIsPacked        = false;
753             mVertexLoadFunction            = nullptr;
754             mVertexLoadRequiresConversion  = false;
755             break;
756 
757         case angle::FormatID::BC4_RED_UNORM_BLOCK:
758             mIntendedGLFormat              = GL_COMPRESSED_RED_RGTC1_EXT;
759             mActualSampleOnlyImageFormatID = angle::FormatID::BC4_RED_UNORM_BLOCK;
760             mImageInitializerFunction      = nullptr;
761             mActualBufferFormatID          = angle::FormatID::BC4_RED_UNORM_BLOCK;
762             mVkBufferFormatIsPacked        = false;
763             mVertexLoadFunction            = nullptr;
764             mVertexLoadRequiresConversion  = false;
765             break;
766 
767         case angle::FormatID::BC5_RG_SNORM_BLOCK:
768             mIntendedGLFormat              = GL_COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT;
769             mActualSampleOnlyImageFormatID = angle::FormatID::BC5_RG_SNORM_BLOCK;
770             mImageInitializerFunction      = nullptr;
771             mActualBufferFormatID          = angle::FormatID::BC5_RG_SNORM_BLOCK;
772             mVkBufferFormatIsPacked        = false;
773             mVertexLoadFunction            = nullptr;
774             mVertexLoadRequiresConversion  = false;
775             break;
776 
777         case angle::FormatID::BC5_RG_UNORM_BLOCK:
778             mIntendedGLFormat              = GL_COMPRESSED_RED_GREEN_RGTC2_EXT;
779             mActualSampleOnlyImageFormatID = angle::FormatID::BC5_RG_UNORM_BLOCK;
780             mImageInitializerFunction      = nullptr;
781             mActualBufferFormatID          = angle::FormatID::BC5_RG_UNORM_BLOCK;
782             mVkBufferFormatIsPacked        = false;
783             mVertexLoadFunction            = nullptr;
784             mVertexLoadRequiresConversion  = false;
785             break;
786 
787         case angle::FormatID::BC6H_RGB_SFLOAT_BLOCK:
788             mIntendedGLFormat              = GL_COMPRESSED_RGB_BPTC_SIGNED_FLOAT_EXT;
789             mActualSampleOnlyImageFormatID = angle::FormatID::BC6H_RGB_SFLOAT_BLOCK;
790             mImageInitializerFunction      = nullptr;
791             mActualBufferFormatID          = angle::FormatID::BC6H_RGB_SFLOAT_BLOCK;
792             mVkBufferFormatIsPacked        = false;
793             mVertexLoadFunction            = nullptr;
794             mVertexLoadRequiresConversion  = false;
795             break;
796 
797         case angle::FormatID::BC6H_RGB_UFLOAT_BLOCK:
798             mIntendedGLFormat              = GL_COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_EXT;
799             mActualSampleOnlyImageFormatID = angle::FormatID::BC6H_RGB_UFLOAT_BLOCK;
800             mImageInitializerFunction      = nullptr;
801             mActualBufferFormatID          = angle::FormatID::BC6H_RGB_UFLOAT_BLOCK;
802             mVkBufferFormatIsPacked        = false;
803             mVertexLoadFunction            = nullptr;
804             mVertexLoadRequiresConversion  = false;
805             break;
806 
807         case angle::FormatID::BC7_RGBA_UNORM_BLOCK:
808             mIntendedGLFormat              = GL_COMPRESSED_RGBA_BPTC_UNORM_EXT;
809             mActualSampleOnlyImageFormatID = angle::FormatID::BC7_RGBA_UNORM_BLOCK;
810             mImageInitializerFunction      = nullptr;
811             mActualBufferFormatID          = angle::FormatID::BC7_RGBA_UNORM_BLOCK;
812             mVkBufferFormatIsPacked        = false;
813             mVertexLoadFunction            = nullptr;
814             mVertexLoadRequiresConversion  = false;
815             break;
816 
817         case angle::FormatID::BC7_RGBA_UNORM_SRGB_BLOCK:
818             mIntendedGLFormat              = GL_COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT;
819             mActualSampleOnlyImageFormatID = angle::FormatID::BC7_RGBA_UNORM_SRGB_BLOCK;
820             mImageInitializerFunction      = nullptr;
821             mActualBufferFormatID          = angle::FormatID::BC7_RGBA_UNORM_SRGB_BLOCK;
822             mVkBufferFormatIsPacked        = false;
823             mVertexLoadFunction            = nullptr;
824             mVertexLoadRequiresConversion  = false;
825             break;
826 
827         case angle::FormatID::D16_UNORM:
828             mIntendedGLFormat              = GL_DEPTH_COMPONENT16;
829             mActualSampleOnlyImageFormatID = angle::FormatID::D16_UNORM;
830             mImageInitializerFunction      = nullptr;
831             mActualBufferFormatID          = angle::FormatID::D16_UNORM;
832             mVkBufferFormatIsPacked        = false;
833             mVertexLoadFunction            = nullptr;
834             mVertexLoadRequiresConversion  = false;
835             break;
836 
837         case angle::FormatID::D24_UNORM_S8_UINT:
838             mIntendedGLFormat = GL_DEPTH24_STENCIL8;
839             {
840                 static constexpr ImageFormatInitInfo kInfo[] = {
841                     {angle::FormatID::D24_UNORM_S8_UINT, nullptr},
842                     {angle::FormatID::D32_FLOAT_S8X24_UINT, nullptr},
843                     {angle::FormatID::D24_UNORM_S8_UINT, nullptr}};
844                 initImageFallback(renderer, kInfo, ArraySize(kInfo));
845             }
846             mActualBufferFormatID         = angle::FormatID::D24_UNORM_S8_UINT;
847             mVkBufferFormatIsPacked       = false;
848             mVertexLoadFunction           = nullptr;
849             mVertexLoadRequiresConversion = false;
850             break;
851 
852         case angle::FormatID::D24_UNORM_X8_UINT:
853             mIntendedGLFormat = GL_DEPTH_COMPONENT24;
854             {
855                 static constexpr ImageFormatInitInfo kInfo[] = {
856                     {angle::FormatID::D24_UNORM_X8_UINT, nullptr},
857                     {angle::FormatID::D24_UNORM_S8_UINT, nullptr},
858                     {angle::FormatID::D32_FLOAT_S8X24_UINT, nullptr}};
859                 initImageFallback(renderer, kInfo, ArraySize(kInfo));
860             }
861             mActualBufferFormatID         = angle::FormatID::D24_UNORM_X8_UINT;
862             mVkBufferFormatIsPacked       = true;
863             mVertexLoadFunction           = CopyNativeVertexData<GLuint, 1, 1, 0>;
864             mVertexLoadRequiresConversion = false;
865             break;
866 
867         case angle::FormatID::D32_FLOAT:
868             mIntendedGLFormat              = GL_DEPTH_COMPONENT32F;
869             mActualSampleOnlyImageFormatID = angle::FormatID::D32_FLOAT;
870             mImageInitializerFunction      = nullptr;
871             mActualBufferFormatID          = angle::FormatID::D32_FLOAT;
872             mVkBufferFormatIsPacked        = false;
873             mVertexLoadFunction            = CopyNativeVertexData<GLfloat, 1, 1, 0>;
874             mVertexLoadRequiresConversion  = false;
875             break;
876 
877         case angle::FormatID::D32_FLOAT_S8X24_UINT:
878             mIntendedGLFormat = GL_DEPTH32F_STENCIL8;
879             {
880                 static constexpr ImageFormatInitInfo kInfo[] = {
881                     {angle::FormatID::D32_FLOAT_S8X24_UINT, nullptr},
882                     {angle::FormatID::D24_UNORM_S8_UINT, nullptr},
883                     {angle::FormatID::D32_FLOAT_S8X24_UINT, nullptr}};
884                 initImageFallback(renderer, kInfo, ArraySize(kInfo));
885             }
886             mActualBufferFormatID         = angle::FormatID::D32_FLOAT_S8X24_UINT;
887             mVkBufferFormatIsPacked       = false;
888             mVertexLoadFunction           = CopyNativeVertexData<GLfloat, 3, 3, 0>;
889             mVertexLoadRequiresConversion = false;
890             break;
891 
892         case angle::FormatID::D32_UNORM:
893             mIntendedGLFormat = GL_DEPTH_COMPONENT32_OES;
894             {
895                 static constexpr ImageFormatInitInfo kInfo[] = {
896                     {angle::FormatID::D24_UNORM_X8_UINT, nullptr},
897                     {angle::FormatID::D24_UNORM_S8_UINT, nullptr},
898                     {angle::FormatID::D32_FLOAT, nullptr}};
899                 initImageFallback(renderer, kInfo, ArraySize(kInfo));
900             }
901             mActualBufferFormatID         = angle::FormatID::NONE;
902             mVkBufferFormatIsPacked       = false;
903             mVertexLoadFunction           = nullptr;
904             mVertexLoadRequiresConversion = true;
905             break;
906 
907         case angle::FormatID::EAC_R11G11_SNORM_BLOCK:
908             mIntendedGLFormat = GL_COMPRESSED_SIGNED_RG11_EAC;
909             {
910                 static constexpr ImageFormatInitInfo kInfo[] = {
911                     {angle::FormatID::EAC_R11G11_SNORM_BLOCK, nullptr},
912                     {angle::FormatID::R16G16_SNORM, nullptr},
913                     {angle::FormatID::R16G16_FLOAT, nullptr}};
914                 initImageFallback(renderer, kInfo, ArraySize(kInfo));
915             }
916             mActualBufferFormatID         = angle::FormatID::EAC_R11G11_SNORM_BLOCK;
917             mVkBufferFormatIsPacked       = false;
918             mVertexLoadFunction           = nullptr;
919             mVertexLoadRequiresConversion = false;
920             break;
921 
922         case angle::FormatID::EAC_R11G11_UNORM_BLOCK:
923             mIntendedGLFormat = GL_COMPRESSED_RG11_EAC;
924             {
925                 static constexpr ImageFormatInitInfo kInfo[] = {
926                     {angle::FormatID::EAC_R11G11_UNORM_BLOCK, nullptr},
927                     {angle::FormatID::R16G16_UNORM, nullptr},
928                     {angle::FormatID::R16G16_FLOAT, nullptr}};
929                 initImageFallback(renderer, kInfo, ArraySize(kInfo));
930             }
931             mActualBufferFormatID         = angle::FormatID::EAC_R11G11_UNORM_BLOCK;
932             mVkBufferFormatIsPacked       = false;
933             mVertexLoadFunction           = nullptr;
934             mVertexLoadRequiresConversion = false;
935             break;
936 
937         case angle::FormatID::EAC_R11_SNORM_BLOCK:
938             mIntendedGLFormat = GL_COMPRESSED_SIGNED_R11_EAC;
939             {
940                 static constexpr ImageFormatInitInfo kInfo[] = {
941                     {angle::FormatID::EAC_R11_SNORM_BLOCK, nullptr},
942                     {angle::FormatID::R16_SNORM, nullptr},
943                     {angle::FormatID::R16_FLOAT, nullptr}};
944                 initImageFallback(renderer, kInfo, ArraySize(kInfo));
945             }
946             mActualBufferFormatID         = angle::FormatID::EAC_R11_SNORM_BLOCK;
947             mVkBufferFormatIsPacked       = false;
948             mVertexLoadFunction           = nullptr;
949             mVertexLoadRequiresConversion = false;
950             break;
951 
952         case angle::FormatID::EAC_R11_UNORM_BLOCK:
953             mIntendedGLFormat = GL_COMPRESSED_R11_EAC;
954             {
955                 static constexpr ImageFormatInitInfo kInfo[] = {
956                     {angle::FormatID::EAC_R11_UNORM_BLOCK, nullptr},
957                     {angle::FormatID::R16_UNORM, nullptr},
958                     {angle::FormatID::R16_FLOAT, nullptr}};
959                 initImageFallback(renderer, kInfo, ArraySize(kInfo));
960             }
961             mActualBufferFormatID         = angle::FormatID::EAC_R11_UNORM_BLOCK;
962             mVkBufferFormatIsPacked       = false;
963             mVertexLoadFunction           = nullptr;
964             mVertexLoadRequiresConversion = false;
965             break;
966 
967         case angle::FormatID::ETC1_LOSSY_DECODE_R8G8B8_UNORM_BLOCK:
968             // This format is not implemented in Vulkan.
969             break;
970 
971         case angle::FormatID::ETC1_R8G8B8_UNORM_BLOCK:
972             mIntendedGLFormat = GL_ETC1_RGB8_OES;
973             {
974                 static constexpr ImageFormatInitInfo kInfo[] = {
975                     {angle::FormatID::ETC2_R8G8B8_UNORM_BLOCK, nullptr},
976                     {angle::FormatID::R8G8B8A8_UNORM,
977                      Initialize4ComponentData<GLubyte, 0x00, 0x00, 0x00, 0xFF>}};
978                 initImageFallback(renderer, kInfo, ArraySize(kInfo));
979             }
980             mActualBufferFormatID         = angle::FormatID::NONE;
981             mVkBufferFormatIsPacked       = false;
982             mVertexLoadFunction           = nullptr;
983             mVertexLoadRequiresConversion = true;
984             break;
985 
986         case angle::FormatID::ETC2_R8G8B8A1_SRGB_BLOCK:
987             mIntendedGLFormat = GL_COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2;
988             {
989                 static constexpr ImageFormatInitInfo kInfo[] = {
990                     {angle::FormatID::ETC2_R8G8B8A1_SRGB_BLOCK, nullptr},
991                     {angle::FormatID::R8G8B8A8_UNORM_SRGB,
992                      Initialize4ComponentData<GLubyte, 0x00, 0x00, 0x00, 0xFF>}};
993                 initImageFallback(renderer, kInfo, ArraySize(kInfo));
994             }
995             mActualBufferFormatID         = angle::FormatID::ETC2_R8G8B8A1_SRGB_BLOCK;
996             mVkBufferFormatIsPacked       = false;
997             mVertexLoadFunction           = CopyNativeVertexData<GLbyte, 4, 4, 0>;
998             mVertexLoadRequiresConversion = false;
999             break;
1000 
1001         case angle::FormatID::ETC2_R8G8B8A1_UNORM_BLOCK:
1002             mIntendedGLFormat = GL_COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2;
1003             {
1004                 static constexpr ImageFormatInitInfo kInfo[] = {
1005                     {angle::FormatID::ETC2_R8G8B8A1_UNORM_BLOCK, nullptr},
1006                     {angle::FormatID::R8G8B8A8_UNORM,
1007                      Initialize4ComponentData<GLubyte, 0x00, 0x00, 0x00, 0xFF>}};
1008                 initImageFallback(renderer, kInfo, ArraySize(kInfo));
1009             }
1010             mActualBufferFormatID         = angle::FormatID::ETC2_R8G8B8A1_UNORM_BLOCK;
1011             mVkBufferFormatIsPacked       = false;
1012             mVertexLoadFunction           = CopyNativeVertexData<GLubyte, 4, 4, 0>;
1013             mVertexLoadRequiresConversion = false;
1014             break;
1015 
1016         case angle::FormatID::ETC2_R8G8B8A8_SRGB_BLOCK:
1017             mIntendedGLFormat = GL_COMPRESSED_SRGB8_ALPHA8_ETC2_EAC;
1018             {
1019                 static constexpr ImageFormatInitInfo kInfo[] = {
1020                     {angle::FormatID::ETC2_R8G8B8A8_SRGB_BLOCK, nullptr},
1021                     {angle::FormatID::R8G8B8A8_UNORM_SRGB, nullptr}};
1022                 initImageFallback(renderer, kInfo, ArraySize(kInfo));
1023             }
1024             mActualBufferFormatID         = angle::FormatID::ETC2_R8G8B8A8_SRGB_BLOCK;
1025             mVkBufferFormatIsPacked       = false;
1026             mVertexLoadFunction           = CopyNativeVertexData<GLbyte, 4, 4, 0>;
1027             mVertexLoadRequiresConversion = false;
1028             break;
1029 
1030         case angle::FormatID::ETC2_R8G8B8A8_UNORM_BLOCK:
1031             mIntendedGLFormat = GL_COMPRESSED_RGBA8_ETC2_EAC;
1032             {
1033                 static constexpr ImageFormatInitInfo kInfo[] = {
1034                     {angle::FormatID::ETC2_R8G8B8A8_UNORM_BLOCK, nullptr},
1035                     {angle::FormatID::R8G8B8A8_UNORM, nullptr}};
1036                 initImageFallback(renderer, kInfo, ArraySize(kInfo));
1037             }
1038             mActualBufferFormatID         = angle::FormatID::ETC2_R8G8B8A8_UNORM_BLOCK;
1039             mVkBufferFormatIsPacked       = false;
1040             mVertexLoadFunction           = CopyNativeVertexData<GLubyte, 4, 4, 0>;
1041             mVertexLoadRequiresConversion = false;
1042             break;
1043 
1044         case angle::FormatID::ETC2_R8G8B8_SRGB_BLOCK:
1045             mIntendedGLFormat = GL_COMPRESSED_SRGB8_ETC2;
1046             {
1047                 static constexpr ImageFormatInitInfo kInfo[] = {
1048                     {angle::FormatID::ETC2_R8G8B8_SRGB_BLOCK, nullptr},
1049                     {angle::FormatID::R8G8B8A8_UNORM_SRGB,
1050                      Initialize4ComponentData<GLubyte, 0x00, 0x00, 0x00, 0xFF>}};
1051                 initImageFallback(renderer, kInfo, ArraySize(kInfo));
1052             }
1053             mActualBufferFormatID         = angle::FormatID::ETC2_R8G8B8_SRGB_BLOCK;
1054             mVkBufferFormatIsPacked       = false;
1055             mVertexLoadFunction           = CopyNativeVertexData<GLbyte, 3, 3, 0>;
1056             mVertexLoadRequiresConversion = false;
1057             break;
1058 
1059         case angle::FormatID::ETC2_R8G8B8_UNORM_BLOCK:
1060             mIntendedGLFormat = GL_COMPRESSED_RGB8_ETC2;
1061             {
1062                 static constexpr ImageFormatInitInfo kInfo[] = {
1063                     {angle::FormatID::ETC2_R8G8B8_UNORM_BLOCK, nullptr},
1064                     {angle::FormatID::R8G8B8A8_UNORM,
1065                      Initialize4ComponentData<GLubyte, 0x00, 0x00, 0x00, 0xFF>}};
1066                 initImageFallback(renderer, kInfo, ArraySize(kInfo));
1067             }
1068             mActualBufferFormatID         = angle::FormatID::ETC2_R8G8B8_UNORM_BLOCK;
1069             mVkBufferFormatIsPacked       = false;
1070             mVertexLoadFunction           = CopyNativeVertexData<GLubyte, 3, 3, 0>;
1071             mVertexLoadRequiresConversion = false;
1072             break;
1073 
1074         case angle::FormatID::G8_B8R8_2PLANE_420_UNORM:
1075             mIntendedGLFormat              = GL_G8_B8R8_2PLANE_420_UNORM_ANGLE;
1076             mActualSampleOnlyImageFormatID = angle::FormatID::G8_B8R8_2PLANE_420_UNORM;
1077             mImageInitializerFunction      = nullptr;
1078             mActualBufferFormatID          = angle::FormatID::G8_B8R8_2PLANE_420_UNORM;
1079             mVkBufferFormatIsPacked        = false;
1080             mVertexLoadFunction            = CopyNativeVertexData<GLubyte, 3, 3, 0>;
1081             mVertexLoadRequiresConversion  = false;
1082             break;
1083 
1084         case angle::FormatID::G8_B8_R8_3PLANE_420_UNORM:
1085             mIntendedGLFormat              = GL_G8_B8_R8_3PLANE_420_UNORM_ANGLE;
1086             mActualSampleOnlyImageFormatID = angle::FormatID::G8_B8_R8_3PLANE_420_UNORM;
1087             mImageInitializerFunction      = nullptr;
1088             mActualBufferFormatID          = angle::FormatID::G8_B8_R8_3PLANE_420_UNORM;
1089             mVkBufferFormatIsPacked        = false;
1090             mVertexLoadFunction            = CopyNativeVertexData<GLubyte, 3, 3, 0>;
1091             mVertexLoadRequiresConversion  = false;
1092             break;
1093 
1094         case angle::FormatID::L16A16_FLOAT:
1095             mIntendedGLFormat              = GL_LUMINANCE_ALPHA16F_EXT;
1096             mActualSampleOnlyImageFormatID = angle::FormatID::R16G16_FLOAT;
1097             mImageInitializerFunction      = nullptr;
1098 
1099             break;
1100 
1101         case angle::FormatID::L16_FLOAT:
1102             mIntendedGLFormat              = GL_LUMINANCE16F_EXT;
1103             mActualSampleOnlyImageFormatID = angle::FormatID::R16_FLOAT;
1104             mImageInitializerFunction      = nullptr;
1105 
1106             break;
1107 
1108         case angle::FormatID::L32A32_FLOAT:
1109             mIntendedGLFormat              = GL_LUMINANCE_ALPHA32F_EXT;
1110             mActualSampleOnlyImageFormatID = angle::FormatID::R32G32_FLOAT;
1111             mImageInitializerFunction      = nullptr;
1112 
1113             break;
1114 
1115         case angle::FormatID::L32_FLOAT:
1116             mIntendedGLFormat              = GL_LUMINANCE32F_EXT;
1117             mActualSampleOnlyImageFormatID = angle::FormatID::R32_FLOAT;
1118             mImageInitializerFunction      = nullptr;
1119 
1120             break;
1121 
1122         case angle::FormatID::L8A8_UNORM:
1123             mIntendedGLFormat              = GL_LUMINANCE8_ALPHA8_EXT;
1124             mActualSampleOnlyImageFormatID = angle::FormatID::R8G8_UNORM;
1125             mImageInitializerFunction      = nullptr;
1126 
1127             break;
1128 
1129         case angle::FormatID::L8_UNORM:
1130             mIntendedGLFormat              = GL_LUMINANCE8_EXT;
1131             mActualSampleOnlyImageFormatID = angle::FormatID::R8_UNORM;
1132             mImageInitializerFunction      = nullptr;
1133 
1134             break;
1135 
1136         case angle::FormatID::NONE:
1137             mIntendedGLFormat              = GL_NONE;
1138             mActualSampleOnlyImageFormatID = angle::FormatID::NONE;
1139             mImageInitializerFunction      = nullptr;
1140             mActualBufferFormatID          = angle::FormatID::NONE;
1141             mVkBufferFormatIsPacked        = false;
1142             mVertexLoadFunction            = nullptr;
1143             mVertexLoadRequiresConversion  = false;
1144             break;
1145 
1146         case angle::FormatID::PALETTE4_R4G4B4A4_UNORM:
1147             mIntendedGLFormat              = GL_PALETTE4_RGBA4_OES;
1148             mActualSampleOnlyImageFormatID = angle::FormatID::R8G8B8A8_UNORM;
1149             mImageInitializerFunction      = nullptr;
1150 
1151             break;
1152 
1153         case angle::FormatID::PALETTE4_R5G5B5A1_UNORM:
1154             mIntendedGLFormat              = GL_PALETTE4_RGB5_A1_OES;
1155             mActualSampleOnlyImageFormatID = angle::FormatID::R8G8B8A8_UNORM;
1156             mImageInitializerFunction      = nullptr;
1157 
1158             break;
1159 
1160         case angle::FormatID::PALETTE4_R5G6B5_UNORM:
1161             mIntendedGLFormat              = GL_PALETTE4_R5_G6_B5_OES;
1162             mActualSampleOnlyImageFormatID = angle::FormatID::R8G8B8A8_UNORM;
1163             mImageInitializerFunction      = nullptr;
1164 
1165             break;
1166 
1167         case angle::FormatID::PALETTE4_R8G8B8A8_UNORM:
1168             mIntendedGLFormat              = GL_PALETTE4_RGBA8_OES;
1169             mActualSampleOnlyImageFormatID = angle::FormatID::R8G8B8A8_UNORM;
1170             mImageInitializerFunction      = nullptr;
1171 
1172             break;
1173 
1174         case angle::FormatID::PALETTE4_R8G8B8_UNORM:
1175             mIntendedGLFormat              = GL_PALETTE4_RGB8_OES;
1176             mActualSampleOnlyImageFormatID = angle::FormatID::R8G8B8A8_UNORM;
1177             mImageInitializerFunction      = nullptr;
1178 
1179             break;
1180 
1181         case angle::FormatID::PALETTE8_R4G4B4A4_UNORM:
1182             mIntendedGLFormat              = GL_PALETTE8_RGBA4_OES;
1183             mActualSampleOnlyImageFormatID = angle::FormatID::R8G8B8A8_UNORM;
1184             mImageInitializerFunction      = nullptr;
1185 
1186             break;
1187 
1188         case angle::FormatID::PALETTE8_R5G5B5A1_UNORM:
1189             mIntendedGLFormat              = GL_PALETTE8_RGB5_A1_OES;
1190             mActualSampleOnlyImageFormatID = angle::FormatID::R8G8B8A8_UNORM;
1191             mImageInitializerFunction      = nullptr;
1192 
1193             break;
1194 
1195         case angle::FormatID::PALETTE8_R5G6B5_UNORM:
1196             mIntendedGLFormat              = GL_PALETTE8_R5_G6_B5_OES;
1197             mActualSampleOnlyImageFormatID = angle::FormatID::R8G8B8A8_UNORM;
1198             mImageInitializerFunction      = nullptr;
1199 
1200             break;
1201 
1202         case angle::FormatID::PALETTE8_R8G8B8A8_UNORM:
1203             mIntendedGLFormat              = GL_PALETTE8_RGBA8_OES;
1204             mActualSampleOnlyImageFormatID = angle::FormatID::R8G8B8A8_UNORM;
1205             mImageInitializerFunction      = nullptr;
1206 
1207             break;
1208 
1209         case angle::FormatID::PALETTE8_R8G8B8_UNORM:
1210             mIntendedGLFormat              = GL_PALETTE8_RGB8_OES;
1211             mActualSampleOnlyImageFormatID = angle::FormatID::R8G8B8A8_UNORM;
1212             mImageInitializerFunction      = nullptr;
1213 
1214             break;
1215 
1216         case angle::FormatID::PVRTC1_RGBA_2BPP_UNORM_BLOCK:
1217             // This format is not implemented in Vulkan.
1218             break;
1219 
1220         case angle::FormatID::PVRTC1_RGBA_2BPP_UNORM_SRGB_BLOCK:
1221             // This format is not implemented in Vulkan.
1222             break;
1223 
1224         case angle::FormatID::PVRTC1_RGBA_4BPP_UNORM_BLOCK:
1225             // This format is not implemented in Vulkan.
1226             break;
1227 
1228         case angle::FormatID::PVRTC1_RGBA_4BPP_UNORM_SRGB_BLOCK:
1229             // This format is not implemented in Vulkan.
1230             break;
1231 
1232         case angle::FormatID::PVRTC1_RGB_2BPP_UNORM_BLOCK:
1233             // This format is not implemented in Vulkan.
1234             break;
1235 
1236         case angle::FormatID::PVRTC1_RGB_2BPP_UNORM_SRGB_BLOCK:
1237             // This format is not implemented in Vulkan.
1238             break;
1239 
1240         case angle::FormatID::PVRTC1_RGB_4BPP_UNORM_BLOCK:
1241             // This format is not implemented in Vulkan.
1242             break;
1243 
1244         case angle::FormatID::PVRTC1_RGB_4BPP_UNORM_SRGB_BLOCK:
1245             // This format is not implemented in Vulkan.
1246             break;
1247 
1248         case angle::FormatID::R10G10B10A2_SINT:
1249             mIntendedGLFormat              = GL_RGB10_A2_SINT_ANGLEX;
1250             mActualSampleOnlyImageFormatID = angle::FormatID::R10G10B10A2_SINT;
1251             mImageInitializerFunction      = nullptr;
1252             {
1253                 static constexpr BufferFormatInitInfo kInfo[] = {
1254                     {angle::FormatID::R10G10B10A2_SINT, true, CopyNativeVertexData<GLuint, 1, 1, 0>,
1255                      false},
1256                     {angle::FormatID::R16G16B16A16_SINT, false,
1257                      CopyXYZ10W2ToXYZWFloatVertexData<true, false, false, false>, true}};
1258                 initBufferFallback(renderer, kInfo, ArraySize(kInfo), 2);
1259             }
1260             break;
1261 
1262         case angle::FormatID::R10G10B10A2_SNORM:
1263             mIntendedGLFormat              = GL_RGB10_A2_SNORM_ANGLEX;
1264             mActualSampleOnlyImageFormatID = angle::FormatID::R10G10B10A2_SNORM;
1265             mImageInitializerFunction      = nullptr;
1266             {
1267                 static constexpr BufferFormatInitInfo kInfo[] = {
1268                     {angle::FormatID::R10G10B10A2_SNORM, true,
1269                      CopyNativeVertexData<GLuint, 1, 1, 0>, false},
1270                     {angle::FormatID::R16G16B16A16_FLOAT, false,
1271                      CopyXYZ10W2ToXYZWFloatVertexData<true, true, true, true>, true}};
1272                 initBufferFallback(renderer, kInfo, ArraySize(kInfo), 2);
1273             }
1274             break;
1275 
1276         case angle::FormatID::R10G10B10A2_SSCALED:
1277             mIntendedGLFormat              = GL_RGB10_A2_SSCALED_ANGLEX;
1278             mActualSampleOnlyImageFormatID = angle::FormatID::R10G10B10A2_SSCALED;
1279             mImageInitializerFunction      = nullptr;
1280             {
1281                 static constexpr BufferFormatInitInfo kInfo[] = {
1282                     {angle::FormatID::R10G10B10A2_SSCALED, true,
1283                      CopyNativeVertexData<GLuint, 1, 1, 0>, false},
1284                     {angle::FormatID::R16G16B16A16_FLOAT, false,
1285                      CopyXYZ10W2ToXYZWFloatVertexData<true, false, true, true>, true}};
1286                 initBufferFallback(renderer, kInfo, ArraySize(kInfo), 2);
1287             }
1288             break;
1289 
1290         case angle::FormatID::R10G10B10A2_UINT:
1291             mIntendedGLFormat              = GL_RGB10_A2UI;
1292             mActualSampleOnlyImageFormatID = angle::FormatID::R10G10B10A2_UINT;
1293             mImageInitializerFunction      = nullptr;
1294             {
1295                 static constexpr BufferFormatInitInfo kInfo[] = {
1296                     {angle::FormatID::R10G10B10A2_UINT, true, CopyNativeVertexData<GLuint, 1, 1, 0>,
1297                      false},
1298                     {angle::FormatID::R16G16B16A16_UINT, false,
1299                      CopyXYZ10W2ToXYZWFloatVertexData<false, false, false, false>, true}};
1300                 initBufferFallback(renderer, kInfo, ArraySize(kInfo), 2);
1301             }
1302             break;
1303 
1304         case angle::FormatID::R10G10B10A2_UNORM:
1305             mIntendedGLFormat              = GL_RGB10_A2;
1306             mActualSampleOnlyImageFormatID = angle::FormatID::R10G10B10A2_UNORM;
1307             mImageInitializerFunction      = nullptr;
1308             mActualBufferFormatID          = angle::FormatID::R10G10B10A2_UNORM;
1309             mVkBufferFormatIsPacked        = true;
1310             mVertexLoadFunction            = CopyNativeVertexData<GLuint, 1, 1, 0>;
1311             mVertexLoadRequiresConversion  = false;
1312             break;
1313 
1314         case angle::FormatID::R10G10B10A2_USCALED:
1315             mIntendedGLFormat              = GL_RGB10_A2_USCALED_ANGLEX;
1316             mActualSampleOnlyImageFormatID = angle::FormatID::R10G10B10A2_USCALED;
1317             mImageInitializerFunction      = nullptr;
1318             {
1319                 static constexpr BufferFormatInitInfo kInfo[] = {
1320                     {angle::FormatID::R10G10B10A2_USCALED, true,
1321                      CopyNativeVertexData<GLuint, 1, 1, 0>, false},
1322                     {angle::FormatID::R16G16B16A16_FLOAT, false,
1323                      CopyXYZ10W2ToXYZWFloatVertexData<false, false, true, true>, true}};
1324                 initBufferFallback(renderer, kInfo, ArraySize(kInfo), 2);
1325             }
1326             break;
1327 
1328         case angle::FormatID::R10G10B10X2_UNORM:
1329             mIntendedGLFormat              = GL_RGB10_UNORM_ANGLEX;
1330             mActualSampleOnlyImageFormatID = angle::FormatID::R10G10B10A2_UNORM;
1331             mImageInitializerFunction      = nullptr;
1332             mActualBufferFormatID          = angle::FormatID::NONE;
1333             mVkBufferFormatIsPacked        = false;
1334             mVertexLoadFunction            = nullptr;
1335             mVertexLoadRequiresConversion  = true;
1336             break;
1337 
1338         case angle::FormatID::R11G11B10_FLOAT:
1339             mIntendedGLFormat              = GL_R11F_G11F_B10F;
1340             mActualSampleOnlyImageFormatID = angle::FormatID::R11G11B10_FLOAT;
1341             mImageInitializerFunction      = nullptr;
1342             mActualBufferFormatID          = angle::FormatID::R11G11B10_FLOAT;
1343             mVkBufferFormatIsPacked        = true;
1344             mVertexLoadFunction            = CopyNativeVertexData<GLuint, 1, 1, 0>;
1345             mVertexLoadRequiresConversion  = false;
1346             break;
1347 
1348         case angle::FormatID::R16G16B16A16_FLOAT:
1349             mIntendedGLFormat              = GL_RGBA16F;
1350             mActualSampleOnlyImageFormatID = angle::FormatID::R16G16B16A16_FLOAT;
1351             mImageInitializerFunction      = nullptr;
1352             mActualBufferFormatID          = angle::FormatID::R16G16B16A16_FLOAT;
1353             mVkBufferFormatIsPacked        = false;
1354             mVertexLoadFunction            = CopyNativeVertexData<GLhalf, 4, 4, 0>;
1355             mVertexLoadRequiresConversion  = false;
1356             break;
1357 
1358         case angle::FormatID::R16G16B16A16_SINT:
1359             mIntendedGLFormat              = GL_RGBA16I;
1360             mActualSampleOnlyImageFormatID = angle::FormatID::R16G16B16A16_SINT;
1361             mImageInitializerFunction      = nullptr;
1362             mActualBufferFormatID          = angle::FormatID::R16G16B16A16_SINT;
1363             mVkBufferFormatIsPacked        = false;
1364             mVertexLoadFunction            = CopyNativeVertexData<GLshort, 4, 4, 0>;
1365             mVertexLoadRequiresConversion  = false;
1366             break;
1367 
1368         case angle::FormatID::R16G16B16A16_SNORM:
1369             mIntendedGLFormat              = GL_RGBA16_SNORM_EXT;
1370             mActualSampleOnlyImageFormatID = angle::FormatID::R16G16B16A16_SNORM;
1371             mImageInitializerFunction      = nullptr;
1372             mActualBufferFormatID          = angle::FormatID::R16G16B16A16_SNORM;
1373             mVkBufferFormatIsPacked        = false;
1374             mVertexLoadFunction            = CopyNativeVertexData<GLshort, 4, 4, 0>;
1375             mVertexLoadRequiresConversion  = false;
1376             break;
1377 
1378         case angle::FormatID::R16G16B16A16_SSCALED:
1379             mIntendedGLFormat              = GL_RGBA16_SSCALED_ANGLEX;
1380             mActualSampleOnlyImageFormatID = angle::FormatID::R16G16B16A16_SSCALED;
1381             mImageInitializerFunction      = nullptr;
1382             {
1383                 static constexpr BufferFormatInitInfo kInfo[] = {
1384                     {angle::FormatID::R16G16B16A16_SSCALED, false,
1385                      CopyNativeVertexData<GLshort, 4, 4, 0>, false},
1386                     {angle::FormatID::R32G32B32A32_FLOAT, false,
1387                      CopyToFloatVertexData<GLshort, 4, 4, false, false>, true},
1388                     {angle::FormatID::R16G16B16A16_FLOAT, false,
1389                      CopyToFloatVertexData<GLshort, 4, 4, false, true>, true}};
1390                 initBufferFallback(renderer, kInfo, ArraySize(kInfo), 2);
1391             }
1392             break;
1393 
1394         case angle::FormatID::R16G16B16A16_UINT:
1395             mIntendedGLFormat              = GL_RGBA16UI;
1396             mActualSampleOnlyImageFormatID = angle::FormatID::R16G16B16A16_UINT;
1397             mImageInitializerFunction      = nullptr;
1398             mActualBufferFormatID          = angle::FormatID::R16G16B16A16_UINT;
1399             mVkBufferFormatIsPacked        = false;
1400             mVertexLoadFunction            = CopyNativeVertexData<GLushort, 4, 4, 0>;
1401             mVertexLoadRequiresConversion  = false;
1402             break;
1403 
1404         case angle::FormatID::R16G16B16A16_UNORM:
1405             mIntendedGLFormat              = GL_RGBA16_EXT;
1406             mActualSampleOnlyImageFormatID = angle::FormatID::R16G16B16A16_UNORM;
1407             mImageInitializerFunction      = nullptr;
1408             mActualBufferFormatID          = angle::FormatID::R16G16B16A16_UNORM;
1409             mVkBufferFormatIsPacked        = false;
1410             mVertexLoadFunction            = CopyNativeVertexData<GLushort, 4, 4, 0>;
1411             mVertexLoadRequiresConversion  = false;
1412             break;
1413 
1414         case angle::FormatID::R16G16B16A16_USCALED:
1415             mIntendedGLFormat              = GL_RGBA16_USCALED_ANGLEX;
1416             mActualSampleOnlyImageFormatID = angle::FormatID::R16G16B16A16_USCALED;
1417             mImageInitializerFunction      = nullptr;
1418             {
1419                 static constexpr BufferFormatInitInfo kInfo[] = {
1420                     {angle::FormatID::R16G16B16A16_USCALED, false,
1421                      CopyNativeVertexData<GLushort, 4, 4, 0>, false},
1422                     {angle::FormatID::R32G32B32A32_FLOAT, false,
1423                      CopyToFloatVertexData<GLushort, 4, 4, false, false>, true},
1424                     {angle::FormatID::R16G16B16A16_FLOAT, false,
1425                      CopyToFloatVertexData<GLushort, 4, 4, false, true>, true}};
1426                 initBufferFallback(renderer, kInfo, ArraySize(kInfo), 2);
1427             }
1428             break;
1429 
1430         case angle::FormatID::R16G16B16_FLOAT:
1431             mIntendedGLFormat = GL_RGB16F;
1432             {
1433                 static constexpr ImageFormatInitInfo kInfo[] = {
1434                     {angle::FormatID::R16G16B16_FLOAT, nullptr},
1435                     {angle::FormatID::R16G16B16A16_FLOAT,
1436                      Initialize4ComponentData<GLhalf, 0x0000, 0x0000, 0x0000, gl::Float16One>}};
1437                 initImageFallback(renderer, kInfo, ArraySize(kInfo));
1438             }
1439             {
1440                 static constexpr BufferFormatInitInfo kInfo[] = {
1441                     {angle::FormatID::R16G16B16_FLOAT, false, CopyNativeVertexData<GLhalf, 3, 3, 0>,
1442                      false},
1443                     {angle::FormatID::R16G16B16A16_FLOAT, false,
1444                      CopyNativeVertexData<GLhalf, 3, 4, gl::Float16One>, true}};
1445                 initBufferFallback(renderer, kInfo, ArraySize(kInfo), 2);
1446             }
1447             break;
1448 
1449         case angle::FormatID::R16G16B16_SINT:
1450             mIntendedGLFormat = GL_RGB16I;
1451             {
1452                 static constexpr ImageFormatInitInfo kInfo[] = {
1453                     {angle::FormatID::R16G16B16_SINT, nullptr},
1454                     {angle::FormatID::R16G16B16A16_SINT,
1455                      Initialize4ComponentData<GLshort, 0x0000, 0x0000, 0x0000, 0x0001>}};
1456                 initImageFallback(renderer, kInfo, ArraySize(kInfo));
1457             }
1458             {
1459                 static constexpr BufferFormatInitInfo kInfo[] = {
1460                     {angle::FormatID::R16G16B16_SINT, false, CopyNativeVertexData<GLshort, 3, 3, 0>,
1461                      false},
1462                     {angle::FormatID::R16G16B16A16_SINT, false,
1463                      CopyNativeVertexData<GLshort, 3, 4, 1>, true}};
1464                 initBufferFallback(renderer, kInfo, ArraySize(kInfo), 2);
1465             }
1466             break;
1467 
1468         case angle::FormatID::R16G16B16_SNORM:
1469             mIntendedGLFormat = GL_RGB16_SNORM_EXT;
1470             {
1471                 static constexpr ImageFormatInitInfo kInfo[] = {
1472                     {angle::FormatID::R16G16B16_SNORM, nullptr},
1473                     {angle::FormatID::R16G16B16A16_SNORM,
1474                      Initialize4ComponentData<GLushort, 0x0000, 0x0000, 0x0000, 0x7FFF>},
1475                     {angle::FormatID::R32G32B32_FLOAT, nullptr},
1476                     {angle::FormatID::R32G32B32A32_FLOAT,
1477                      Initialize4ComponentData<GLfloat, 0x00000000, 0x00000000, 0x00000000,
1478                                               gl::Float32One>}};
1479                 initImageFallback(renderer, kInfo, ArraySize(kInfo));
1480             }
1481             {
1482                 static constexpr BufferFormatInitInfo kInfo[] = {
1483                     {angle::FormatID::R16G16B16_SNORM, false,
1484                      CopyNativeVertexData<GLshort, 3, 3, 0>, false},
1485                     {angle::FormatID::R16G16B16A16_SNORM, false,
1486                      CopyNativeVertexData<GLshort, 3, 4, std::numeric_limits<GLshort>::max()>,
1487                      true},
1488                     {angle::FormatID::R32G32B32_FLOAT, false,
1489                      CopyToFloatVertexData<GLshort, 3, 3, true, false>, true},
1490                     {angle::FormatID::R16G16B16_FLOAT, false,
1491                      CopyToFloatVertexData<GLshort, 3, 3, true, true>, true},
1492                     {angle::FormatID::R16G16B16A16_FLOAT, false,
1493                      CopyToFloatVertexData<GLshort, 3, 4, true, true>, true}};
1494                 initBufferFallback(renderer, kInfo, ArraySize(kInfo), 3);
1495             }
1496             break;
1497 
1498         case angle::FormatID::R16G16B16_SSCALED:
1499             mIntendedGLFormat              = GL_RGB16_SSCALED_ANGLEX;
1500             mActualSampleOnlyImageFormatID = angle::FormatID::R16G16B16_SSCALED;
1501             mImageInitializerFunction      = nullptr;
1502             {
1503                 static constexpr BufferFormatInitInfo kInfo[] = {
1504                     {angle::FormatID::R16G16B16_SSCALED, false,
1505                      CopyNativeVertexData<GLshort, 3, 3, 0>, false},
1506                     {angle::FormatID::R16G16B16A16_SSCALED, false,
1507                      CopyNativeVertexData<GLshort, 3, 4, 1>, true},
1508                     {angle::FormatID::R32G32B32_FLOAT, false,
1509                      CopyToFloatVertexData<GLshort, 3, 3, false, false>, true},
1510                     {angle::FormatID::R16G16B16_FLOAT, false,
1511                      CopyToFloatVertexData<GLshort, 3, 3, false, true>, true},
1512                     {angle::FormatID::R16G16B16A16_FLOAT, false,
1513                      CopyToFloatVertexData<GLshort, 3, 4, false, true>, true}};
1514                 initBufferFallback(renderer, kInfo, ArraySize(kInfo), 3);
1515             }
1516             break;
1517 
1518         case angle::FormatID::R16G16B16_UINT:
1519             mIntendedGLFormat = GL_RGB16UI;
1520             {
1521                 static constexpr ImageFormatInitInfo kInfo[] = {
1522                     {angle::FormatID::R16G16B16_UINT, nullptr},
1523                     {angle::FormatID::R16G16B16A16_UINT,
1524                      Initialize4ComponentData<GLushort, 0x0000, 0x0000, 0x0000, 0x0001>}};
1525                 initImageFallback(renderer, kInfo, ArraySize(kInfo));
1526             }
1527             {
1528                 static constexpr BufferFormatInitInfo kInfo[] = {
1529                     {angle::FormatID::R16G16B16_UINT, false,
1530                      CopyNativeVertexData<GLushort, 3, 3, 0>, false},
1531                     {angle::FormatID::R16G16B16A16_UINT, false,
1532                      CopyNativeVertexData<GLushort, 3, 4, 1>, true}};
1533                 initBufferFallback(renderer, kInfo, ArraySize(kInfo), 2);
1534             }
1535             break;
1536 
1537         case angle::FormatID::R16G16B16_UNORM:
1538             mIntendedGLFormat = GL_RGB16_EXT;
1539             {
1540                 static constexpr ImageFormatInitInfo kInfo[] = {
1541                     {angle::FormatID::R16G16B16_UNORM, nullptr},
1542                     {angle::FormatID::R16G16B16A16_UNORM,
1543                      Initialize4ComponentData<GLushort, 0x0000, 0x0000, 0x0000, 0xFFFF>},
1544                     {angle::FormatID::R32G32B32_FLOAT, nullptr},
1545                     {angle::FormatID::R32G32B32A32_FLOAT,
1546                      Initialize4ComponentData<GLfloat, 0x00000000, 0x00000000, 0x00000000,
1547                                               gl::Float32One>}};
1548                 initImageFallback(renderer, kInfo, ArraySize(kInfo));
1549             }
1550             {
1551                 static constexpr BufferFormatInitInfo kInfo[] = {
1552                     {angle::FormatID::R16G16B16_UNORM, false,
1553                      CopyNativeVertexData<GLushort, 3, 3, 0>, false},
1554                     {angle::FormatID::R16G16B16A16_UNORM, false,
1555                      CopyNativeVertexData<GLushort, 3, 4, std::numeric_limits<GLushort>::max()>,
1556                      true},
1557                     {angle::FormatID::R32G32B32_FLOAT, false,
1558                      CopyToFloatVertexData<GLushort, 3, 3, true, false>, true},
1559                     {angle::FormatID::R16G16B16_FLOAT, false,
1560                      CopyToFloatVertexData<GLushort, 3, 3, true, true>, true},
1561                     {angle::FormatID::R16G16B16A16_FLOAT, false,
1562                      CopyToFloatVertexData<GLushort, 3, 4, true, true>, true}};
1563                 initBufferFallback(renderer, kInfo, ArraySize(kInfo), 3);
1564             }
1565             break;
1566 
1567         case angle::FormatID::R16G16B16_USCALED:
1568             mIntendedGLFormat              = GL_RGB16_USCALED_ANGLEX;
1569             mActualSampleOnlyImageFormatID = angle::FormatID::R16G16B16_USCALED;
1570             mImageInitializerFunction      = nullptr;
1571             {
1572                 static constexpr BufferFormatInitInfo kInfo[] = {
1573                     {angle::FormatID::R16G16B16_USCALED, false,
1574                      CopyNativeVertexData<GLushort, 3, 3, 0>, false},
1575                     {angle::FormatID::R16G16B16A16_USCALED, false,
1576                      CopyNativeVertexData<GLushort, 3, 4, 1>, true},
1577                     {angle::FormatID::R32G32B32_FLOAT, false,
1578                      CopyToFloatVertexData<GLushort, 3, 3, false, false>, true},
1579                     {angle::FormatID::R16G16B16_FLOAT, false,
1580                      CopyToFloatVertexData<GLushort, 3, 3, false, true>, true},
1581                     {angle::FormatID::R16G16B16A16_FLOAT, false,
1582                      CopyToFloatVertexData<GLushort, 3, 4, false, true>, true}};
1583                 initBufferFallback(renderer, kInfo, ArraySize(kInfo), 3);
1584             }
1585             break;
1586 
1587         case angle::FormatID::R16G16_FLOAT:
1588             mIntendedGLFormat              = GL_RG16F;
1589             mActualSampleOnlyImageFormatID = angle::FormatID::R16G16_FLOAT;
1590             mImageInitializerFunction      = nullptr;
1591             mActualBufferFormatID          = angle::FormatID::R16G16_FLOAT;
1592             mVkBufferFormatIsPacked        = false;
1593             mVertexLoadFunction            = CopyNativeVertexData<GLhalf, 2, 2, 0>;
1594             mVertexLoadRequiresConversion  = false;
1595             break;
1596 
1597         case angle::FormatID::R16G16_SINT:
1598             mIntendedGLFormat              = GL_RG16I;
1599             mActualSampleOnlyImageFormatID = angle::FormatID::R16G16_SINT;
1600             mImageInitializerFunction      = nullptr;
1601             mActualBufferFormatID          = angle::FormatID::R16G16_SINT;
1602             mVkBufferFormatIsPacked        = false;
1603             mVertexLoadFunction            = CopyNativeVertexData<GLshort, 2, 2, 0>;
1604             mVertexLoadRequiresConversion  = false;
1605             break;
1606 
1607         case angle::FormatID::R16G16_SNORM:
1608             mIntendedGLFormat              = GL_RG16_SNORM_EXT;
1609             mActualSampleOnlyImageFormatID = angle::FormatID::R16G16_SNORM;
1610             mImageInitializerFunction      = nullptr;
1611             mActualBufferFormatID          = angle::FormatID::R16G16_SNORM;
1612             mVkBufferFormatIsPacked        = false;
1613             mVertexLoadFunction            = CopyNativeVertexData<GLshort, 2, 2, 0>;
1614             mVertexLoadRequiresConversion  = false;
1615             break;
1616 
1617         case angle::FormatID::R16G16_SSCALED:
1618             mIntendedGLFormat              = GL_RG16_SSCALED_ANGLEX;
1619             mActualSampleOnlyImageFormatID = angle::FormatID::R16G16_SSCALED;
1620             mImageInitializerFunction      = nullptr;
1621             {
1622                 static constexpr BufferFormatInitInfo kInfo[] = {
1623                     {angle::FormatID::R16G16_SSCALED, false, CopyNativeVertexData<GLshort, 2, 2, 0>,
1624                      false},
1625                     {angle::FormatID::R16G16B16_SSCALED, false,
1626                      CopyNativeVertexData<GLshort, 2, 3, 0>, true},
1627                     {angle::FormatID::R32G32_FLOAT, false,
1628                      CopyToFloatVertexData<GLshort, 2, 2, false, false>, true},
1629                     {angle::FormatID::R16G16_FLOAT, false,
1630                      CopyToFloatVertexData<GLshort, 2, 2, false, true>, true}};
1631                 initBufferFallback(renderer, kInfo, ArraySize(kInfo), 3);
1632             }
1633             break;
1634 
1635         case angle::FormatID::R16G16_UINT:
1636             mIntendedGLFormat              = GL_RG16UI;
1637             mActualSampleOnlyImageFormatID = angle::FormatID::R16G16_UINT;
1638             mImageInitializerFunction      = nullptr;
1639             mActualBufferFormatID          = angle::FormatID::R16G16_UINT;
1640             mVkBufferFormatIsPacked        = false;
1641             mVertexLoadFunction            = CopyNativeVertexData<GLushort, 2, 2, 0>;
1642             mVertexLoadRequiresConversion  = false;
1643             break;
1644 
1645         case angle::FormatID::R16G16_UNORM:
1646             mIntendedGLFormat              = GL_RG16_EXT;
1647             mActualSampleOnlyImageFormatID = angle::FormatID::R16G16_UNORM;
1648             mImageInitializerFunction      = nullptr;
1649             mActualBufferFormatID          = angle::FormatID::R16G16_UNORM;
1650             mVkBufferFormatIsPacked        = false;
1651             mVertexLoadFunction            = CopyNativeVertexData<GLushort, 2, 2, 0>;
1652             mVertexLoadRequiresConversion  = false;
1653             break;
1654 
1655         case angle::FormatID::R16G16_USCALED:
1656             mIntendedGLFormat              = GL_RG16_USCALED_ANGLEX;
1657             mActualSampleOnlyImageFormatID = angle::FormatID::R16G16_USCALED;
1658             mImageInitializerFunction      = nullptr;
1659             {
1660                 static constexpr BufferFormatInitInfo kInfo[] = {
1661                     {angle::FormatID::R16G16_USCALED, false,
1662                      CopyNativeVertexData<GLushort, 2, 2, 0>, false},
1663                     {angle::FormatID::R16G16B16_USCALED, false,
1664                      CopyNativeVertexData<GLushort, 2, 3, 0>, true},
1665                     {angle::FormatID::R32G32_FLOAT, false,
1666                      CopyToFloatVertexData<GLushort, 2, 2, false, false>, true},
1667                     {angle::FormatID::R16G16_FLOAT, false,
1668                      CopyToFloatVertexData<GLushort, 2, 2, false, true>, true}};
1669                 initBufferFallback(renderer, kInfo, ArraySize(kInfo), 3);
1670             }
1671             break;
1672 
1673         case angle::FormatID::R16_FLOAT:
1674             mIntendedGLFormat              = GL_R16F;
1675             mActualSampleOnlyImageFormatID = angle::FormatID::R16_FLOAT;
1676             mImageInitializerFunction      = nullptr;
1677             mActualBufferFormatID          = angle::FormatID::R16_FLOAT;
1678             mVkBufferFormatIsPacked        = false;
1679             mVertexLoadFunction            = CopyNativeVertexData<GLhalf, 1, 1, 0>;
1680             mVertexLoadRequiresConversion  = false;
1681             break;
1682 
1683         case angle::FormatID::R16_SINT:
1684             mIntendedGLFormat              = GL_R16I;
1685             mActualSampleOnlyImageFormatID = angle::FormatID::R16_SINT;
1686             mImageInitializerFunction      = nullptr;
1687             mActualBufferFormatID          = angle::FormatID::R16_SINT;
1688             mVkBufferFormatIsPacked        = false;
1689             mVertexLoadFunction            = CopyNativeVertexData<GLshort, 1, 1, 0>;
1690             mVertexLoadRequiresConversion  = false;
1691             break;
1692 
1693         case angle::FormatID::R16_SNORM:
1694             mIntendedGLFormat              = GL_R16_SNORM_EXT;
1695             mActualSampleOnlyImageFormatID = angle::FormatID::R16_SNORM;
1696             mImageInitializerFunction      = nullptr;
1697             mActualBufferFormatID          = angle::FormatID::R16_SNORM;
1698             mVkBufferFormatIsPacked        = false;
1699             mVertexLoadFunction            = CopyNativeVertexData<GLshort, 1, 1, 0>;
1700             mVertexLoadRequiresConversion  = false;
1701             break;
1702 
1703         case angle::FormatID::R16_SSCALED:
1704             mIntendedGLFormat              = GL_R16_SSCALED_ANGLEX;
1705             mActualSampleOnlyImageFormatID = angle::FormatID::R16_SSCALED;
1706             mImageInitializerFunction      = nullptr;
1707             {
1708                 static constexpr BufferFormatInitInfo kInfo[] = {
1709                     {angle::FormatID::R16_SSCALED, false, CopyNativeVertexData<GLshort, 1, 1, 0>,
1710                      false},
1711                     {angle::FormatID::R32_FLOAT, false,
1712                      CopyToFloatVertexData<GLshort, 1, 1, false, false>, true},
1713                     {angle::FormatID::R16_FLOAT, false,
1714                      CopyToFloatVertexData<GLshort, 1, 1, false, true>, true}};
1715                 initBufferFallback(renderer, kInfo, ArraySize(kInfo), 2);
1716             }
1717             break;
1718 
1719         case angle::FormatID::R16_UINT:
1720             mIntendedGLFormat              = GL_R16UI;
1721             mActualSampleOnlyImageFormatID = angle::FormatID::R16_UINT;
1722             mImageInitializerFunction      = nullptr;
1723             mActualBufferFormatID          = angle::FormatID::R16_UINT;
1724             mVkBufferFormatIsPacked        = false;
1725             mVertexLoadFunction            = CopyNativeVertexData<GLushort, 1, 1, 0>;
1726             mVertexLoadRequiresConversion  = false;
1727             break;
1728 
1729         case angle::FormatID::R16_UNORM:
1730             mIntendedGLFormat              = GL_R16_EXT;
1731             mActualSampleOnlyImageFormatID = angle::FormatID::R16_UNORM;
1732             mImageInitializerFunction      = nullptr;
1733             mActualBufferFormatID          = angle::FormatID::R16_UNORM;
1734             mVkBufferFormatIsPacked        = false;
1735             mVertexLoadFunction            = CopyNativeVertexData<GLushort, 1, 1, 0>;
1736             mVertexLoadRequiresConversion  = false;
1737             break;
1738 
1739         case angle::FormatID::R16_USCALED:
1740             mIntendedGLFormat              = GL_R16_USCALED_ANGLEX;
1741             mActualSampleOnlyImageFormatID = angle::FormatID::R16_USCALED;
1742             mImageInitializerFunction      = nullptr;
1743             {
1744                 static constexpr BufferFormatInitInfo kInfo[] = {
1745                     {angle::FormatID::R16_USCALED, false, CopyNativeVertexData<GLushort, 1, 1, 0>,
1746                      false},
1747                     {angle::FormatID::R32_FLOAT, false,
1748                      CopyToFloatVertexData<GLushort, 1, 1, false, false>, true},
1749                     {angle::FormatID::R16_FLOAT, false,
1750                      CopyToFloatVertexData<GLushort, 1, 1, false, true>, true}};
1751                 initBufferFallback(renderer, kInfo, ArraySize(kInfo), 2);
1752             }
1753             break;
1754 
1755         case angle::FormatID::R32G32B32A32_FIXED:
1756             mIntendedGLFormat = GL_RGBA32_FIXED_ANGLEX;
1757 
1758             mActualBufferFormatID         = angle::FormatID::R32G32B32A32_FLOAT;
1759             mVkBufferFormatIsPacked       = false;
1760             mVertexLoadFunction           = Copy32FixedTo32FVertexData<4, 4>;
1761             mVertexLoadRequiresConversion = true;
1762             break;
1763 
1764         case angle::FormatID::R32G32B32A32_FLOAT:
1765             mIntendedGLFormat              = GL_RGBA32F;
1766             mActualSampleOnlyImageFormatID = angle::FormatID::R32G32B32A32_FLOAT;
1767             mImageInitializerFunction      = nullptr;
1768             {
1769                 static constexpr BufferFormatInitInfo kInfo[] = {
1770                     {angle::FormatID::R32G32B32A32_FLOAT, false,
1771                      CopyNativeVertexData<GLfloat, 4, 4, 0>, false},
1772                     {angle::FormatID::R16G16B16A16_FLOAT, false,
1773                      CopyToFloatVertexData<GLfloat, 4, 4, false, true>, true}};
1774                 initBufferFallback(renderer, kInfo, ArraySize(kInfo), 1);
1775             }
1776             break;
1777 
1778         case angle::FormatID::R32G32B32A32_SINT:
1779             mIntendedGLFormat              = GL_RGBA32I;
1780             mActualSampleOnlyImageFormatID = angle::FormatID::R32G32B32A32_SINT;
1781             mImageInitializerFunction      = nullptr;
1782             mActualBufferFormatID          = angle::FormatID::R32G32B32A32_SINT;
1783             mVkBufferFormatIsPacked        = false;
1784             mVertexLoadFunction            = CopyNativeVertexData<GLint, 4, 4, 0>;
1785             mVertexLoadRequiresConversion  = false;
1786             break;
1787 
1788         case angle::FormatID::R32G32B32A32_SNORM:
1789             mIntendedGLFormat = GL_RGBA32_SNORM_ANGLEX;
1790 
1791             mActualBufferFormatID         = angle::FormatID::R32G32B32A32_FLOAT;
1792             mVkBufferFormatIsPacked       = false;
1793             mVertexLoadFunction           = CopyToFloatVertexData<GLint, 4, 4, true, false>;
1794             mVertexLoadRequiresConversion = true;
1795             break;
1796 
1797         case angle::FormatID::R32G32B32A32_SSCALED:
1798             mIntendedGLFormat = GL_RGBA32_SSCALED_ANGLEX;
1799 
1800             mActualBufferFormatID         = angle::FormatID::R32G32B32A32_FLOAT;
1801             mVkBufferFormatIsPacked       = false;
1802             mVertexLoadFunction           = CopyToFloatVertexData<GLint, 4, 4, false, false>;
1803             mVertexLoadRequiresConversion = true;
1804             break;
1805 
1806         case angle::FormatID::R32G32B32A32_UINT:
1807             mIntendedGLFormat              = GL_RGBA32UI;
1808             mActualSampleOnlyImageFormatID = angle::FormatID::R32G32B32A32_UINT;
1809             mImageInitializerFunction      = nullptr;
1810             mActualBufferFormatID          = angle::FormatID::R32G32B32A32_UINT;
1811             mVkBufferFormatIsPacked        = false;
1812             mVertexLoadFunction            = CopyNativeVertexData<GLuint, 4, 4, 0>;
1813             mVertexLoadRequiresConversion  = false;
1814             break;
1815 
1816         case angle::FormatID::R32G32B32A32_UNORM:
1817             mIntendedGLFormat = GL_RGBA32_UNORM_ANGLEX;
1818 
1819             mActualBufferFormatID         = angle::FormatID::R32G32B32A32_FLOAT;
1820             mVkBufferFormatIsPacked       = false;
1821             mVertexLoadFunction           = CopyToFloatVertexData<GLuint, 4, 4, true, false>;
1822             mVertexLoadRequiresConversion = true;
1823             break;
1824 
1825         case angle::FormatID::R32G32B32A32_USCALED:
1826             mIntendedGLFormat = GL_RGBA32_USCALED_ANGLEX;
1827 
1828             mActualBufferFormatID         = angle::FormatID::R32G32B32A32_FLOAT;
1829             mVkBufferFormatIsPacked       = false;
1830             mVertexLoadFunction           = CopyToFloatVertexData<GLuint, 4, 4, false, false>;
1831             mVertexLoadRequiresConversion = true;
1832             break;
1833 
1834         case angle::FormatID::R32G32B32_FIXED:
1835             mIntendedGLFormat = GL_RGB32_FIXED_ANGLEX;
1836 
1837             mActualBufferFormatID         = angle::FormatID::R32G32B32_FLOAT;
1838             mVkBufferFormatIsPacked       = false;
1839             mVertexLoadFunction           = Copy32FixedTo32FVertexData<3, 3>;
1840             mVertexLoadRequiresConversion = true;
1841             break;
1842 
1843         case angle::FormatID::R32G32B32_FLOAT:
1844             mIntendedGLFormat = GL_RGB32F;
1845             {
1846                 static constexpr ImageFormatInitInfo kInfo[] = {
1847                     {angle::FormatID::R32G32B32_FLOAT, nullptr},
1848                     {angle::FormatID::R32G32B32A32_FLOAT,
1849                      Initialize4ComponentData<GLfloat, 0x00000000, 0x00000000, 0x00000000,
1850                                               gl::Float32One>}};
1851                 initImageFallback(renderer, kInfo, ArraySize(kInfo));
1852             }
1853             {
1854                 static constexpr BufferFormatInitInfo kInfo[] = {
1855                     {angle::FormatID::R32G32B32_FLOAT, false,
1856                      CopyNativeVertexData<GLfloat, 3, 3, 0>, false},
1857                     {angle::FormatID::R16G16B16_FLOAT, false,
1858                      CopyToFloatVertexData<GLfloat, 3, 3, false, true>, true},
1859                     {angle::FormatID::R16G16B16A16_FLOAT, false,
1860                      CopyToFloatVertexData<GLfloat, 3, 4, false, true>, true}};
1861                 initBufferFallback(renderer, kInfo, ArraySize(kInfo), 1);
1862             }
1863             break;
1864 
1865         case angle::FormatID::R32G32B32_SINT:
1866             mIntendedGLFormat = GL_RGB32I;
1867             {
1868                 static constexpr ImageFormatInitInfo kInfo[] = {
1869                     {angle::FormatID::R32G32B32_SINT, nullptr},
1870                     {angle::FormatID::R32G32B32A32_SINT,
1871                      Initialize4ComponentData<GLint, 0x00000000, 0x00000000, 0x00000000,
1872                                               0x00000001>}};
1873                 initImageFallback(renderer, kInfo, ArraySize(kInfo));
1874             }
1875             mActualBufferFormatID         = angle::FormatID::R32G32B32_SINT;
1876             mVkBufferFormatIsPacked       = false;
1877             mVertexLoadFunction           = CopyNativeVertexData<GLint, 3, 3, 0>;
1878             mVertexLoadRequiresConversion = false;
1879             break;
1880 
1881         case angle::FormatID::R32G32B32_SNORM:
1882             mIntendedGLFormat = GL_RGB32_SNORM_ANGLEX;
1883 
1884             mActualBufferFormatID         = angle::FormatID::R32G32B32_FLOAT;
1885             mVkBufferFormatIsPacked       = false;
1886             mVertexLoadFunction           = CopyToFloatVertexData<GLint, 3, 3, true, false>;
1887             mVertexLoadRequiresConversion = true;
1888             break;
1889 
1890         case angle::FormatID::R32G32B32_SSCALED:
1891             mIntendedGLFormat = GL_RGB32_SSCALED_ANGLEX;
1892 
1893             mActualBufferFormatID         = angle::FormatID::R32G32B32_FLOAT;
1894             mVkBufferFormatIsPacked       = false;
1895             mVertexLoadFunction           = CopyToFloatVertexData<GLint, 3, 3, false, false>;
1896             mVertexLoadRequiresConversion = true;
1897             break;
1898 
1899         case angle::FormatID::R32G32B32_UINT:
1900             mIntendedGLFormat = GL_RGB32UI;
1901             {
1902                 static constexpr ImageFormatInitInfo kInfo[] = {
1903                     {angle::FormatID::R32G32B32_UINT, nullptr},
1904                     {angle::FormatID::R32G32B32A32_UINT,
1905                      Initialize4ComponentData<GLuint, 0x00000000, 0x00000000, 0x00000000,
1906                                               0x00000001>}};
1907                 initImageFallback(renderer, kInfo, ArraySize(kInfo));
1908             }
1909             mActualBufferFormatID         = angle::FormatID::R32G32B32_UINT;
1910             mVkBufferFormatIsPacked       = false;
1911             mVertexLoadFunction           = CopyNativeVertexData<GLuint, 3, 3, 0>;
1912             mVertexLoadRequiresConversion = false;
1913             break;
1914 
1915         case angle::FormatID::R32G32B32_UNORM:
1916             mIntendedGLFormat = GL_RGB32_UNORM_ANGLEX;
1917 
1918             mActualBufferFormatID         = angle::FormatID::R32G32B32_FLOAT;
1919             mVkBufferFormatIsPacked       = false;
1920             mVertexLoadFunction           = CopyToFloatVertexData<GLuint, 3, 3, true, false>;
1921             mVertexLoadRequiresConversion = true;
1922             break;
1923 
1924         case angle::FormatID::R32G32B32_USCALED:
1925             mIntendedGLFormat = GL_RGB32_USCALED_ANGLEX;
1926 
1927             mActualBufferFormatID         = angle::FormatID::R32G32B32_FLOAT;
1928             mVkBufferFormatIsPacked       = false;
1929             mVertexLoadFunction           = CopyToFloatVertexData<GLuint, 3, 3, false, false>;
1930             mVertexLoadRequiresConversion = true;
1931             break;
1932 
1933         case angle::FormatID::R32G32_FIXED:
1934             mIntendedGLFormat = GL_RG32_FIXED_ANGLEX;
1935 
1936             mActualBufferFormatID         = angle::FormatID::R32G32_FLOAT;
1937             mVkBufferFormatIsPacked       = false;
1938             mVertexLoadFunction           = Copy32FixedTo32FVertexData<2, 2>;
1939             mVertexLoadRequiresConversion = true;
1940             break;
1941 
1942         case angle::FormatID::R32G32_FLOAT:
1943             mIntendedGLFormat              = GL_RG32F;
1944             mActualSampleOnlyImageFormatID = angle::FormatID::R32G32_FLOAT;
1945             mImageInitializerFunction      = nullptr;
1946             {
1947                 static constexpr BufferFormatInitInfo kInfo[] = {
1948                     {angle::FormatID::R32G32_FLOAT, false, CopyNativeVertexData<GLfloat, 2, 2, 0>,
1949                      false},
1950                     {angle::FormatID::R16G16_FLOAT, false,
1951                      CopyToFloatVertexData<GLfloat, 2, 2, false, true>, true}};
1952                 initBufferFallback(renderer, kInfo, ArraySize(kInfo), 1);
1953             }
1954             break;
1955 
1956         case angle::FormatID::R32G32_SINT:
1957             mIntendedGLFormat              = GL_RG32I;
1958             mActualSampleOnlyImageFormatID = angle::FormatID::R32G32_SINT;
1959             mImageInitializerFunction      = nullptr;
1960             mActualBufferFormatID          = angle::FormatID::R32G32_SINT;
1961             mVkBufferFormatIsPacked        = false;
1962             mVertexLoadFunction            = CopyNativeVertexData<GLint, 2, 2, 0>;
1963             mVertexLoadRequiresConversion  = false;
1964             break;
1965 
1966         case angle::FormatID::R32G32_SNORM:
1967             mIntendedGLFormat = GL_RG32_SNORM_ANGLEX;
1968 
1969             mActualBufferFormatID         = angle::FormatID::R32G32_FLOAT;
1970             mVkBufferFormatIsPacked       = false;
1971             mVertexLoadFunction           = CopyToFloatVertexData<GLint, 2, 2, true, false>;
1972             mVertexLoadRequiresConversion = true;
1973             break;
1974 
1975         case angle::FormatID::R32G32_SSCALED:
1976             mIntendedGLFormat = GL_RG32_SSCALED_ANGLEX;
1977 
1978             mActualBufferFormatID         = angle::FormatID::R32G32_FLOAT;
1979             mVkBufferFormatIsPacked       = false;
1980             mVertexLoadFunction           = CopyToFloatVertexData<GLint, 2, 2, false, false>;
1981             mVertexLoadRequiresConversion = true;
1982             break;
1983 
1984         case angle::FormatID::R32G32_UINT:
1985             mIntendedGLFormat              = GL_RG32UI;
1986             mActualSampleOnlyImageFormatID = angle::FormatID::R32G32_UINT;
1987             mImageInitializerFunction      = nullptr;
1988             mActualBufferFormatID          = angle::FormatID::R32G32_UINT;
1989             mVkBufferFormatIsPacked        = false;
1990             mVertexLoadFunction            = CopyNativeVertexData<GLuint, 2, 2, 0>;
1991             mVertexLoadRequiresConversion  = false;
1992             break;
1993 
1994         case angle::FormatID::R32G32_UNORM:
1995             mIntendedGLFormat = GL_RG32_UNORM_ANGLEX;
1996 
1997             mActualBufferFormatID         = angle::FormatID::R32G32_FLOAT;
1998             mVkBufferFormatIsPacked       = false;
1999             mVertexLoadFunction           = CopyToFloatVertexData<GLuint, 2, 2, true, false>;
2000             mVertexLoadRequiresConversion = true;
2001             break;
2002 
2003         case angle::FormatID::R32G32_USCALED:
2004             mIntendedGLFormat = GL_RG32_USCALED_ANGLEX;
2005 
2006             mActualBufferFormatID         = angle::FormatID::R32G32_FLOAT;
2007             mVkBufferFormatIsPacked       = false;
2008             mVertexLoadFunction           = CopyToFloatVertexData<GLuint, 2, 2, false, false>;
2009             mVertexLoadRequiresConversion = true;
2010             break;
2011 
2012         case angle::FormatID::R32_FIXED:
2013             mIntendedGLFormat = GL_R32_FIXED_ANGLEX;
2014 
2015             mActualBufferFormatID         = angle::FormatID::R32_FLOAT;
2016             mVkBufferFormatIsPacked       = false;
2017             mVertexLoadFunction           = Copy32FixedTo32FVertexData<1, 1>;
2018             mVertexLoadRequiresConversion = true;
2019             break;
2020 
2021         case angle::FormatID::R32_FLOAT:
2022             mIntendedGLFormat              = GL_R32F;
2023             mActualSampleOnlyImageFormatID = angle::FormatID::R32_FLOAT;
2024             mImageInitializerFunction      = nullptr;
2025             {
2026                 static constexpr BufferFormatInitInfo kInfo[] = {
2027                     {angle::FormatID::R32_FLOAT, false, CopyNativeVertexData<GLfloat, 1, 1, 0>,
2028                      false},
2029                     {angle::FormatID::R16_FLOAT, false,
2030                      CopyToFloatVertexData<GLfloat, 1, 1, false, true>, true}};
2031                 initBufferFallback(renderer, kInfo, ArraySize(kInfo), 1);
2032             }
2033             break;
2034 
2035         case angle::FormatID::R32_SINT:
2036             mIntendedGLFormat              = GL_R32I;
2037             mActualSampleOnlyImageFormatID = angle::FormatID::R32_SINT;
2038             mImageInitializerFunction      = nullptr;
2039             mActualBufferFormatID          = angle::FormatID::R32_SINT;
2040             mVkBufferFormatIsPacked        = false;
2041             mVertexLoadFunction            = CopyNativeVertexData<GLint, 1, 1, 0>;
2042             mVertexLoadRequiresConversion  = false;
2043             break;
2044 
2045         case angle::FormatID::R32_SNORM:
2046             mIntendedGLFormat = GL_R32_SNORM_ANGLEX;
2047 
2048             mActualBufferFormatID         = angle::FormatID::R32_FLOAT;
2049             mVkBufferFormatIsPacked       = false;
2050             mVertexLoadFunction           = CopyToFloatVertexData<GLint, 1, 1, true, false>;
2051             mVertexLoadRequiresConversion = true;
2052             break;
2053 
2054         case angle::FormatID::R32_SSCALED:
2055             mIntendedGLFormat = GL_R32_SSCALED_ANGLEX;
2056 
2057             mActualBufferFormatID         = angle::FormatID::R32_FLOAT;
2058             mVkBufferFormatIsPacked       = false;
2059             mVertexLoadFunction           = CopyToFloatVertexData<GLint, 1, 1, false, false>;
2060             mVertexLoadRequiresConversion = true;
2061             break;
2062 
2063         case angle::FormatID::R32_UINT:
2064             mIntendedGLFormat              = GL_R32UI;
2065             mActualSampleOnlyImageFormatID = angle::FormatID::R32_UINT;
2066             mImageInitializerFunction      = nullptr;
2067             mActualBufferFormatID          = angle::FormatID::R32_UINT;
2068             mVkBufferFormatIsPacked        = false;
2069             mVertexLoadFunction            = CopyNativeVertexData<GLuint, 1, 1, 0>;
2070             mVertexLoadRequiresConversion  = false;
2071             break;
2072 
2073         case angle::FormatID::R32_UNORM:
2074             mIntendedGLFormat = GL_R32_UNORM_ANGLEX;
2075 
2076             mActualBufferFormatID         = angle::FormatID::R32_FLOAT;
2077             mVkBufferFormatIsPacked       = false;
2078             mVertexLoadFunction           = CopyToFloatVertexData<GLuint, 1, 1, true, false>;
2079             mVertexLoadRequiresConversion = true;
2080             break;
2081 
2082         case angle::FormatID::R32_USCALED:
2083             mIntendedGLFormat = GL_R32_USCALED_ANGLEX;
2084 
2085             mActualBufferFormatID         = angle::FormatID::R32_FLOAT;
2086             mVkBufferFormatIsPacked       = false;
2087             mVertexLoadFunction           = CopyToFloatVertexData<GLuint, 1, 1, false, false>;
2088             mVertexLoadRequiresConversion = true;
2089             break;
2090 
2091         case angle::FormatID::R4G4B4A4_UNORM:
2092             mIntendedGLFormat = GL_RGBA4;
2093             {
2094                 static constexpr ImageFormatInitInfo kInfo[] = {
2095                     {angle::FormatID::R4G4B4A4_UNORM, nullptr},
2096                     {angle::FormatID::R8G8B8A8_UNORM, nullptr}};
2097                 initImageFallback(renderer, kInfo, ArraySize(kInfo));
2098             }
2099             mActualBufferFormatID         = angle::FormatID::R4G4B4A4_UNORM;
2100             mVkBufferFormatIsPacked       = true;
2101             mVertexLoadFunction           = CopyNativeVertexData<GLushort, 1, 1, 0>;
2102             mVertexLoadRequiresConversion = false;
2103             break;
2104 
2105         case angle::FormatID::R5G5B5A1_UNORM:
2106             mIntendedGLFormat = GL_RGB5_A1;
2107             {
2108                 static constexpr ImageFormatInitInfo kInfo[] = {
2109                     {angle::FormatID::R5G5B5A1_UNORM, nullptr},
2110                     {angle::FormatID::A1R5G5B5_UNORM, nullptr}};
2111                 initImageFallback(renderer, kInfo, ArraySize(kInfo));
2112             }
2113             mActualBufferFormatID         = angle::FormatID::R5G5B5A1_UNORM;
2114             mVkBufferFormatIsPacked       = true;
2115             mVertexLoadFunction           = CopyNativeVertexData<GLushort, 1, 1, 0>;
2116             mVertexLoadRequiresConversion = false;
2117             break;
2118 
2119         case angle::FormatID::R5G6B5_UNORM:
2120             mIntendedGLFormat              = GL_RGB565;
2121             mActualSampleOnlyImageFormatID = angle::FormatID::R5G6B5_UNORM;
2122             mImageInitializerFunction      = nullptr;
2123             mActualBufferFormatID          = angle::FormatID::R5G6B5_UNORM;
2124             mVkBufferFormatIsPacked        = true;
2125             mVertexLoadFunction            = CopyNativeVertexData<GLushort, 1, 1, 0>;
2126             mVertexLoadRequiresConversion  = false;
2127             break;
2128 
2129         case angle::FormatID::R8G8B8A8_SINT:
2130             mIntendedGLFormat              = GL_RGBA8I;
2131             mActualSampleOnlyImageFormatID = angle::FormatID::R8G8B8A8_SINT;
2132             mImageInitializerFunction      = nullptr;
2133             mActualBufferFormatID          = angle::FormatID::R8G8B8A8_SINT;
2134             mVkBufferFormatIsPacked        = false;
2135             mVertexLoadFunction            = CopyNativeVertexData<GLbyte, 4, 4, 0>;
2136             mVertexLoadRequiresConversion  = false;
2137             break;
2138 
2139         case angle::FormatID::R8G8B8A8_SNORM:
2140             mIntendedGLFormat              = GL_RGBA8_SNORM;
2141             mActualSampleOnlyImageFormatID = angle::FormatID::R8G8B8A8_SNORM;
2142             mImageInitializerFunction      = nullptr;
2143             mActualBufferFormatID          = angle::FormatID::R8G8B8A8_SNORM;
2144             mVkBufferFormatIsPacked        = false;
2145             mVertexLoadFunction            = CopyNativeVertexData<GLbyte, 4, 4, 0>;
2146             mVertexLoadRequiresConversion  = false;
2147             break;
2148 
2149         case angle::FormatID::R8G8B8A8_SSCALED:
2150             mIntendedGLFormat              = GL_RGBA8_SSCALED_ANGLEX;
2151             mActualSampleOnlyImageFormatID = angle::FormatID::R8G8B8A8_SSCALED;
2152             mImageInitializerFunction      = nullptr;
2153             {
2154                 static constexpr BufferFormatInitInfo kInfo[] = {
2155                     {angle::FormatID::R8G8B8A8_SSCALED, false,
2156                      CopyNativeVertexData<GLbyte, 4, 4, 0>, false},
2157                     {angle::FormatID::R16G16B16A16_FLOAT, false,
2158                      CopyToFloatVertexData<GLbyte, 4, 4, false, true>, true}};
2159                 initBufferFallback(renderer, kInfo, ArraySize(kInfo), 2);
2160             }
2161             break;
2162 
2163         case angle::FormatID::R8G8B8A8_TYPELESS:
2164             // This format is not implemented in Vulkan.
2165             break;
2166 
2167         case angle::FormatID::R8G8B8A8_TYPELESS_SRGB:
2168             // This format is not implemented in Vulkan.
2169             break;
2170 
2171         case angle::FormatID::R8G8B8A8_UINT:
2172             mIntendedGLFormat              = GL_RGBA8UI;
2173             mActualSampleOnlyImageFormatID = angle::FormatID::R8G8B8A8_UINT;
2174             mImageInitializerFunction      = nullptr;
2175             mActualBufferFormatID          = angle::FormatID::R8G8B8A8_UINT;
2176             mVkBufferFormatIsPacked        = false;
2177             mVertexLoadFunction            = CopyNativeVertexData<GLubyte, 4, 4, 0>;
2178             mVertexLoadRequiresConversion  = false;
2179             break;
2180 
2181         case angle::FormatID::R8G8B8A8_UNORM:
2182             mIntendedGLFormat              = GL_RGBA8;
2183             mActualSampleOnlyImageFormatID = angle::FormatID::R8G8B8A8_UNORM;
2184             mImageInitializerFunction      = nullptr;
2185             mActualBufferFormatID          = angle::FormatID::R8G8B8A8_UNORM;
2186             mVkBufferFormatIsPacked        = false;
2187             mVertexLoadFunction            = CopyNativeVertexData<GLubyte, 4, 4, 0>;
2188             mVertexLoadRequiresConversion  = false;
2189             break;
2190 
2191         case angle::FormatID::R8G8B8A8_UNORM_SRGB:
2192             mIntendedGLFormat              = GL_SRGB8_ALPHA8;
2193             mActualSampleOnlyImageFormatID = angle::FormatID::R8G8B8A8_UNORM_SRGB;
2194             mImageInitializerFunction      = nullptr;
2195             mActualBufferFormatID          = angle::FormatID::R8G8B8A8_UNORM_SRGB;
2196             mVkBufferFormatIsPacked        = false;
2197             mVertexLoadFunction            = CopyNativeVertexData<GLubyte, 4, 4, 0>;
2198             mVertexLoadRequiresConversion  = false;
2199             break;
2200 
2201         case angle::FormatID::R8G8B8A8_USCALED:
2202             mIntendedGLFormat              = GL_RGBA8_USCALED_ANGLEX;
2203             mActualSampleOnlyImageFormatID = angle::FormatID::R8G8B8A8_USCALED;
2204             mImageInitializerFunction      = nullptr;
2205             {
2206                 static constexpr BufferFormatInitInfo kInfo[] = {
2207                     {angle::FormatID::R8G8B8A8_USCALED, false,
2208                      CopyNativeVertexData<GLubyte, 4, 4, 0>, false},
2209                     {angle::FormatID::R16G16B16A16_FLOAT, false,
2210                      CopyToFloatVertexData<GLubyte, 4, 4, false, true>, true}};
2211                 initBufferFallback(renderer, kInfo, ArraySize(kInfo), 2);
2212             }
2213             break;
2214 
2215         case angle::FormatID::R8G8B8X8_UNORM:
2216             mIntendedGLFormat              = GL_RGBX8_ANGLE;
2217             mActualSampleOnlyImageFormatID = angle::FormatID::R8G8B8A8_UNORM;
2218             mImageInitializerFunction      = nullptr;
2219             mActualBufferFormatID          = angle::FormatID::NONE;
2220             mVkBufferFormatIsPacked        = false;
2221             mVertexLoadFunction            = nullptr;
2222             mVertexLoadRequiresConversion  = true;
2223             break;
2224 
2225         case angle::FormatID::R8G8B8_SINT:
2226             mIntendedGLFormat = GL_RGB8I;
2227             {
2228                 static constexpr ImageFormatInitInfo kInfo[] = {
2229                     {angle::FormatID::R8G8B8_SINT, nullptr},
2230                     {angle::FormatID::R8G8B8A8_SINT,
2231                      Initialize4ComponentData<GLbyte, 0x00, 0x00, 0x00, 0x01>}};
2232                 initImageFallback(renderer, kInfo, ArraySize(kInfo));
2233             }
2234             {
2235                 static constexpr BufferFormatInitInfo kInfo[] = {
2236                     {angle::FormatID::R8G8B8_SINT, false, CopyNativeVertexData<GLbyte, 3, 3, 0>,
2237                      false},
2238                     {angle::FormatID::R8G8B8A8_SINT, false, CopyNativeVertexData<GLbyte, 3, 4, 1>,
2239                      true}};
2240                 initBufferFallback(renderer, kInfo, ArraySize(kInfo), 2);
2241             }
2242             break;
2243 
2244         case angle::FormatID::R8G8B8_SNORM:
2245             mIntendedGLFormat = GL_RGB8_SNORM;
2246             {
2247                 static constexpr ImageFormatInitInfo kInfo[] = {
2248                     {angle::FormatID::R8G8B8_SNORM, nullptr},
2249                     {angle::FormatID::R8G8B8A8_SNORM,
2250                      Initialize4ComponentData<GLbyte, 0x00, 0x00, 0x00, 0x7F>}};
2251                 initImageFallback(renderer, kInfo, ArraySize(kInfo));
2252             }
2253             {
2254                 static constexpr BufferFormatInitInfo kInfo[] = {
2255                     {angle::FormatID::R8G8B8_SNORM, false, CopyNativeVertexData<GLbyte, 3, 3, 0>,
2256                      false},
2257                     {angle::FormatID::R8G8B8A8_SNORM, false,
2258                      CopyNativeVertexData<GLbyte, 3, 4, std::numeric_limits<GLbyte>::max()>, true}};
2259                 initBufferFallback(renderer, kInfo, ArraySize(kInfo), 2);
2260             }
2261             break;
2262 
2263         case angle::FormatID::R8G8B8_SSCALED:
2264             mIntendedGLFormat              = GL_RGB8_SSCALED_ANGLEX;
2265             mActualSampleOnlyImageFormatID = angle::FormatID::R8G8B8_SSCALED;
2266             mImageInitializerFunction      = nullptr;
2267             {
2268                 static constexpr BufferFormatInitInfo kInfo[] = {
2269                     {angle::FormatID::R8G8B8_SSCALED, false, CopyNativeVertexData<GLbyte, 3, 3, 0>,
2270                      false},
2271                     {angle::FormatID::R8G8B8A8_SSCALED, false,
2272                      CopyNativeVertexData<GLbyte, 3, 4, 1>, true},
2273                     {angle::FormatID::R16G16B16_FLOAT, false,
2274                      CopyToFloatVertexData<GLbyte, 3, 3, false, true>, true},
2275                     {angle::FormatID::R16G16B16A16_FLOAT, false,
2276                      CopyToFloatVertexData<GLbyte, 3, 4, false, true>, true}};
2277                 initBufferFallback(renderer, kInfo, ArraySize(kInfo), 4);
2278             }
2279             break;
2280 
2281         case angle::FormatID::R8G8B8_UINT:
2282             mIntendedGLFormat = GL_RGB8UI;
2283             {
2284                 static constexpr ImageFormatInitInfo kInfo[] = {
2285                     {angle::FormatID::R8G8B8_UINT, nullptr},
2286                     {angle::FormatID::R8G8B8A8_UINT,
2287                      Initialize4ComponentData<GLubyte, 0x00, 0x00, 0x00, 0x01>}};
2288                 initImageFallback(renderer, kInfo, ArraySize(kInfo));
2289             }
2290             {
2291                 static constexpr BufferFormatInitInfo kInfo[] = {
2292                     {angle::FormatID::R8G8B8_UINT, false, CopyNativeVertexData<GLubyte, 3, 3, 0>,
2293                      false},
2294                     {angle::FormatID::R8G8B8A8_UINT, false, CopyNativeVertexData<GLubyte, 3, 4, 1>,
2295                      true}};
2296                 initBufferFallback(renderer, kInfo, ArraySize(kInfo), 2);
2297             }
2298             break;
2299 
2300         case angle::FormatID::R8G8B8_UNORM:
2301             mIntendedGLFormat = GL_RGB8;
2302             {
2303                 static constexpr ImageFormatInitInfo kInfo[] = {
2304                     {angle::FormatID::R8G8B8_UNORM, nullptr},
2305                     {angle::FormatID::R8G8B8A8_UNORM,
2306                      Initialize4ComponentData<GLubyte, 0x00, 0x00, 0x00, 0xFF>}};
2307                 initImageFallback(renderer, kInfo, ArraySize(kInfo));
2308             }
2309             {
2310                 static constexpr BufferFormatInitInfo kInfo[] = {
2311                     {angle::FormatID::R8G8B8_UNORM, false, CopyNativeVertexData<GLubyte, 3, 3, 0>,
2312                      false},
2313                     {angle::FormatID::R8G8B8A8_UNORM, false,
2314                      CopyNativeVertexData<GLubyte, 3, 4, std::numeric_limits<GLubyte>::max()>,
2315                      true}};
2316                 initBufferFallback(renderer, kInfo, ArraySize(kInfo), 2);
2317             }
2318             break;
2319 
2320         case angle::FormatID::R8G8B8_UNORM_SRGB:
2321             mIntendedGLFormat = GL_SRGB8;
2322             {
2323                 static constexpr ImageFormatInitInfo kInfo[] = {
2324                     {angle::FormatID::R8G8B8_UNORM_SRGB, nullptr},
2325                     {angle::FormatID::R8G8B8A8_UNORM_SRGB,
2326                      Initialize4ComponentData<GLubyte, 0x00, 0x00, 0x00, 0xFF>}};
2327                 initImageFallback(renderer, kInfo, ArraySize(kInfo));
2328             }
2329             mActualBufferFormatID         = angle::FormatID::R8G8B8_UNORM_SRGB;
2330             mVkBufferFormatIsPacked       = false;
2331             mVertexLoadFunction           = CopyNativeVertexData<GLubyte, 3, 3, 0>;
2332             mVertexLoadRequiresConversion = false;
2333             break;
2334 
2335         case angle::FormatID::R8G8B8_USCALED:
2336             mIntendedGLFormat              = GL_RGB8_USCALED_ANGLEX;
2337             mActualSampleOnlyImageFormatID = angle::FormatID::R8G8B8_USCALED;
2338             mImageInitializerFunction      = nullptr;
2339             {
2340                 static constexpr BufferFormatInitInfo kInfo[] = {
2341                     {angle::FormatID::R8G8B8_USCALED, false, CopyNativeVertexData<GLubyte, 3, 3, 0>,
2342                      false},
2343                     {angle::FormatID::R8G8B8A8_USCALED, false,
2344                      CopyNativeVertexData<GLubyte, 3, 4, 1>, true},
2345                     {angle::FormatID::R16G16B16_FLOAT, false,
2346                      CopyToFloatVertexData<GLubyte, 3, 3, false, true>, true},
2347                     {angle::FormatID::R16G16B16A16_FLOAT, false,
2348                      CopyToFloatVertexData<GLubyte, 3, 4, false, true>, true}};
2349                 initBufferFallback(renderer, kInfo, ArraySize(kInfo), 4);
2350             }
2351             break;
2352 
2353         case angle::FormatID::R8G8_SINT:
2354             mIntendedGLFormat              = GL_RG8I;
2355             mActualSampleOnlyImageFormatID = angle::FormatID::R8G8_SINT;
2356             mImageInitializerFunction      = nullptr;
2357             mActualBufferFormatID          = angle::FormatID::R8G8_SINT;
2358             mVkBufferFormatIsPacked        = false;
2359             mVertexLoadFunction            = CopyNativeVertexData<GLbyte, 2, 2, 0>;
2360             mVertexLoadRequiresConversion  = false;
2361             break;
2362 
2363         case angle::FormatID::R8G8_SNORM:
2364             mIntendedGLFormat              = GL_RG8_SNORM;
2365             mActualSampleOnlyImageFormatID = angle::FormatID::R8G8_SNORM;
2366             mImageInitializerFunction      = nullptr;
2367             mActualBufferFormatID          = angle::FormatID::R8G8_SNORM;
2368             mVkBufferFormatIsPacked        = false;
2369             mVertexLoadFunction            = CopyNativeVertexData<GLbyte, 2, 2, 0>;
2370             mVertexLoadRequiresConversion  = false;
2371             break;
2372 
2373         case angle::FormatID::R8G8_SSCALED:
2374             mIntendedGLFormat              = GL_RG8_SSCALED_ANGLEX;
2375             mActualSampleOnlyImageFormatID = angle::FormatID::R8G8_SSCALED;
2376             mImageInitializerFunction      = nullptr;
2377             {
2378                 static constexpr BufferFormatInitInfo kInfo[] = {
2379                     {angle::FormatID::R8G8_SSCALED, false, CopyNativeVertexData<GLbyte, 2, 2, 0>,
2380                      false},
2381                     {angle::FormatID::R8G8B8_SSCALED, false, CopyNativeVertexData<GLbyte, 2, 3, 0>,
2382                      true},
2383                     {angle::FormatID::R16G16_FLOAT, false,
2384                      CopyToFloatVertexData<GLbyte, 2, 2, false, true>, true}};
2385                 initBufferFallback(renderer, kInfo, ArraySize(kInfo), 3);
2386             }
2387             break;
2388 
2389         case angle::FormatID::R8G8_UINT:
2390             mIntendedGLFormat              = GL_RG8UI;
2391             mActualSampleOnlyImageFormatID = angle::FormatID::R8G8_UINT;
2392             mImageInitializerFunction      = nullptr;
2393             mActualBufferFormatID          = angle::FormatID::R8G8_UINT;
2394             mVkBufferFormatIsPacked        = false;
2395             mVertexLoadFunction            = CopyNativeVertexData<GLubyte, 2, 2, 0>;
2396             mVertexLoadRequiresConversion  = false;
2397             break;
2398 
2399         case angle::FormatID::R8G8_UNORM:
2400             mIntendedGLFormat              = GL_RG8;
2401             mActualSampleOnlyImageFormatID = angle::FormatID::R8G8_UNORM;
2402             mImageInitializerFunction      = nullptr;
2403             mActualBufferFormatID          = angle::FormatID::R8G8_UNORM;
2404             mVkBufferFormatIsPacked        = false;
2405             mVertexLoadFunction            = CopyNativeVertexData<GLubyte, 2, 2, 0>;
2406             mVertexLoadRequiresConversion  = false;
2407             break;
2408 
2409         case angle::FormatID::R8G8_UNORM_SRGB:
2410             mIntendedGLFormat              = GL_SRG8_EXT;
2411             mActualSampleOnlyImageFormatID = angle::FormatID::R8G8_UNORM_SRGB;
2412             mImageInitializerFunction      = nullptr;
2413             mActualBufferFormatID          = angle::FormatID::R8G8_UNORM_SRGB;
2414             mVkBufferFormatIsPacked        = false;
2415             mVertexLoadFunction            = CopyNativeVertexData<GLubyte, 2, 2, 0>;
2416             mVertexLoadRequiresConversion  = false;
2417             break;
2418 
2419         case angle::FormatID::R8G8_USCALED:
2420             mIntendedGLFormat              = GL_RG8_USCALED_ANGLEX;
2421             mActualSampleOnlyImageFormatID = angle::FormatID::R8G8_USCALED;
2422             mImageInitializerFunction      = nullptr;
2423             {
2424                 static constexpr BufferFormatInitInfo kInfo[] = {
2425                     {angle::FormatID::R8G8_USCALED, false, CopyNativeVertexData<GLubyte, 2, 2, 0>,
2426                      false},
2427                     {angle::FormatID::R8G8B8_USCALED, false, CopyNativeVertexData<GLubyte, 2, 3, 0>,
2428                      true},
2429                     {angle::FormatID::R16G16_FLOAT, false,
2430                      CopyToFloatVertexData<GLubyte, 2, 2, false, true>, true}};
2431                 initBufferFallback(renderer, kInfo, ArraySize(kInfo), 3);
2432             }
2433             break;
2434 
2435         case angle::FormatID::R8_SINT:
2436             mIntendedGLFormat              = GL_R8I;
2437             mActualSampleOnlyImageFormatID = angle::FormatID::R8_SINT;
2438             mImageInitializerFunction      = nullptr;
2439             mActualBufferFormatID          = angle::FormatID::R8_SINT;
2440             mVkBufferFormatIsPacked        = false;
2441             mVertexLoadFunction            = CopyNativeVertexData<GLbyte, 1, 1, 0>;
2442             mVertexLoadRequiresConversion  = false;
2443             break;
2444 
2445         case angle::FormatID::R8_SNORM:
2446             mIntendedGLFormat              = GL_R8_SNORM;
2447             mActualSampleOnlyImageFormatID = angle::FormatID::R8_SNORM;
2448             mImageInitializerFunction      = nullptr;
2449             mActualBufferFormatID          = angle::FormatID::R8_SNORM;
2450             mVkBufferFormatIsPacked        = false;
2451             mVertexLoadFunction            = CopyNativeVertexData<GLbyte, 1, 1, 0>;
2452             mVertexLoadRequiresConversion  = false;
2453             break;
2454 
2455         case angle::FormatID::R8_SSCALED:
2456             mIntendedGLFormat              = GL_R8_SSCALED_ANGLEX;
2457             mActualSampleOnlyImageFormatID = angle::FormatID::R8_SSCALED;
2458             mImageInitializerFunction      = nullptr;
2459             {
2460                 static constexpr BufferFormatInitInfo kInfo[] = {
2461                     {angle::FormatID::R8_SSCALED, false, CopyNativeVertexData<GLbyte, 1, 1, 0>,
2462                      false},
2463                     {angle::FormatID::R16_FLOAT, false,
2464                      CopyToFloatVertexData<GLbyte, 1, 1, false, true>, true}};
2465                 initBufferFallback(renderer, kInfo, ArraySize(kInfo), 2);
2466             }
2467             break;
2468 
2469         case angle::FormatID::R8_UINT:
2470             mIntendedGLFormat              = GL_R8UI;
2471             mActualSampleOnlyImageFormatID = angle::FormatID::R8_UINT;
2472             mImageInitializerFunction      = nullptr;
2473             mActualBufferFormatID          = angle::FormatID::R8_UINT;
2474             mVkBufferFormatIsPacked        = false;
2475             mVertexLoadFunction            = CopyNativeVertexData<GLubyte, 1, 1, 0>;
2476             mVertexLoadRequiresConversion  = false;
2477             break;
2478 
2479         case angle::FormatID::R8_UNORM:
2480             mIntendedGLFormat              = GL_R8;
2481             mActualSampleOnlyImageFormatID = angle::FormatID::R8_UNORM;
2482             mImageInitializerFunction      = nullptr;
2483             mActualBufferFormatID          = angle::FormatID::R8_UNORM;
2484             mVkBufferFormatIsPacked        = false;
2485             mVertexLoadFunction            = CopyNativeVertexData<GLubyte, 1, 1, 0>;
2486             mVertexLoadRequiresConversion  = false;
2487             break;
2488 
2489         case angle::FormatID::R8_UNORM_SRGB:
2490             mIntendedGLFormat              = GL_SR8_EXT;
2491             mActualSampleOnlyImageFormatID = angle::FormatID::R8_UNORM_SRGB;
2492             mImageInitializerFunction      = nullptr;
2493             mActualBufferFormatID          = angle::FormatID::R8_UNORM_SRGB;
2494             mVkBufferFormatIsPacked        = false;
2495             mVertexLoadFunction            = CopyNativeVertexData<GLubyte, 1, 1, 0>;
2496             mVertexLoadRequiresConversion  = false;
2497             break;
2498 
2499         case angle::FormatID::R8_USCALED:
2500             mIntendedGLFormat              = GL_R8_USCALED_ANGLEX;
2501             mActualSampleOnlyImageFormatID = angle::FormatID::R8_USCALED;
2502             mImageInitializerFunction      = nullptr;
2503             {
2504                 static constexpr BufferFormatInitInfo kInfo[] = {
2505                     {angle::FormatID::R8_USCALED, false, CopyNativeVertexData<GLubyte, 1, 1, 0>,
2506                      false},
2507                     {angle::FormatID::R16_FLOAT, false,
2508                      CopyToFloatVertexData<GLubyte, 1, 1, false, true>, true}};
2509                 initBufferFallback(renderer, kInfo, ArraySize(kInfo), 2);
2510             }
2511             break;
2512 
2513         case angle::FormatID::R9G9B9E5_SHAREDEXP:
2514             mIntendedGLFormat              = GL_RGB9_E5;
2515             mActualSampleOnlyImageFormatID = angle::FormatID::R9G9B9E5_SHAREDEXP;
2516             mImageInitializerFunction      = nullptr;
2517             mActualBufferFormatID          = angle::FormatID::R9G9B9E5_SHAREDEXP;
2518             mVkBufferFormatIsPacked        = true;
2519             mVertexLoadFunction            = CopyNativeVertexData<GLuint, 1, 1, 0>;
2520             mVertexLoadRequiresConversion  = false;
2521             break;
2522 
2523         case angle::FormatID::S8_UINT:
2524             mIntendedGLFormat = GL_STENCIL_INDEX8;
2525             {
2526                 static constexpr ImageFormatInitInfo kInfo[] = {
2527                     {angle::FormatID::S8_UINT, nullptr},
2528                     {angle::FormatID::D24_UNORM_S8_UINT, nullptr},
2529                     {angle::FormatID::D32_FLOAT_S8X24_UINT, nullptr},
2530                     {angle::FormatID::S8_UINT, nullptr}};
2531                 initImageFallback(renderer, kInfo, ArraySize(kInfo));
2532             }
2533             mActualBufferFormatID         = angle::FormatID::S8_UINT;
2534             mVkBufferFormatIsPacked       = false;
2535             mVertexLoadFunction           = nullptr;
2536             mVertexLoadRequiresConversion = false;
2537             break;
2538 
2539         case angle::FormatID::X2R10G10B10_SINT_VERTEX:
2540             mIntendedGLFormat              = GL_X2_RGB10_SINT_ANGLEX;
2541             mActualSampleOnlyImageFormatID = angle::FormatID::NONE;
2542             mImageInitializerFunction      = nullptr;
2543             mActualBufferFormatID          = angle::FormatID::R16G16B16A16_FLOAT;
2544             mVkBufferFormatIsPacked        = false;
2545             mVertexLoadFunction            = CopyXYZ10ToXYZWFloatVertexData<true, false, true>;
2546             mVertexLoadRequiresConversion  = true;
2547             break;
2548 
2549         case angle::FormatID::X2R10G10B10_SNORM_VERTEX:
2550             mIntendedGLFormat              = GL_X2_RGB10_SNORM_ANGLEX;
2551             mActualSampleOnlyImageFormatID = angle::FormatID::NONE;
2552             mImageInitializerFunction      = nullptr;
2553             mActualBufferFormatID          = angle::FormatID::R16G16B16A16_FLOAT;
2554             mVkBufferFormatIsPacked        = false;
2555             mVertexLoadFunction            = CopyXYZ10ToXYZWFloatVertexData<true, true, true>;
2556             mVertexLoadRequiresConversion  = true;
2557             break;
2558 
2559         case angle::FormatID::X2R10G10B10_SSCALED_VERTEX:
2560             mIntendedGLFormat              = GL_X2_RGB10_SSCALED_ANGLEX;
2561             mActualSampleOnlyImageFormatID = angle::FormatID::NONE;
2562             mImageInitializerFunction      = nullptr;
2563             mActualBufferFormatID          = angle::FormatID::R16G16B16A16_FLOAT;
2564             mVkBufferFormatIsPacked        = false;
2565             mVertexLoadFunction            = CopyXYZ10ToXYZWFloatVertexData<true, false, true>;
2566             mVertexLoadRequiresConversion  = true;
2567             break;
2568 
2569         case angle::FormatID::X2R10G10B10_UINT_VERTEX:
2570             mIntendedGLFormat              = GL_X2_RGB10_UINT_ANGLEX;
2571             mActualSampleOnlyImageFormatID = angle::FormatID::NONE;
2572             mImageInitializerFunction      = nullptr;
2573             mActualBufferFormatID          = angle::FormatID::R16G16B16A16_FLOAT;
2574             mVkBufferFormatIsPacked        = false;
2575             mVertexLoadFunction            = CopyXYZ10ToXYZWFloatVertexData<false, false, true>;
2576             mVertexLoadRequiresConversion  = true;
2577             break;
2578 
2579         case angle::FormatID::X2R10G10B10_UNORM_VERTEX:
2580             mIntendedGLFormat              = GL_X2_RGB10_UNORM_ANGLEX;
2581             mActualSampleOnlyImageFormatID = angle::FormatID::NONE;
2582             mImageInitializerFunction      = nullptr;
2583             mActualBufferFormatID          = angle::FormatID::R16G16B16A16_FLOAT;
2584             mVkBufferFormatIsPacked        = false;
2585             mVertexLoadFunction            = CopyXYZ10ToXYZWFloatVertexData<false, true, true>;
2586             mVertexLoadRequiresConversion  = true;
2587             break;
2588 
2589         case angle::FormatID::X2R10G10B10_USCALED_VERTEX:
2590             mIntendedGLFormat              = GL_X2_RGB10_USCALED_ANGLEX;
2591             mActualSampleOnlyImageFormatID = angle::FormatID::NONE;
2592             mImageInitializerFunction      = nullptr;
2593             mActualBufferFormatID          = angle::FormatID::R16G16B16A16_FLOAT;
2594             mVkBufferFormatIsPacked        = false;
2595             mVertexLoadFunction            = CopyXYZ10ToXYZWFloatVertexData<false, false, true>;
2596             mVertexLoadRequiresConversion  = true;
2597             break;
2598 
2599         default:
2600             UNREACHABLE();
2601             break;
2602     }
2603 }
2604 
GetVkFormatFromFormatID(angle::FormatID formatID)2605 VkFormat GetVkFormatFromFormatID(angle::FormatID formatID)
2606 {
2607     static constexpr angle::FormatMap<VkFormat> kMap = {
2608         {angle::FormatID::A1R5G5B5_UNORM, VK_FORMAT_A1R5G5B5_UNORM_PACK16},
2609         {angle::FormatID::ASTC_10x10_SRGB_BLOCK, VK_FORMAT_ASTC_10x10_SRGB_BLOCK},
2610         {angle::FormatID::ASTC_10x10_UNORM_BLOCK, VK_FORMAT_ASTC_10x10_UNORM_BLOCK},
2611         {angle::FormatID::ASTC_10x5_SRGB_BLOCK, VK_FORMAT_ASTC_10x5_SRGB_BLOCK},
2612         {angle::FormatID::ASTC_10x5_UNORM_BLOCK, VK_FORMAT_ASTC_10x5_UNORM_BLOCK},
2613         {angle::FormatID::ASTC_10x6_SRGB_BLOCK, VK_FORMAT_ASTC_10x6_SRGB_BLOCK},
2614         {angle::FormatID::ASTC_10x6_UNORM_BLOCK, VK_FORMAT_ASTC_10x6_UNORM_BLOCK},
2615         {angle::FormatID::ASTC_10x8_SRGB_BLOCK, VK_FORMAT_ASTC_10x8_SRGB_BLOCK},
2616         {angle::FormatID::ASTC_10x8_UNORM_BLOCK, VK_FORMAT_ASTC_10x8_UNORM_BLOCK},
2617         {angle::FormatID::ASTC_12x10_SRGB_BLOCK, VK_FORMAT_ASTC_12x10_SRGB_BLOCK},
2618         {angle::FormatID::ASTC_12x10_UNORM_BLOCK, VK_FORMAT_ASTC_12x10_UNORM_BLOCK},
2619         {angle::FormatID::ASTC_12x12_SRGB_BLOCK, VK_FORMAT_ASTC_12x12_SRGB_BLOCK},
2620         {angle::FormatID::ASTC_12x12_UNORM_BLOCK, VK_FORMAT_ASTC_12x12_UNORM_BLOCK},
2621         {angle::FormatID::ASTC_4x4_SRGB_BLOCK, VK_FORMAT_ASTC_4x4_SRGB_BLOCK},
2622         {angle::FormatID::ASTC_4x4_UNORM_BLOCK, VK_FORMAT_ASTC_4x4_UNORM_BLOCK},
2623         {angle::FormatID::ASTC_5x4_SRGB_BLOCK, VK_FORMAT_ASTC_5x4_SRGB_BLOCK},
2624         {angle::FormatID::ASTC_5x4_UNORM_BLOCK, VK_FORMAT_ASTC_5x4_UNORM_BLOCK},
2625         {angle::FormatID::ASTC_5x5_SRGB_BLOCK, VK_FORMAT_ASTC_5x5_SRGB_BLOCK},
2626         {angle::FormatID::ASTC_5x5_UNORM_BLOCK, VK_FORMAT_ASTC_5x5_UNORM_BLOCK},
2627         {angle::FormatID::ASTC_6x5_SRGB_BLOCK, VK_FORMAT_ASTC_6x5_SRGB_BLOCK},
2628         {angle::FormatID::ASTC_6x5_UNORM_BLOCK, VK_FORMAT_ASTC_6x5_UNORM_BLOCK},
2629         {angle::FormatID::ASTC_6x6_SRGB_BLOCK, VK_FORMAT_ASTC_6x6_SRGB_BLOCK},
2630         {angle::FormatID::ASTC_6x6_UNORM_BLOCK, VK_FORMAT_ASTC_6x6_UNORM_BLOCK},
2631         {angle::FormatID::ASTC_8x5_SRGB_BLOCK, VK_FORMAT_ASTC_8x5_SRGB_BLOCK},
2632         {angle::FormatID::ASTC_8x5_UNORM_BLOCK, VK_FORMAT_ASTC_8x5_UNORM_BLOCK},
2633         {angle::FormatID::ASTC_8x6_SRGB_BLOCK, VK_FORMAT_ASTC_8x6_SRGB_BLOCK},
2634         {angle::FormatID::ASTC_8x6_UNORM_BLOCK, VK_FORMAT_ASTC_8x6_UNORM_BLOCK},
2635         {angle::FormatID::ASTC_8x8_SRGB_BLOCK, VK_FORMAT_ASTC_8x8_SRGB_BLOCK},
2636         {angle::FormatID::ASTC_8x8_UNORM_BLOCK, VK_FORMAT_ASTC_8x8_UNORM_BLOCK},
2637         {angle::FormatID::B10G10R10A2_UNORM, VK_FORMAT_A2R10G10B10_UNORM_PACK32},
2638         {angle::FormatID::B4G4R4A4_UNORM, VK_FORMAT_B4G4R4A4_UNORM_PACK16},
2639         {angle::FormatID::B5G5R5A1_UNORM, VK_FORMAT_B5G5R5A1_UNORM_PACK16},
2640         {angle::FormatID::B5G6R5_UNORM, VK_FORMAT_B5G6R5_UNORM_PACK16},
2641         {angle::FormatID::B8G8R8A8_UNORM, VK_FORMAT_B8G8R8A8_UNORM},
2642         {angle::FormatID::B8G8R8A8_UNORM_SRGB, VK_FORMAT_B8G8R8A8_SRGB},
2643         {angle::FormatID::BC1_RGBA_UNORM_BLOCK, VK_FORMAT_BC1_RGBA_UNORM_BLOCK},
2644         {angle::FormatID::BC1_RGBA_UNORM_SRGB_BLOCK, VK_FORMAT_BC1_RGBA_SRGB_BLOCK},
2645         {angle::FormatID::BC1_RGB_UNORM_BLOCK, VK_FORMAT_BC1_RGB_UNORM_BLOCK},
2646         {angle::FormatID::BC1_RGB_UNORM_SRGB_BLOCK, VK_FORMAT_BC1_RGB_SRGB_BLOCK},
2647         {angle::FormatID::BC2_RGBA_UNORM_BLOCK, VK_FORMAT_BC2_UNORM_BLOCK},
2648         {angle::FormatID::BC2_RGBA_UNORM_SRGB_BLOCK, VK_FORMAT_BC2_SRGB_BLOCK},
2649         {angle::FormatID::BC3_RGBA_UNORM_BLOCK, VK_FORMAT_BC3_UNORM_BLOCK},
2650         {angle::FormatID::BC3_RGBA_UNORM_SRGB_BLOCK, VK_FORMAT_BC3_SRGB_BLOCK},
2651         {angle::FormatID::BC4_RED_SNORM_BLOCK, VK_FORMAT_BC4_SNORM_BLOCK},
2652         {angle::FormatID::BC4_RED_UNORM_BLOCK, VK_FORMAT_BC4_UNORM_BLOCK},
2653         {angle::FormatID::BC5_RG_SNORM_BLOCK, VK_FORMAT_BC5_SNORM_BLOCK},
2654         {angle::FormatID::BC5_RG_UNORM_BLOCK, VK_FORMAT_BC5_UNORM_BLOCK},
2655         {angle::FormatID::BC6H_RGB_SFLOAT_BLOCK, VK_FORMAT_BC6H_SFLOAT_BLOCK},
2656         {angle::FormatID::BC6H_RGB_UFLOAT_BLOCK, VK_FORMAT_BC6H_UFLOAT_BLOCK},
2657         {angle::FormatID::BC7_RGBA_UNORM_BLOCK, VK_FORMAT_BC7_UNORM_BLOCK},
2658         {angle::FormatID::BC7_RGBA_UNORM_SRGB_BLOCK, VK_FORMAT_BC7_SRGB_BLOCK},
2659         {angle::FormatID::D16_UNORM, VK_FORMAT_D16_UNORM},
2660         {angle::FormatID::D24_UNORM_S8_UINT, VK_FORMAT_D24_UNORM_S8_UINT},
2661         {angle::FormatID::D24_UNORM_X8_UINT, VK_FORMAT_X8_D24_UNORM_PACK32},
2662         {angle::FormatID::D32_FLOAT, VK_FORMAT_D32_SFLOAT},
2663         {angle::FormatID::D32_FLOAT_S8X24_UINT, VK_FORMAT_D32_SFLOAT_S8_UINT},
2664         {angle::FormatID::EAC_R11G11_SNORM_BLOCK, VK_FORMAT_EAC_R11G11_SNORM_BLOCK},
2665         {angle::FormatID::EAC_R11G11_UNORM_BLOCK, VK_FORMAT_EAC_R11G11_UNORM_BLOCK},
2666         {angle::FormatID::EAC_R11_SNORM_BLOCK, VK_FORMAT_EAC_R11_SNORM_BLOCK},
2667         {angle::FormatID::EAC_R11_UNORM_BLOCK, VK_FORMAT_EAC_R11_UNORM_BLOCK},
2668         {angle::FormatID::ETC2_R8G8B8A1_SRGB_BLOCK, VK_FORMAT_ETC2_R8G8B8A1_SRGB_BLOCK},
2669         {angle::FormatID::ETC2_R8G8B8A1_UNORM_BLOCK, VK_FORMAT_ETC2_R8G8B8A1_UNORM_BLOCK},
2670         {angle::FormatID::ETC2_R8G8B8A8_SRGB_BLOCK, VK_FORMAT_ETC2_R8G8B8A8_SRGB_BLOCK},
2671         {angle::FormatID::ETC2_R8G8B8A8_UNORM_BLOCK, VK_FORMAT_ETC2_R8G8B8A8_UNORM_BLOCK},
2672         {angle::FormatID::ETC2_R8G8B8_SRGB_BLOCK, VK_FORMAT_ETC2_R8G8B8_SRGB_BLOCK},
2673         {angle::FormatID::ETC2_R8G8B8_UNORM_BLOCK, VK_FORMAT_ETC2_R8G8B8_UNORM_BLOCK},
2674         {angle::FormatID::G8_B8R8_2PLANE_420_UNORM, VK_FORMAT_G8_B8R8_2PLANE_420_UNORM},
2675         {angle::FormatID::G8_B8_R8_3PLANE_420_UNORM, VK_FORMAT_G8_B8_R8_3PLANE_420_UNORM},
2676         {angle::FormatID::NONE, VK_FORMAT_UNDEFINED},
2677         {angle::FormatID::R10G10B10A2_SINT, VK_FORMAT_A2B10G10R10_SINT_PACK32},
2678         {angle::FormatID::R10G10B10A2_SNORM, VK_FORMAT_A2B10G10R10_SNORM_PACK32},
2679         {angle::FormatID::R10G10B10A2_SSCALED, VK_FORMAT_A2B10G10R10_SSCALED_PACK32},
2680         {angle::FormatID::R10G10B10A2_UINT, VK_FORMAT_A2B10G10R10_UINT_PACK32},
2681         {angle::FormatID::R10G10B10A2_UNORM, VK_FORMAT_A2B10G10R10_UNORM_PACK32},
2682         {angle::FormatID::R10G10B10A2_USCALED, VK_FORMAT_A2B10G10R10_USCALED_PACK32},
2683         {angle::FormatID::R11G11B10_FLOAT, VK_FORMAT_B10G11R11_UFLOAT_PACK32},
2684         {angle::FormatID::R16G16B16A16_FLOAT, VK_FORMAT_R16G16B16A16_SFLOAT},
2685         {angle::FormatID::R16G16B16A16_SINT, VK_FORMAT_R16G16B16A16_SINT},
2686         {angle::FormatID::R16G16B16A16_SNORM, VK_FORMAT_R16G16B16A16_SNORM},
2687         {angle::FormatID::R16G16B16A16_SSCALED, VK_FORMAT_R16G16B16A16_SSCALED},
2688         {angle::FormatID::R16G16B16A16_UINT, VK_FORMAT_R16G16B16A16_UINT},
2689         {angle::FormatID::R16G16B16A16_UNORM, VK_FORMAT_R16G16B16A16_UNORM},
2690         {angle::FormatID::R16G16B16A16_USCALED, VK_FORMAT_R16G16B16A16_USCALED},
2691         {angle::FormatID::R16G16B16_FLOAT, VK_FORMAT_R16G16B16_SFLOAT},
2692         {angle::FormatID::R16G16B16_SINT, VK_FORMAT_R16G16B16_SINT},
2693         {angle::FormatID::R16G16B16_SNORM, VK_FORMAT_R16G16B16_SNORM},
2694         {angle::FormatID::R16G16B16_SSCALED, VK_FORMAT_R16G16B16_SSCALED},
2695         {angle::FormatID::R16G16B16_UINT, VK_FORMAT_R16G16B16_UINT},
2696         {angle::FormatID::R16G16B16_UNORM, VK_FORMAT_R16G16B16_UNORM},
2697         {angle::FormatID::R16G16B16_USCALED, VK_FORMAT_R16G16B16_USCALED},
2698         {angle::FormatID::R16G16_FLOAT, VK_FORMAT_R16G16_SFLOAT},
2699         {angle::FormatID::R16G16_SINT, VK_FORMAT_R16G16_SINT},
2700         {angle::FormatID::R16G16_SNORM, VK_FORMAT_R16G16_SNORM},
2701         {angle::FormatID::R16G16_SSCALED, VK_FORMAT_R16G16_SSCALED},
2702         {angle::FormatID::R16G16_UINT, VK_FORMAT_R16G16_UINT},
2703         {angle::FormatID::R16G16_UNORM, VK_FORMAT_R16G16_UNORM},
2704         {angle::FormatID::R16G16_USCALED, VK_FORMAT_R16G16_USCALED},
2705         {angle::FormatID::R16_FLOAT, VK_FORMAT_R16_SFLOAT},
2706         {angle::FormatID::R16_SINT, VK_FORMAT_R16_SINT},
2707         {angle::FormatID::R16_SNORM, VK_FORMAT_R16_SNORM},
2708         {angle::FormatID::R16_SSCALED, VK_FORMAT_R16_SSCALED},
2709         {angle::FormatID::R16_UINT, VK_FORMAT_R16_UINT},
2710         {angle::FormatID::R16_UNORM, VK_FORMAT_R16_UNORM},
2711         {angle::FormatID::R16_USCALED, VK_FORMAT_R16_USCALED},
2712         {angle::FormatID::R32G32B32A32_FLOAT, VK_FORMAT_R32G32B32A32_SFLOAT},
2713         {angle::FormatID::R32G32B32A32_SINT, VK_FORMAT_R32G32B32A32_SINT},
2714         {angle::FormatID::R32G32B32A32_UINT, VK_FORMAT_R32G32B32A32_UINT},
2715         {angle::FormatID::R32G32B32_FLOAT, VK_FORMAT_R32G32B32_SFLOAT},
2716         {angle::FormatID::R32G32B32_SINT, VK_FORMAT_R32G32B32_SINT},
2717         {angle::FormatID::R32G32B32_UINT, VK_FORMAT_R32G32B32_UINT},
2718         {angle::FormatID::R32G32_FLOAT, VK_FORMAT_R32G32_SFLOAT},
2719         {angle::FormatID::R32G32_SINT, VK_FORMAT_R32G32_SINT},
2720         {angle::FormatID::R32G32_UINT, VK_FORMAT_R32G32_UINT},
2721         {angle::FormatID::R32_FLOAT, VK_FORMAT_R32_SFLOAT},
2722         {angle::FormatID::R32_SINT, VK_FORMAT_R32_SINT},
2723         {angle::FormatID::R32_UINT, VK_FORMAT_R32_UINT},
2724         {angle::FormatID::R4G4B4A4_UNORM, VK_FORMAT_R4G4B4A4_UNORM_PACK16},
2725         {angle::FormatID::R5G5B5A1_UNORM, VK_FORMAT_R5G5B5A1_UNORM_PACK16},
2726         {angle::FormatID::R5G6B5_UNORM, VK_FORMAT_R5G6B5_UNORM_PACK16},
2727         {angle::FormatID::R8G8B8A8_SINT, VK_FORMAT_R8G8B8A8_SINT},
2728         {angle::FormatID::R8G8B8A8_SNORM, VK_FORMAT_R8G8B8A8_SNORM},
2729         {angle::FormatID::R8G8B8A8_SSCALED, VK_FORMAT_R8G8B8A8_SSCALED},
2730         {angle::FormatID::R8G8B8A8_UINT, VK_FORMAT_R8G8B8A8_UINT},
2731         {angle::FormatID::R8G8B8A8_UNORM, VK_FORMAT_R8G8B8A8_UNORM},
2732         {angle::FormatID::R8G8B8A8_UNORM_SRGB, VK_FORMAT_R8G8B8A8_SRGB},
2733         {angle::FormatID::R8G8B8A8_USCALED, VK_FORMAT_R8G8B8A8_USCALED},
2734         {angle::FormatID::R8G8B8_SINT, VK_FORMAT_R8G8B8_SINT},
2735         {angle::FormatID::R8G8B8_SNORM, VK_FORMAT_R8G8B8_SNORM},
2736         {angle::FormatID::R8G8B8_SSCALED, VK_FORMAT_R8G8B8_SSCALED},
2737         {angle::FormatID::R8G8B8_UINT, VK_FORMAT_R8G8B8_UINT},
2738         {angle::FormatID::R8G8B8_UNORM, VK_FORMAT_R8G8B8_UNORM},
2739         {angle::FormatID::R8G8B8_UNORM_SRGB, VK_FORMAT_R8G8B8_SRGB},
2740         {angle::FormatID::R8G8B8_USCALED, VK_FORMAT_R8G8B8_USCALED},
2741         {angle::FormatID::R8G8_SINT, VK_FORMAT_R8G8_SINT},
2742         {angle::FormatID::R8G8_SNORM, VK_FORMAT_R8G8_SNORM},
2743         {angle::FormatID::R8G8_SSCALED, VK_FORMAT_R8G8_SSCALED},
2744         {angle::FormatID::R8G8_UINT, VK_FORMAT_R8G8_UINT},
2745         {angle::FormatID::R8G8_UNORM, VK_FORMAT_R8G8_UNORM},
2746         {angle::FormatID::R8G8_UNORM_SRGB, VK_FORMAT_R8G8_SRGB},
2747         {angle::FormatID::R8G8_USCALED, VK_FORMAT_R8G8_USCALED},
2748         {angle::FormatID::R8_SINT, VK_FORMAT_R8_SINT},
2749         {angle::FormatID::R8_SNORM, VK_FORMAT_R8_SNORM},
2750         {angle::FormatID::R8_SSCALED, VK_FORMAT_R8_SSCALED},
2751         {angle::FormatID::R8_UINT, VK_FORMAT_R8_UINT},
2752         {angle::FormatID::R8_UNORM, VK_FORMAT_R8_UNORM},
2753         {angle::FormatID::R8_UNORM_SRGB, VK_FORMAT_R8_SRGB},
2754         {angle::FormatID::R8_USCALED, VK_FORMAT_R8_USCALED},
2755         {angle::FormatID::R9G9B9E5_SHAREDEXP, VK_FORMAT_E5B9G9R9_UFLOAT_PACK32},
2756         {angle::FormatID::S8_UINT, VK_FORMAT_S8_UINT}};
2757 
2758     return kMap[formatID];
2759 }
2760 
GetFormatIDFromVkFormat(VkFormat vkFormat)2761 angle::FormatID GetFormatIDFromVkFormat(VkFormat vkFormat)
2762 {
2763     switch (vkFormat)
2764     {
2765         case VK_FORMAT_A1R5G5B5_UNORM_PACK16:
2766             return angle::FormatID::A1R5G5B5_UNORM;
2767         case VK_FORMAT_ASTC_10x10_SRGB_BLOCK:
2768             return angle::FormatID::ASTC_10x10_SRGB_BLOCK;
2769         case VK_FORMAT_ASTC_10x10_UNORM_BLOCK:
2770             return angle::FormatID::ASTC_10x10_UNORM_BLOCK;
2771         case VK_FORMAT_ASTC_10x5_SRGB_BLOCK:
2772             return angle::FormatID::ASTC_10x5_SRGB_BLOCK;
2773         case VK_FORMAT_ASTC_10x5_UNORM_BLOCK:
2774             return angle::FormatID::ASTC_10x5_UNORM_BLOCK;
2775         case VK_FORMAT_ASTC_10x6_SRGB_BLOCK:
2776             return angle::FormatID::ASTC_10x6_SRGB_BLOCK;
2777         case VK_FORMAT_ASTC_10x6_UNORM_BLOCK:
2778             return angle::FormatID::ASTC_10x6_UNORM_BLOCK;
2779         case VK_FORMAT_ASTC_10x8_SRGB_BLOCK:
2780             return angle::FormatID::ASTC_10x8_SRGB_BLOCK;
2781         case VK_FORMAT_ASTC_10x8_UNORM_BLOCK:
2782             return angle::FormatID::ASTC_10x8_UNORM_BLOCK;
2783         case VK_FORMAT_ASTC_12x10_SRGB_BLOCK:
2784             return angle::FormatID::ASTC_12x10_SRGB_BLOCK;
2785         case VK_FORMAT_ASTC_12x10_UNORM_BLOCK:
2786             return angle::FormatID::ASTC_12x10_UNORM_BLOCK;
2787         case VK_FORMAT_ASTC_12x12_SRGB_BLOCK:
2788             return angle::FormatID::ASTC_12x12_SRGB_BLOCK;
2789         case VK_FORMAT_ASTC_12x12_UNORM_BLOCK:
2790             return angle::FormatID::ASTC_12x12_UNORM_BLOCK;
2791         case VK_FORMAT_ASTC_4x4_SRGB_BLOCK:
2792             return angle::FormatID::ASTC_4x4_SRGB_BLOCK;
2793         case VK_FORMAT_ASTC_4x4_UNORM_BLOCK:
2794             return angle::FormatID::ASTC_4x4_UNORM_BLOCK;
2795         case VK_FORMAT_ASTC_5x4_SRGB_BLOCK:
2796             return angle::FormatID::ASTC_5x4_SRGB_BLOCK;
2797         case VK_FORMAT_ASTC_5x4_UNORM_BLOCK:
2798             return angle::FormatID::ASTC_5x4_UNORM_BLOCK;
2799         case VK_FORMAT_ASTC_5x5_SRGB_BLOCK:
2800             return angle::FormatID::ASTC_5x5_SRGB_BLOCK;
2801         case VK_FORMAT_ASTC_5x5_UNORM_BLOCK:
2802             return angle::FormatID::ASTC_5x5_UNORM_BLOCK;
2803         case VK_FORMAT_ASTC_6x5_SRGB_BLOCK:
2804             return angle::FormatID::ASTC_6x5_SRGB_BLOCK;
2805         case VK_FORMAT_ASTC_6x5_UNORM_BLOCK:
2806             return angle::FormatID::ASTC_6x5_UNORM_BLOCK;
2807         case VK_FORMAT_ASTC_6x6_SRGB_BLOCK:
2808             return angle::FormatID::ASTC_6x6_SRGB_BLOCK;
2809         case VK_FORMAT_ASTC_6x6_UNORM_BLOCK:
2810             return angle::FormatID::ASTC_6x6_UNORM_BLOCK;
2811         case VK_FORMAT_ASTC_8x5_SRGB_BLOCK:
2812             return angle::FormatID::ASTC_8x5_SRGB_BLOCK;
2813         case VK_FORMAT_ASTC_8x5_UNORM_BLOCK:
2814             return angle::FormatID::ASTC_8x5_UNORM_BLOCK;
2815         case VK_FORMAT_ASTC_8x6_SRGB_BLOCK:
2816             return angle::FormatID::ASTC_8x6_SRGB_BLOCK;
2817         case VK_FORMAT_ASTC_8x6_UNORM_BLOCK:
2818             return angle::FormatID::ASTC_8x6_UNORM_BLOCK;
2819         case VK_FORMAT_ASTC_8x8_SRGB_BLOCK:
2820             return angle::FormatID::ASTC_8x8_SRGB_BLOCK;
2821         case VK_FORMAT_ASTC_8x8_UNORM_BLOCK:
2822             return angle::FormatID::ASTC_8x8_UNORM_BLOCK;
2823         case VK_FORMAT_A2R10G10B10_UNORM_PACK32:
2824             return angle::FormatID::B10G10R10A2_UNORM;
2825         case VK_FORMAT_B4G4R4A4_UNORM_PACK16:
2826             return angle::FormatID::B4G4R4A4_UNORM;
2827         case VK_FORMAT_B5G5R5A1_UNORM_PACK16:
2828             return angle::FormatID::B5G5R5A1_UNORM;
2829         case VK_FORMAT_B5G6R5_UNORM_PACK16:
2830             return angle::FormatID::B5G6R5_UNORM;
2831         case VK_FORMAT_B8G8R8A8_UNORM:
2832             return angle::FormatID::B8G8R8A8_UNORM;
2833         case VK_FORMAT_B8G8R8A8_SRGB:
2834             return angle::FormatID::B8G8R8A8_UNORM_SRGB;
2835         case VK_FORMAT_BC1_RGBA_UNORM_BLOCK:
2836             return angle::FormatID::BC1_RGBA_UNORM_BLOCK;
2837         case VK_FORMAT_BC1_RGBA_SRGB_BLOCK:
2838             return angle::FormatID::BC1_RGBA_UNORM_SRGB_BLOCK;
2839         case VK_FORMAT_BC1_RGB_UNORM_BLOCK:
2840             return angle::FormatID::BC1_RGB_UNORM_BLOCK;
2841         case VK_FORMAT_BC1_RGB_SRGB_BLOCK:
2842             return angle::FormatID::BC1_RGB_UNORM_SRGB_BLOCK;
2843         case VK_FORMAT_BC2_UNORM_BLOCK:
2844             return angle::FormatID::BC2_RGBA_UNORM_BLOCK;
2845         case VK_FORMAT_BC2_SRGB_BLOCK:
2846             return angle::FormatID::BC2_RGBA_UNORM_SRGB_BLOCK;
2847         case VK_FORMAT_BC3_UNORM_BLOCK:
2848             return angle::FormatID::BC3_RGBA_UNORM_BLOCK;
2849         case VK_FORMAT_BC3_SRGB_BLOCK:
2850             return angle::FormatID::BC3_RGBA_UNORM_SRGB_BLOCK;
2851         case VK_FORMAT_BC4_SNORM_BLOCK:
2852             return angle::FormatID::BC4_RED_SNORM_BLOCK;
2853         case VK_FORMAT_BC4_UNORM_BLOCK:
2854             return angle::FormatID::BC4_RED_UNORM_BLOCK;
2855         case VK_FORMAT_BC5_SNORM_BLOCK:
2856             return angle::FormatID::BC5_RG_SNORM_BLOCK;
2857         case VK_FORMAT_BC5_UNORM_BLOCK:
2858             return angle::FormatID::BC5_RG_UNORM_BLOCK;
2859         case VK_FORMAT_BC6H_SFLOAT_BLOCK:
2860             return angle::FormatID::BC6H_RGB_SFLOAT_BLOCK;
2861         case VK_FORMAT_BC6H_UFLOAT_BLOCK:
2862             return angle::FormatID::BC6H_RGB_UFLOAT_BLOCK;
2863         case VK_FORMAT_BC7_UNORM_BLOCK:
2864             return angle::FormatID::BC7_RGBA_UNORM_BLOCK;
2865         case VK_FORMAT_BC7_SRGB_BLOCK:
2866             return angle::FormatID::BC7_RGBA_UNORM_SRGB_BLOCK;
2867         case VK_FORMAT_D16_UNORM:
2868             return angle::FormatID::D16_UNORM;
2869         case VK_FORMAT_D24_UNORM_S8_UINT:
2870             return angle::FormatID::D24_UNORM_S8_UINT;
2871         case VK_FORMAT_X8_D24_UNORM_PACK32:
2872             return angle::FormatID::D24_UNORM_X8_UINT;
2873         case VK_FORMAT_D32_SFLOAT:
2874             return angle::FormatID::D32_FLOAT;
2875         case VK_FORMAT_D32_SFLOAT_S8_UINT:
2876             return angle::FormatID::D32_FLOAT_S8X24_UINT;
2877         case VK_FORMAT_EAC_R11G11_SNORM_BLOCK:
2878             return angle::FormatID::EAC_R11G11_SNORM_BLOCK;
2879         case VK_FORMAT_EAC_R11G11_UNORM_BLOCK:
2880             return angle::FormatID::EAC_R11G11_UNORM_BLOCK;
2881         case VK_FORMAT_EAC_R11_SNORM_BLOCK:
2882             return angle::FormatID::EAC_R11_SNORM_BLOCK;
2883         case VK_FORMAT_EAC_R11_UNORM_BLOCK:
2884             return angle::FormatID::EAC_R11_UNORM_BLOCK;
2885         case VK_FORMAT_ETC2_R8G8B8A1_SRGB_BLOCK:
2886             return angle::FormatID::ETC2_R8G8B8A1_SRGB_BLOCK;
2887         case VK_FORMAT_ETC2_R8G8B8A1_UNORM_BLOCK:
2888             return angle::FormatID::ETC2_R8G8B8A1_UNORM_BLOCK;
2889         case VK_FORMAT_ETC2_R8G8B8A8_SRGB_BLOCK:
2890             return angle::FormatID::ETC2_R8G8B8A8_SRGB_BLOCK;
2891         case VK_FORMAT_ETC2_R8G8B8A8_UNORM_BLOCK:
2892             return angle::FormatID::ETC2_R8G8B8A8_UNORM_BLOCK;
2893         case VK_FORMAT_ETC2_R8G8B8_SRGB_BLOCK:
2894             return angle::FormatID::ETC2_R8G8B8_SRGB_BLOCK;
2895         case VK_FORMAT_ETC2_R8G8B8_UNORM_BLOCK:
2896             return angle::FormatID::ETC2_R8G8B8_UNORM_BLOCK;
2897         case VK_FORMAT_G8_B8R8_2PLANE_420_UNORM:
2898             return angle::FormatID::G8_B8R8_2PLANE_420_UNORM;
2899         case VK_FORMAT_G8_B8_R8_3PLANE_420_UNORM:
2900             return angle::FormatID::G8_B8_R8_3PLANE_420_UNORM;
2901         case VK_FORMAT_UNDEFINED:
2902             return angle::FormatID::NONE;
2903         case VK_FORMAT_A2B10G10R10_SINT_PACK32:
2904             return angle::FormatID::R10G10B10A2_SINT;
2905         case VK_FORMAT_A2B10G10R10_SNORM_PACK32:
2906             return angle::FormatID::R10G10B10A2_SNORM;
2907         case VK_FORMAT_A2B10G10R10_SSCALED_PACK32:
2908             return angle::FormatID::R10G10B10A2_SSCALED;
2909         case VK_FORMAT_A2B10G10R10_UINT_PACK32:
2910             return angle::FormatID::R10G10B10A2_UINT;
2911         case VK_FORMAT_A2B10G10R10_UNORM_PACK32:
2912             return angle::FormatID::R10G10B10A2_UNORM;
2913         case VK_FORMAT_A2B10G10R10_USCALED_PACK32:
2914             return angle::FormatID::R10G10B10A2_USCALED;
2915         case VK_FORMAT_B10G11R11_UFLOAT_PACK32:
2916             return angle::FormatID::R11G11B10_FLOAT;
2917         case VK_FORMAT_R16G16B16A16_SFLOAT:
2918             return angle::FormatID::R16G16B16A16_FLOAT;
2919         case VK_FORMAT_R16G16B16A16_SINT:
2920             return angle::FormatID::R16G16B16A16_SINT;
2921         case VK_FORMAT_R16G16B16A16_SNORM:
2922             return angle::FormatID::R16G16B16A16_SNORM;
2923         case VK_FORMAT_R16G16B16A16_SSCALED:
2924             return angle::FormatID::R16G16B16A16_SSCALED;
2925         case VK_FORMAT_R16G16B16A16_UINT:
2926             return angle::FormatID::R16G16B16A16_UINT;
2927         case VK_FORMAT_R16G16B16A16_UNORM:
2928             return angle::FormatID::R16G16B16A16_UNORM;
2929         case VK_FORMAT_R16G16B16A16_USCALED:
2930             return angle::FormatID::R16G16B16A16_USCALED;
2931         case VK_FORMAT_R16G16B16_SFLOAT:
2932             return angle::FormatID::R16G16B16_FLOAT;
2933         case VK_FORMAT_R16G16B16_SINT:
2934             return angle::FormatID::R16G16B16_SINT;
2935         case VK_FORMAT_R16G16B16_SNORM:
2936             return angle::FormatID::R16G16B16_SNORM;
2937         case VK_FORMAT_R16G16B16_SSCALED:
2938             return angle::FormatID::R16G16B16_SSCALED;
2939         case VK_FORMAT_R16G16B16_UINT:
2940             return angle::FormatID::R16G16B16_UINT;
2941         case VK_FORMAT_R16G16B16_UNORM:
2942             return angle::FormatID::R16G16B16_UNORM;
2943         case VK_FORMAT_R16G16B16_USCALED:
2944             return angle::FormatID::R16G16B16_USCALED;
2945         case VK_FORMAT_R16G16_SFLOAT:
2946             return angle::FormatID::R16G16_FLOAT;
2947         case VK_FORMAT_R16G16_SINT:
2948             return angle::FormatID::R16G16_SINT;
2949         case VK_FORMAT_R16G16_SNORM:
2950             return angle::FormatID::R16G16_SNORM;
2951         case VK_FORMAT_R16G16_SSCALED:
2952             return angle::FormatID::R16G16_SSCALED;
2953         case VK_FORMAT_R16G16_UINT:
2954             return angle::FormatID::R16G16_UINT;
2955         case VK_FORMAT_R16G16_UNORM:
2956             return angle::FormatID::R16G16_UNORM;
2957         case VK_FORMAT_R16G16_USCALED:
2958             return angle::FormatID::R16G16_USCALED;
2959         case VK_FORMAT_R16_SFLOAT:
2960             return angle::FormatID::R16_FLOAT;
2961         case VK_FORMAT_R16_SINT:
2962             return angle::FormatID::R16_SINT;
2963         case VK_FORMAT_R16_SNORM:
2964             return angle::FormatID::R16_SNORM;
2965         case VK_FORMAT_R16_SSCALED:
2966             return angle::FormatID::R16_SSCALED;
2967         case VK_FORMAT_R16_UINT:
2968             return angle::FormatID::R16_UINT;
2969         case VK_FORMAT_R16_UNORM:
2970             return angle::FormatID::R16_UNORM;
2971         case VK_FORMAT_R16_USCALED:
2972             return angle::FormatID::R16_USCALED;
2973         case VK_FORMAT_R32G32B32A32_SFLOAT:
2974             return angle::FormatID::R32G32B32A32_FLOAT;
2975         case VK_FORMAT_R32G32B32A32_SINT:
2976             return angle::FormatID::R32G32B32A32_SINT;
2977         case VK_FORMAT_R32G32B32A32_UINT:
2978             return angle::FormatID::R32G32B32A32_UINT;
2979         case VK_FORMAT_R32G32B32_SFLOAT:
2980             return angle::FormatID::R32G32B32_FLOAT;
2981         case VK_FORMAT_R32G32B32_SINT:
2982             return angle::FormatID::R32G32B32_SINT;
2983         case VK_FORMAT_R32G32B32_UINT:
2984             return angle::FormatID::R32G32B32_UINT;
2985         case VK_FORMAT_R32G32_SFLOAT:
2986             return angle::FormatID::R32G32_FLOAT;
2987         case VK_FORMAT_R32G32_SINT:
2988             return angle::FormatID::R32G32_SINT;
2989         case VK_FORMAT_R32G32_UINT:
2990             return angle::FormatID::R32G32_UINT;
2991         case VK_FORMAT_R32_SFLOAT:
2992             return angle::FormatID::R32_FLOAT;
2993         case VK_FORMAT_R32_SINT:
2994             return angle::FormatID::R32_SINT;
2995         case VK_FORMAT_R32_UINT:
2996             return angle::FormatID::R32_UINT;
2997         case VK_FORMAT_R4G4B4A4_UNORM_PACK16:
2998             return angle::FormatID::R4G4B4A4_UNORM;
2999         case VK_FORMAT_R5G5B5A1_UNORM_PACK16:
3000             return angle::FormatID::R5G5B5A1_UNORM;
3001         case VK_FORMAT_R5G6B5_UNORM_PACK16:
3002             return angle::FormatID::R5G6B5_UNORM;
3003         case VK_FORMAT_R8G8B8A8_SINT:
3004             return angle::FormatID::R8G8B8A8_SINT;
3005         case VK_FORMAT_R8G8B8A8_SNORM:
3006             return angle::FormatID::R8G8B8A8_SNORM;
3007         case VK_FORMAT_R8G8B8A8_SSCALED:
3008             return angle::FormatID::R8G8B8A8_SSCALED;
3009         case VK_FORMAT_R8G8B8A8_UINT:
3010             return angle::FormatID::R8G8B8A8_UINT;
3011         case VK_FORMAT_R8G8B8A8_UNORM:
3012             return angle::FormatID::R8G8B8A8_UNORM;
3013         case VK_FORMAT_R8G8B8A8_SRGB:
3014             return angle::FormatID::R8G8B8A8_UNORM_SRGB;
3015         case VK_FORMAT_R8G8B8A8_USCALED:
3016             return angle::FormatID::R8G8B8A8_USCALED;
3017         case VK_FORMAT_R8G8B8_SINT:
3018             return angle::FormatID::R8G8B8_SINT;
3019         case VK_FORMAT_R8G8B8_SNORM:
3020             return angle::FormatID::R8G8B8_SNORM;
3021         case VK_FORMAT_R8G8B8_SSCALED:
3022             return angle::FormatID::R8G8B8_SSCALED;
3023         case VK_FORMAT_R8G8B8_UINT:
3024             return angle::FormatID::R8G8B8_UINT;
3025         case VK_FORMAT_R8G8B8_UNORM:
3026             return angle::FormatID::R8G8B8_UNORM;
3027         case VK_FORMAT_R8G8B8_SRGB:
3028             return angle::FormatID::R8G8B8_UNORM_SRGB;
3029         case VK_FORMAT_R8G8B8_USCALED:
3030             return angle::FormatID::R8G8B8_USCALED;
3031         case VK_FORMAT_R8G8_SINT:
3032             return angle::FormatID::R8G8_SINT;
3033         case VK_FORMAT_R8G8_SNORM:
3034             return angle::FormatID::R8G8_SNORM;
3035         case VK_FORMAT_R8G8_SSCALED:
3036             return angle::FormatID::R8G8_SSCALED;
3037         case VK_FORMAT_R8G8_UINT:
3038             return angle::FormatID::R8G8_UINT;
3039         case VK_FORMAT_R8G8_UNORM:
3040             return angle::FormatID::R8G8_UNORM;
3041         case VK_FORMAT_R8G8_SRGB:
3042             return angle::FormatID::R8G8_UNORM_SRGB;
3043         case VK_FORMAT_R8G8_USCALED:
3044             return angle::FormatID::R8G8_USCALED;
3045         case VK_FORMAT_R8_SINT:
3046             return angle::FormatID::R8_SINT;
3047         case VK_FORMAT_R8_SNORM:
3048             return angle::FormatID::R8_SNORM;
3049         case VK_FORMAT_R8_SSCALED:
3050             return angle::FormatID::R8_SSCALED;
3051         case VK_FORMAT_R8_UINT:
3052             return angle::FormatID::R8_UINT;
3053         case VK_FORMAT_R8_UNORM:
3054             return angle::FormatID::R8_UNORM;
3055         case VK_FORMAT_R8_SRGB:
3056             return angle::FormatID::R8_UNORM_SRGB;
3057         case VK_FORMAT_R8_USCALED:
3058             return angle::FormatID::R8_USCALED;
3059         case VK_FORMAT_E5B9G9R9_UFLOAT_PACK32:
3060             return angle::FormatID::R9G9B9E5_SHAREDEXP;
3061         case VK_FORMAT_S8_UINT:
3062             return angle::FormatID::S8_UINT;
3063 
3064         default:
3065             UNREACHABLE();
3066             return angle::FormatID::NONE;
3067     }
3068 }
3069 }  // namespace vk
3070 }  // namespace rx
3071