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