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