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