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