0/**********************************************************************************************
1*
2* rltexgpu v1.2 - GPU compressed textures loading and saving
3*
4* DESCRIPTION:
5*
6* Load GPU compressed image data from image files provided as memory data arrays,
7* data is loaded compressed, ready to be loaded into GPU
8*
9* Note that some file formats (DDS, PVR, KTX) also support uncompressed data storage.
10* In those cases data is loaded uncompressed and format is returned
11*
12* FIXME: This library still depends on raylib due to the following reasons:
13* - rl_save_ktx_to_memory() requires rlGetGlTextureFormats() from rlgl.h
14*
15* TODO:
16* - Review rl_load_ktx_from_memory() to support KTX v2.2 specs
17*
18* CONFIGURATION:
19*
20* #define RLTEXGPU_SUPPORT_DDS
21* #define RLTEXGPU_SUPPORT_PKM
22* #define RLTEXGPU_SUPPORT_KTX
23* #define RLTEXGPU_SUPPORT_PVR
24* #define RLTEXGPU_SUPPORT_ASTC
25* Define desired file formats to be supported
26*
27* #define RLTEXGPU_SHOW_LOG_INFO
28* Define, if you wish to see warnings generated by the library
29* This will include <stdio.h> unless you provide your own RLTEXGPU_LOG
30* #define RLTEXGPU_LOG
31* Define, if you wish to provide your own warning function
32* Make sure that this macro puts newline character '\n' at the end
33*
34* #define RLTEXGPU_MALLOC
35* #define RLTEXGPU_FREE
36* Define those macros in order to provide your own libc-compliant allocator;
37* not doing so will include <stdlib.h>
38* If you're providing any of those, you must provide ALL of them,
39* otherwise the code will (most likely) crash...
40*
41* #define RLTEXGPU_NULL
42* Define in order to provide your own libc-compliant NULL pointer;
43* not doing so will include <stdlib.h>
44*
45* #define RLTEXGPU_MEMCPY
46* Define in order to provide your own libc-compliant 'memcpy' function;
47* not doing so will include <string.h>
48*
49* #define RLGPUTEXAPI
50* Define to compiler-specific intrinsic, if you wish to export public functions
51* There is no need to do so when statically linking
52*
53* VERSIONS HISTORY:
54* 1.2 (18-Mar-2026) Renamed library to `rltexgpu`
55* Improved usage as standalone linrary
56* Decouple logging and memory allocation from raylib
57*
58* 1.1 (15-Jul-2025) Several minor fixes related to specific image formats; some work has been done
59* in order to decouple the library from raylib by introducing few new macros; library still
60* requires raylib in order to function properly
61*
62* 1.0 (17-Sep-2022) First version has been created by migrating part of compressed-texture-loading
63* functionality from raylib src/rtextures.c into self-contained library
64*
65* LICENSE: zlib/libpng
66*
67* Copyright (c) 2013-2026 Ramon Santamaria (@raysan5)
68*
69* This software is provided "as-is", without any express or implied warranty. In no event
70* will the authors be held liable for any damages arising from the use of this software.
71*
72* Permission is granted to anyone to use this software for any purpose, including commercial
73* applications, and to alter it and redistribute it freely, subject to the following restrictions:
74*
75* 1. The origin of this software must not be misrepresented; you must not claim that you
76* wrote the original software. If you use this software in a product, an acknowledgment
77* in the product documentation would be appreciated but is not required.
78*
79* 2. Altered source versions must be plainly marked as such, and must not be misrepresented
80* as being the original software.
81*
82* 3. This notice may not be removed or altered from any source distribution.
83*
84**********************************************************************************************/
86#ifndef RLTEXGPU_H
87#define RLTEXGPU_H
89#ifndef RLGPUTEXAPI
90 #define RLGPUTEXAPI // Functions defined as 'extern' by default (implicit specifiers)
91#endif
93// Texture pixel formats
94// NOTE: Support depends on OpenGL version
95// WARNING: Enum values aligned with raylib/rlgl equivalent PixelFormat/rlPixelFormat enum,
96// to avoid value mapping between the 3 libraries format values
97typedef enum {
98 RLTEXGPU_PIXELFORMAT_UNCOMPRESSED_GRAYSCALE = 1, // 8 bit per pixel (no alpha)
99 RLTEXGPU_PIXELFORMAT_UNCOMPRESSED_GRAY_ALPHA, // 8*2 bpp (2 channels)
100 RLTEXGPU_PIXELFORMAT_UNCOMPRESSED_R5G6B5, // 16 bpp
101 RLTEXGPU_PIXELFORMAT_UNCOMPRESSED_R8G8B8, // 24 bpp
102 RLTEXGPU_PIXELFORMAT_UNCOMPRESSED_R5G5B5A1, // 16 bpp (1 bit alpha)
103 RLTEXGPU_PIXELFORMAT_UNCOMPRESSED_R4G4B4A4, // 16 bpp (4 bit alpha)
104 RLTEXGPU_PIXELFORMAT_UNCOMPRESSED_R8G8B8A8, // 32 bpp
105 RLTEXGPU_PIXELFORMAT_UNCOMPRESSED_R32, // 32 bpp (1 channel - float)
106 RLTEXGPU_PIXELFORMAT_UNCOMPRESSED_R32G32B32, // 32*3 bpp (3 channels - float)
107 RLTEXGPU_PIXELFORMAT_UNCOMPRESSED_R32G32B32A32, // 32*4 bpp (4 channels - float)
108 RLTEXGPU_PIXELFORMAT_UNCOMPRESSED_R16, // 16 bpp (1 channel - half float)
109 RLTEXGPU_PIXELFORMAT_UNCOMPRESSED_R16G16B16, // 16*3 bpp (3 channels - half float)
110 RLTEXGPU_PIXELFORMAT_UNCOMPRESSED_R16G16B16A16, // 16*4 bpp (4 channels - half float)
111 RLTEXGPU_PIXELFORMAT_COMPRESSED_DXT1_RGB, // 4 bpp (no alpha)
112 RLTEXGPU_PIXELFORMAT_COMPRESSED_DXT1_RGBA, // 4 bpp (1 bit alpha)
113 RLTEXGPU_PIXELFORMAT_COMPRESSED_DXT3_RGBA, // 8 bpp
114 RLTEXGPU_PIXELFORMAT_COMPRESSED_DXT5_RGBA, // 8 bpp
115 RLTEXGPU_PIXELFORMAT_COMPRESSED_ETC1_RGB, // 4 bpp
116 RLTEXGPU_PIXELFORMAT_COMPRESSED_ETC2_RGB, // 4 bpp
117 RLTEXGPU_PIXELFORMAT_COMPRESSED_ETC2_EAC_RGBA, // 8 bpp
118 RLTEXGPU_PIXELFORMAT_COMPRESSED_PVRT_RGB, // 4 bpp
119 RLTEXGPU_PIXELFORMAT_COMPRESSED_PVRT_RGBA, // 4 bpp
120 RLTEXGPU_PIXELFORMAT_COMPRESSED_ASTC_4x4_RGBA, // 8 bpp
121 RLTEXGPU_PIXELFORMAT_COMPRESSED_ASTC_8x8_RGBA // 2 bpp
122} rlGpuTexPixelFormat;
124//----------------------------------------------------------------------------------
125// Module Functions Declaration
126//----------------------------------------------------------------------------------
127#if defined(__cplusplus)
128extern "C" { // Prevents name mangling of functions
129#endif
131// Load image data from memory data files
132RLGPUTEXAPI void *rl_load_dds_from_memory(const unsigned char *file_data, unsigned int file_size, int *width, int *height, int *format, int *mips);
133RLGPUTEXAPI void *rl_load_pkm_from_memory(const unsigned char *file_data, unsigned int file_size, int *width, int *height, int *format, int *mips);
134RLGPUTEXAPI void *rl_load_ktx_from_memory(const unsigned char *file_data, unsigned int file_size, int *width, int *height, int *format, int *mips);
135RLGPUTEXAPI void *rl_load_pvr_from_memory(const unsigned char *file_data, unsigned int file_size, int *width, int *height, int *format, int *mips);
136RLGPUTEXAPI void *rl_load_astc_from_memory(const unsigned char *file_data, unsigned int file_size, int *width, int *height, int *format, int *mips);
138RLGPUTEXAPI int rl_save_ktx_to_memory(const char *fileName, void *data, int width, int height, int format, int mipmaps); // Save image data as KTX file
140#if defined(__cplusplus)
141}
142#endif
144#endif // RLTEXGPU_H
146/***********************************************************************************
147*
148* RL_GPUTEX IMPLEMENTATION
149*
150************************************************************************************/
152#if defined(RLTEXGPU_IMPLEMENTATION)
154#if defined(RLTEXGPU_SHOW_LOG_INFO) && !defined(RLTEXGPU_LOG)
155 #include <stdio.h> // Required for: printf()
156#endif
157#if !defined(RLTEXGPU_MALLOC) || !defined(RLTEXGPU_NULL)
158 #include <stdlib.h> // Required for: NULL, malloc(), calloc(), free()
159#endif
160#if !defined(RLTEXGPU_MEMCPY)
161 #include <string.h> // Required for: memcpy()
162#endif
164#if defined(RLTEXGPU_MALLOC) || defined(RLTEXGPU_FREE)
165 #if !defined(RLTEXGPU_MALLOC) || !defined(RLTEXGPU_FREE)
166 #warning "RLTEXGPU_MALLOC and RLTEXGPU_FREE allocation functions are required to be provided"
167 #endif
168#endif
169#if !defined(RLTEXGPU_MALLOC)
170 #define RLTEXGPU_MALLOC(sz) malloc(sz)
171 #define RLTEXGPU_FREE(ptr) free(ptr)
172#endif
174#if !defined(RLTEXGPU_NULL)
175 #define RLTEXGPU_NULL NULL
176#endif
177#if !defined(RLTEXGPU_MEMCPY)
178 #define RLTEXGPU_MEMCPY(dest, src, num) memcpy(dest, src, num)
179#endif
181// Simple warning logging system to avoid LOG() calls if required
182// NOTE: Avoiding those calls, also avoids const strings memory usage
183// WARNING: This macro expects that newline character is added automatically
184// in order to match the functionality of raylib's TRACELOG()
185#if defined(RLTEXGPU_SHOW_LOG_INFO)
186 #if !defined(RLTEXGPU_LOG)
187 #define RLTEXGPU_LOG(...) (void)(printf("RL_GPUTEX: WARNING: " __VA_ARGS__), printf("\n"))
188 #endif
189#else
190 #if defined(RLTEXGPU_LOG)
191 // Undefine it first in order to supress warnings about macro redefinition
192 #undef RLTEXGPU_LOG
193 #endif
194 #define RLTEXGPU_LOG(...)
195#endif
197//----------------------------------------------------------------------------------
198// Module Internal Functions Declaration
199//----------------------------------------------------------------------------------
200// Get pixel data size in bytes for certain pixel format
201static int get_pixel_data_size(int width, int height, int format);
203// Get OpenGL internal formats and data type from rlGpuTexPixelFormat
204void get_gl_texture_formats(int format, unsigned int *gl_internal_format, unsigned int *gl_format, unsigned int *gl_type);
206//----------------------------------------------------------------------------------
207// Module Functions Definition
208//----------------------------------------------------------------------------------
209#if defined(RLTEXGPU_SUPPORT_DDS)
210// Loading DDS from memory image data (compressed or uncompressed)
211void *rl_load_dds_from_memory(const unsigned char *file_data, unsigned int file_size, int *width, int *height, int *format, int *mips)
212{
213 void *image_data = RLTEXGPU_NULL; // Image data pointer
214 int image_pixel_size = 0; // Image pixel size
216 unsigned char *file_data_ptr = (unsigned char *)file_data;
218 // Required extension:
219 // GL_EXT_texture_compression_s3tc
221 // Supported tokens (defined by extensions)
222 // GL_COMPRESSED_RGB_S3TC_DXT1_EXT 0x83F0
223 // GL_COMPRESSED_RGBA_S3TC_DXT1_EXT 0x83F1
224 // GL_COMPRESSED_RGBA_S3TC_DXT3_EXT 0x83F2
225 // GL_COMPRESSED_RGBA_S3TC_DXT5_EXT 0x83F3
227 #define FOURCC_DXT1 0x31545844 // Equivalent to "DXT1" in ASCII
228 #define FOURCC_DXT3 0x33545844 // Equivalent to "DXT3" in ASCII
229 #define FOURCC_DXT5 0x35545844 // Equivalent to "DXT5" in ASCII
231 // DDS Pixel Format
232 typedef struct {
233 unsigned int size;
234 unsigned int flags;
235 unsigned int fourcc;
236 unsigned int rgb_bit_count;
237 unsigned int r_bit_mask;
238 unsigned int g_bit_mask;
239 unsigned int b_bit_mask;
240 unsigned int a_bit_mask;
241 } dds_pixel_format;
243 // DDS Header (124 bytes)
244 typedef struct {
245 unsigned int size;
246 unsigned int flags;
247 unsigned int height;
248 unsigned int width;
249 unsigned int pitch_or_linear_size;
250 unsigned int depth;
251 unsigned int mipmap_count;
252 unsigned int reserved1[11];
253 dds_pixel_format ddspf;
254 unsigned int caps;
255 unsigned int caps2;
256 unsigned int caps3;
257 unsigned int caps4;
258 unsigned int reserved2;
259 } dds_header;
261 if (file_data_ptr != RLTEXGPU_NULL)
262 {
263 // Verify the type of file
264 unsigned char *dds_header_id = file_data_ptr;
265 file_data_ptr += 4;
267 if ((dds_header_id[0] != 'D') || (dds_header_id[1] != 'D') || (dds_header_id[2] != 'S') || (dds_header_id[3] != ' '))
268 {
269 RLTEXGPU_LOG("DDS file data not valid");
270 }
271 else
272 {
273 dds_header *header = (dds_header *)file_data_ptr;
275 file_data_ptr += sizeof(dds_header); // Skip header
277 *width = header->width;
278 *height = header->height;
280 if (*width % 4 != 0) RLTEXGPU_LOG("DDS file width must be multiple of 4. Image will not display correctly");
281 if (*height % 4 != 0) RLTEXGPU_LOG("DDS file height must be multiple of 4. Image will not display correctly");
283 image_pixel_size = header->width*header->height;
285 if (header->mipmap_count == 0) *mips = 1; // Parameter not used
286 else *mips = header->mipmap_count;
288 if (header->ddspf.rgb_bit_count == 16) // 16bit mode, no compressed
289 {
290 if (header->ddspf.flags == 0x40) // No alpha channel
291 {
292 int data_size = image_pixel_size*sizeof(unsigned short);
293 if (header->mipmap_count > 1) data_size = data_size + data_size/3;
294 image_data = RLTEXGPU_MALLOC(data_size);
296 RLTEXGPU_MEMCPY(image_data, file_data_ptr, data_size);
298 *format = RLTEXGPU_PIXELFORMAT_UNCOMPRESSED_R5G6B5;
299 }
300 else if (header->ddspf.flags == 0x41) // With alpha channel
301 {
302 if (header->ddspf.a_bit_mask == 0x8000) // 1bit alpha
303 {
304 int data_size = image_pixel_size*sizeof(unsigned short);
305 if (header->mipmap_count > 1) data_size = data_size + data_size/3;
306 image_data = RLTEXGPU_MALLOC(data_size);
308 RLTEXGPU_MEMCPY(image_data, file_data_ptr, data_size);
310 unsigned char alpha = 0;
312 // NOTE: Data comes as A1R5G5B5, it must be reordered to R5G5B5A1
313 for (int i = 0; i < data_size/sizeof(unsigned short); i++)
314 {
315 alpha = ((unsigned short *)image_data)[i] >> 15;
316 ((unsigned short *)image_data)[i] = ((unsigned short *)image_data)[i] << 1;
317 ((unsigned short *)image_data)[i] += alpha;
318 }
320 *format = RLTEXGPU_PIXELFORMAT_UNCOMPRESSED_R5G5B5A1;
321 }
322 else if (header->ddspf.a_bit_mask == 0xf000) // 4bit alpha
323 {
324 int data_size = image_pixel_size*sizeof(unsigned short);
325 if (header->mipmap_count > 1) data_size = data_size + data_size/3;
326 image_data = RLTEXGPU_MALLOC(data_size);
328 RLTEXGPU_MEMCPY(image_data, file_data_ptr, data_size);
330 unsigned char alpha = 0;
332 // NOTE: Data comes as A4R4G4B4, it must be reordered R4G4B4A4
333 for (int i = 0; i < data_size/sizeof(unsigned short); i++)
334 {
335 alpha = ((unsigned short *)image_data)[i] >> 12;
336 ((unsigned short *)image_data)[i] = ((unsigned short *)image_data)[i] << 4;
337 ((unsigned short *)image_data)[i] += alpha;
338 }
340 *format = RLTEXGPU_PIXELFORMAT_UNCOMPRESSED_R4G4B4A4;
341 }
342 }
343 }
344 else if ((header->ddspf.flags == 0x40) && (header->ddspf.rgb_bit_count == 24)) // DDS_RGB, no compressed
345 {
346 int data_size = image_pixel_size*3*sizeof(unsigned char);
347 if (header->mipmap_count > 1) data_size = data_size + data_size/3;
348 image_data = RLTEXGPU_MALLOC(data_size);
350 RLTEXGPU_MEMCPY(image_data, file_data_ptr, data_size);
352 *format = RLTEXGPU_PIXELFORMAT_UNCOMPRESSED_R8G8B8;
353 }
354 else if ((header->ddspf.flags == 0x41) && (header->ddspf.rgb_bit_count == 32)) // DDS_RGBA, no compressed
355 {
356 int data_size = image_pixel_size*4*sizeof(unsigned char);
357 if (header->mipmap_count > 1) data_size = data_size + data_size/3;
358 image_data = RLTEXGPU_MALLOC(data_size);
360 RLTEXGPU_MEMCPY(image_data, file_data_ptr, data_size);
362 unsigned char blue = 0;
364 // NOTE: Data comes as A8R8G8B8, it must be reordered R8G8B8A8 (view next comment)
365 // DirecX understand ARGB as a 32bit DWORD but the actual memory byte alignment is BGRA
366 // So, we must realign B8G8R8A8 to R8G8B8A8
367 for (int i = 0; i < data_size; i += 4)
368 {
369 blue = ((unsigned char *)image_data)[i];
370 ((unsigned char *)image_data)[i] = ((unsigned char *)image_data)[i + 2];
371 ((unsigned char *)image_data)[i + 2] = blue;
372 }
374 *format = RLTEXGPU_PIXELFORMAT_UNCOMPRESSED_R8G8B8A8;
375 }
376 else if (((header->ddspf.flags == 0x04) || (header->ddspf.flags == 0x05)) && (header->ddspf.fourcc > 0)) // Compressed
377 {
378 int data_size = 0;
380 // Calculate data size, including all mipmaps
381 if (header->mipmap_count > 1) data_size = header->pitch_or_linear_size + header->pitch_or_linear_size/3;
382 else data_size = header->pitch_or_linear_size;
384 image_data = RLTEXGPU_MALLOC(data_size*sizeof(unsigned char));
386 RLTEXGPU_MEMCPY(image_data, file_data_ptr, data_size);
388 switch (header->ddspf.fourcc)
389 {
390 case FOURCC_DXT1:
391 {
392 if (header->ddspf.flags == 0x04) *format = RLTEXGPU_PIXELFORMAT_COMPRESSED_DXT1_RGB;
393 else *format = RLTEXGPU_PIXELFORMAT_COMPRESSED_DXT1_RGBA;
394 } break;
395 case FOURCC_DXT3: *format = RLTEXGPU_PIXELFORMAT_COMPRESSED_DXT3_RGBA; break;
396 case FOURCC_DXT5: *format = RLTEXGPU_PIXELFORMAT_COMPRESSED_DXT5_RGBA; break;
397 default: break;
398 }
399 }
400 }
401 }
403 return image_data;
404}
405#endif
407#if defined(RLTEXGPU_SUPPORT_PKM)
408// Loading PKM image data (ETC1/ETC2 compression)
409// NOTE: KTX is the standard Khronos Group compression format (ETC1/ETC2, mipmaps)
410// PKM is a much simpler file format used mainly to contain a single ETC1/ETC2 compressed image (no mipmaps)
411void *rl_load_pkm_from_memory(const unsigned char *file_data, unsigned int file_size, int *width, int *height, int *format, int *mips)
412{
413 void *image_data = RLTEXGPU_NULL; // Image data pointer
415 unsigned char *file_data_ptr = (unsigned char *)file_data;
417 // Required extensions:
418 // GL_OES_compressed_ETC1_RGB8_texture (ETC1) (OpenGL ES 2.0)
419 // GL_ARB_ES3_compatibility (ETC2/EAC) (OpenGL ES 3.0)
421 // Supported tokens (defined by extensions)
422 // GL_ETC1_RGB8_OES 0x8D64
423 // GL_COMPRESSED_RGB8_ETC2 0x9274
424 // GL_COMPRESSED_RGBA8_ETC2_EAC 0x9278
426 // PKM file (ETC1) Header (16 bytes)
427 typedef struct {
428 char id[4]; // "PKM "
429 char version[2]; // "10" or "20"
430 unsigned short format; // Data format (big-endian) (Check list below)
431 unsigned short width; // Texture width (big-endian) (orig_width rounded to multiple of 4)
432 unsigned short height; // Texture height (big-endian) (orig_height rounded to multiple of 4)
433 unsigned short orig_width; // Original width (big-endian)
434 unsigned short orig_height; // Original height (big-endian)
435 } pkm_header;
437 // Formats list
438 // version 10: format: 0=ETC1_RGB, [1=ETC1_RGBA, 2=ETC1_RGB_MIP, 3=ETC1_RGBA_MIP] (not used)
439 // version 20: format: 0=ETC1_RGB, 1=ETC2_RGB, 2=ETC2_RGBA_OLD, 3=ETC2_RGBA, 4=ETC2_RGBA1, 5=ETC2_R, 6=ETC2_RG, 7=ETC2_SIGNED_R, 8=ETC2_SIGNED_R
441 // NOTE: The extended width and height are the widths rounded up to a multiple of 4
442 // NOTE: ETC is always 4bit per pixel (64 bit for each 4x4 block of pixels)
444 if (file_data_ptr != RLTEXGPU_NULL)
445 {
446 pkm_header *header = (pkm_header *)file_data_ptr;
448 if ((header->id[0] != 'P') || (header->id[1] != 'K') || (header->id[2] != 'M') || (header->id[3] != ' '))
449 {
450 RLTEXGPU_LOG("PKM file data not valid");
451 }
452 else
453 {
454 file_data_ptr += sizeof(pkm_header); // Skip header
456 // NOTE: format, width and height come as big-endian, data must be swapped to little-endian
457 header->format = ((header->format & 0x00FF) << 8) | ((header->format & 0xFF00) >> 8);
458 header->width = ((header->width & 0x00FF) << 8) | ((header->width & 0xFF00) >> 8);
459 header->height = ((header->height & 0x00FF) << 8) | ((header->height & 0xFF00) >> 8);
461 *width = header->width;
462 *height = header->height;
463 *mips = 1;
465 int bpp = 4;
466 if (header->format == 3) bpp = 8;
468 int data_size = (*width)*(*height)*bpp/8; // Total data size in bytes
470 image_data = RLTEXGPU_MALLOC(data_size*sizeof(unsigned char));
472 RLTEXGPU_MEMCPY(image_data, file_data_ptr, data_size);
474 if (header->format == 0) *format = RLTEXGPU_PIXELFORMAT_COMPRESSED_ETC1_RGB;
475 else if (header->format == 1) *format = RLTEXGPU_PIXELFORMAT_COMPRESSED_ETC2_RGB;
476 else if (header->format == 3) *format = RLTEXGPU_PIXELFORMAT_COMPRESSED_ETC2_EAC_RGBA;
477 }
478 }
480 return image_data;
481}
482#endif
484#if defined(RLTEXGPU_SUPPORT_KTX)
485// Load KTX compressed image data (ETC1/ETC2 compression)
486// TODO: Review KTX loading, many things changed!
487void *rl_load_ktx_from_memory(const unsigned char *file_data, unsigned int file_size, int *width, int *height, int *format, int *mips)
488{
489 void *image_data = RLTEXGPU_NULL; // Image data pointer
491 unsigned char *file_data_ptr = (unsigned char *)file_data;
493 // Required extensions:
494 // GL_OES_compressed_ETC1_RGB8_texture (ETC1)
495 // GL_ARB_ES3_compatibility (ETC2/EAC)
497 // Supported tokens (defined by extensions)
498 // GL_ETC1_RGB8_OES 0x8D64
499 // GL_COMPRESSED_RGB8_ETC2 0x9274
500 // GL_COMPRESSED_RGBA8_ETC2_EAC 0x9278
502 // KTX file Header (64 bytes)
503 // v1.1 - https://www.khronos.org/opengles/sdk/tools/KTX/file_format_spec/
504 // v2.0 - http://github.khronos.org/KTX-Specification/
506 // KTX 1.1 Header
507 // TODO: Support KTX 2.2 specs!
508 typedef struct {
509 char id[12]; // Identifier: "«KTX 11»\r\n\x1A\n"
510 unsigned int endianness; // Little endian: 0x01 0x02 0x03 0x04
511 unsigned int gl_type; // For compressed textures, glType must equal 0
512 unsigned int gl_type_size; // For compressed texture data, usually 1
513 unsigned int gl_format; // For compressed textures is 0
514 unsigned int gl_internal_format; // Compressed internal format
515 unsigned int gl_base_internal_format; // Same as glFormat (RGB, RGBA, ALPHA...)
516 unsigned int width; // Texture image width in pixels
517 unsigned int height; // Texture image height in pixels
518 unsigned int depth; // For 2D textures is 0
519 unsigned int elements; // Number of array elements, usually 0
520 unsigned int faces; // Cubemap faces, for no-cubemap = 1
521 unsigned int mipmap_levels; // Non-mipmapped textures = 1
522 unsigned int key_value_data_size; // Used to encode any arbitrary data...
523 } ktx_header;
525 // NOTE: Before start of every mipmap data block, we have: unsigned int data_size
527 if (file_data_ptr != RLTEXGPU_NULL)
528 {
529 ktx_header *header = (ktx_header *)file_data_ptr;
531 if ((header->id[1] != 'K') || (header->id[2] != 'T') || (header->id[3] != 'X') ||
532 (header->id[4] != ' ') || (header->id[5] != '1') || (header->id[6] != '1'))
533 {
534 RLTEXGPU_LOG("KTX file data not valid");
535 }
536 else
537 {
538 file_data_ptr += sizeof(ktx_header); // Move file data pointer
540 *width = header->width;
541 *height = header->height;
542 *mips = header->mipmap_levels;
544 file_data_ptr += header->key_value_data_size; // Skip value data size
546 int data_size = ((int *)file_data_ptr)[0];
547 file_data_ptr += sizeof(int);
549 image_data = RLTEXGPU_MALLOC(data_size*sizeof(unsigned char));
551 RLTEXGPU_MEMCPY(image_data, file_data_ptr, data_size);
553 if (header->gl_internal_format == 0x8D64) *format = RLTEXGPU_PIXELFORMAT_COMPRESSED_ETC1_RGB;
554 else if (header->gl_internal_format == 0x9274) *format = RLTEXGPU_PIXELFORMAT_COMPRESSED_ETC2_RGB;
555 else if (header->gl_internal_format == 0x9278) *format = RLTEXGPU_PIXELFORMAT_COMPRESSED_ETC2_EAC_RGBA;
557 // TODO: Support uncompressed data formats? Right now it returns format = 0!
558 }
559 }
561 return image_data;
562}
564// Save image data as KTX file
565// NOTE: By default KTX 1.1 spec is used, 2.0 is still on draft (01Oct2018)
566// TODO: Review KTX saving, many things changed!
567int rl_save_ktx(const char *file_name, void *data, int width, int height, int format, int mipmaps)
568{
569 // KTX file Header (64 bytes)
570 // v1.1 - https://www.khronos.org/opengles/sdk/tools/KTX/file_format_spec/
571 // v2.0 - https://github.khronos.org/KTX-Specification/ktxspec.v2.html
572 typedef struct {
573 char id[12]; // Identifier: "«KTX 11»\r\n\x1A\n" // KTX 2.0: "«KTX 20»\r\n\x1A\n"
574 unsigned int endianness; // Little endian: 0x01 0x02 0x03 0x04
575 unsigned int gl_type; // For compressed textures, glType must equal 0
576 unsigned int gl_type_size; // For compressed texture data, usually 1
577 unsigned int gl_format; // For compressed textures is 0
578 unsigned int gl_internal_format; // Compressed internal format
579 unsigned int gl_base_internal_format; // Same as glFormat (RGB, RGBA, ALPHA...) // KTX 2.0: UInt32 vkFormat
580 unsigned int width; // Texture image width in pixels
581 unsigned int height; // Texture image height in pixels
582 unsigned int depth; // For 2D textures is 0
583 unsigned int elements; // Number of array elements, usually 0
584 unsigned int faces; // Cubemap faces, for no-cubemap = 1
585 unsigned int mipmap_levels; // Non-mipmapped textures = 1
586 unsigned int key_value_data_size; // Used to encode any arbitrary data... // KTX 2.0: UInt32 levelOrder - ordering of the mipmap levels, usually 0
587 // KTX 2.0: UInt32 supercompressionScheme - 0 (None), 1 (Crunch CRN), 2 (Zlib DEFLATE)...
588 // KTX 2.0 defines additional header elements...
589 } ktx_header;
591 /*
592 Byte[12] identifier
593 UInt32 vkFormat
594 UInt32 typeSize
595 UInt32 pixelWidth
596 UInt32 pixelHeight
597 UInt32 pixelDepth
598 UInt32 layerCount
599 UInt32 faceCount
600 UInt32 levelCount
601 UInt32 supercompressionScheme
602 */
604 // Calculate file data_size required
605 int data_size = sizeof(ktx_header);
607 for (int i = 0, w = width, h = height; i < mipmaps; i++)
608 {
609 data_size += get_pixel_data_size(w, h, format);
610 w /= 2; h /= 2;
611 }
613 unsigned char *file_data = RLTEXGPU_MALLOC(data_size);
614 unsigned char *file_data_ptr = file_data;
616 ktx_header header = { 0 };
618 // KTX identifier (v1.1)
619 //unsigned char id[12] = { '«', 'K', 'T', 'X', ' ', '1', '1', '»', '\r', '\n', '\x1A', '\n' };
620 //unsigned char id[12] = { 0xAB, 0x4B, 0x54, 0x58, 0x20, 0x31, 0x31, 0xBB, 0x0D, 0x0A, 0x1A, 0x0A };
622 const char ktx_identifier[12] = { 0xAB, 'K', 'T', 'X', ' ', '1', '1', 0xBB, '\r', '\n', 0x1A, '\n' };
624 // Get the image header
625 RLTEXGPU_MEMCPY(header.id, ktx_identifier, 12); // KTX 1.1 signature
626 header.endianness = 0;
627 header.gl_type = 0; // Obtained from format
628 header.gl_type_size = 1;
629 header.gl_format = 0; // Obtained from format
630 header.gl_internal_format = 0; // Obtained from format
631 header.gl_base_internal_format = 0;
632 header.width = width;
633 header.height = height;
634 header.depth = 0;
635 header.elements = 0;
636 header.faces = 1;
637 header.mipmap_levels = mipmaps; // If it was 0, it means mipmaps should be generated on loading (not for compressed formats)
638 header.key_value_data_size = 0; // No extra data after the header
640 // TODO: WARNING: Function dependant on rlgl library!
641 rlGetGlTextureFormats(format, &header.gl_internal_format, &header.gl_format, &header.gl_type); // rlgl module function
643 header.gl_base_internal_format = header.gl_format; // TODO: WARNING: KTX 1.1 only
645 // NOTE: We can save into a .ktx all PixelFormats supported by raylib, including compressed formats like DXT, ETC or ASTC
647 if (header.gl_format == -1) RLTEXGPU_LOG("RL_GPUTEX: GL format not supported for KTX export (%i)", header.gl_format);
648 else
649 {
650 RLTEXGPU_MEMCPY(file_data_ptr, &header, sizeof(ktx_header));
651 file_data_ptr += sizeof(ktx_header);
653 int temp_width = width;
654 int temp_height = height;
655 int data_offset = 0;
657 // Save all mipmaps data
658 for (int i = 0; i < mipmaps; i++)
659 {
660 unsigned int data_size = get_pixel_data_size(temp_width, temp_height, format);
662 RLTEXGPU_MEMCPY(file_data_ptr, &data_size, sizeof(unsigned int));
663 RLTEXGPU_MEMCPY(file_data_ptr + 4, (unsigned char *)data + data_offset, data_size);
665 temp_width /= 2;
666 temp_height /= 2;
667 data_offset += data_size;
668 file_data_ptr += (4 + data_size);
669 }
670 }
672 // Save file data to file
673 int success = false;
674 FILE *file = fopen(file_name, "wb");
676 if (file != RLTEXGPU_NULL)
677 {
678 unsigned int count = (unsigned int)fwrite(file_data, sizeof(unsigned char), data_size, file);
680 if (count == 0) RLTEXGPU_LOG("FILEIO: [%s] Failed to write file", file_name);
681 else if (count != data_size) RLTEXGPU_LOG("FILEIO: [%s] File partially written", file_name);
682 else (void)0;
684 int result = fclose(file);
685 if (result != 0) RLTEXGPU_LOG("FILEIO: [%s] Failed to close file", file_name);
687 if (result == 0 && count == data_size) success = true;
688 }
689 else RLTEXGPU_LOG("FILEIO: [%s] Failed to open file", file_name);
691 RLTEXGPU_FREE(file_data); // Free file data buffer
693 // If all data has been written correctly to file, success = 1
694 return success;
695}
696#endif
698#if defined(RLTEXGPU_SUPPORT_PVR)
699// Loading PVR image data (uncompressed or PVRT compression)
700// NOTE: PVR v2 not supported, use PVR v3 instead
701void *rl_load_pvr_from_memory(const unsigned char *file_data, unsigned int file_size, int *width, int *height, int *format, int *mips)
702{
703 void *image_data = RLTEXGPU_NULL; // Image data pointer
705 unsigned char *file_data_ptr = (unsigned char *)file_data;
707 // Required extension:
708 // GL_IMG_texture_compression_pvrtc
710 // Supported tokens (defined by extensions)
711 // GL_COMPRESSED_RGB_PVRTC_4BPPV1_IMG 0x8C00
712 // GL_COMPRESSED_RGBA_PVRTC_4BPPV1_IMG 0x8C02
714#if 0 // Not used...
715 // PVR file v2 Header (52 bytes)
716 typedef struct {
717 unsigned int headerLength;
718 unsigned int height;
719 unsigned int width;
720 unsigned int numMipmaps;
721 unsigned int flags;
722 unsigned int dataLength;
723 unsigned int bpp;
724 unsigned int bitmaskRed;
725 unsigned int bitmaskGreen;
726 unsigned int bitmaskBlue;
727 unsigned int bitmaskAlpha;
728 unsigned int pvrTag;
729 unsigned int numSurfs;
730 } PVRHeaderV2;
731#endif
733 // PVR file v3 Header (52 bytes)
734 // NOTE: After it could be metadata (15 bytes?)
735 typedef struct {
736 char id[4];
737 unsigned int flags;
738 unsigned char channels[4]; // pixelFormat high part
739 unsigned char channel_depth[4]; // pixelFormat low part
740 unsigned int color_space;
741 unsigned int channel_type;
742 unsigned int height;
743 unsigned int width;
744 unsigned int depth;
745 unsigned int num_surfaces;
746 unsigned int num_faces;
747 unsigned int num_mipmaps;
748 unsigned int metadata_size;
749 } pvr_header;
751#if 0 // Not used...
752 // Metadata (usually 15 bytes)
753 typedef struct {
754 unsigned int devFOURCC;
755 unsigned int key;
756 unsigned int data_size; // Not used?
757 unsigned char *data; // Not used?
758 } PVRMetadata;
759#endif
761 if (file_data_ptr != RLTEXGPU_NULL)
762 {
763 // Check PVR image version
764 unsigned char pvr_version = file_data_ptr[0];
766 // Load different PVR data formats
767 if (pvr_version == 0x50)
768 {
769 pvr_header *header = (pvr_header *)file_data_ptr;
771 if ((header->id[0] != 'P') || (header->id[1] != 'V') || (header->id[2] != 'R') || (header->id[3] != 3))
772 {
773 RLTEXGPU_LOG("PVR file data not valid");
774 }
775 else
776 {
777 file_data_ptr += sizeof(pvr_header); // Skip header
779 *width = header->width;
780 *height = header->height;
781 *mips = header->num_mipmaps;
783 // Check data format
784 if (((header->channels[0] == 'l') && (header->channels[1] == 0)) && (header->channel_depth[0] == 8)) *format = RLTEXGPU_PIXELFORMAT_UNCOMPRESSED_GRAYSCALE;
785 else if (((header->channels[0] == 'l') && (header->channels[1] == 'a')) && ((header->channel_depth[0] == 8) && (header->channel_depth[1] == 8))) *format = RLTEXGPU_PIXELFORMAT_UNCOMPRESSED_GRAY_ALPHA;
786 else if ((header->channels[0] == 'r') && (header->channels[1] == 'g') && (header->channels[2] == 'b'))
787 {
788 if (header->channels[3] == 'a')
789 {
790 if ((header->channel_depth[0] == 5) && (header->channel_depth[1] == 5) && (header->channel_depth[2] == 5) && (header->channel_depth[3] == 1)) *format = RLTEXGPU_PIXELFORMAT_UNCOMPRESSED_R5G5B5A1;
791 else if ((header->channel_depth[0] == 4) && (header->channel_depth[1] == 4) && (header->channel_depth[2] == 4) && (header->channel_depth[3] == 4)) *format = RLTEXGPU_PIXELFORMAT_UNCOMPRESSED_R4G4B4A4;
792 else if ((header->channel_depth[0] == 8) && (header->channel_depth[1] == 8) && (header->channel_depth[2] == 8) && (header->channel_depth[3] == 8)) *format = RLTEXGPU_PIXELFORMAT_UNCOMPRESSED_R8G8B8A8;
793 }
794 else if (header->channels[3] == 0)
795 {
796 if ((header->channel_depth[0] == 5) && (header->channel_depth[1] == 6) && (header->channel_depth[2] == 5)) *format = RLTEXGPU_PIXELFORMAT_UNCOMPRESSED_R5G6B5;
797 else if ((header->channel_depth[0] == 8) && (header->channel_depth[1] == 8) && (header->channel_depth[2] == 8)) *format = RLTEXGPU_PIXELFORMAT_UNCOMPRESSED_R8G8B8;
798 }
799 }
800 else if (header->channels[0] == 2) *format = RLTEXGPU_PIXELFORMAT_COMPRESSED_PVRT_RGB;
801 else if (header->channels[0] == 3) *format = RLTEXGPU_PIXELFORMAT_COMPRESSED_PVRT_RGBA;
803 file_data_ptr += header->metadata_size; // Skip meta data header
805 // Calculate data size (depends on format)
806 int bpp = 0;
807 switch (*format)
808 {
809 case RLTEXGPU_PIXELFORMAT_UNCOMPRESSED_GRAYSCALE: bpp = 8; break;
810 case RLTEXGPU_PIXELFORMAT_UNCOMPRESSED_GRAY_ALPHA:
811 case RLTEXGPU_PIXELFORMAT_UNCOMPRESSED_R5G5B5A1:
812 case RLTEXGPU_PIXELFORMAT_UNCOMPRESSED_R5G6B5:
813 case RLTEXGPU_PIXELFORMAT_UNCOMPRESSED_R4G4B4A4: bpp = 16; break;
814 case RLTEXGPU_PIXELFORMAT_UNCOMPRESSED_R8G8B8A8: bpp = 32; break;
815 case RLTEXGPU_PIXELFORMAT_UNCOMPRESSED_R8G8B8: bpp = 24; break;
816 case RLTEXGPU_PIXELFORMAT_COMPRESSED_PVRT_RGB:
817 case RLTEXGPU_PIXELFORMAT_COMPRESSED_PVRT_RGBA: bpp = 4; break;
818 default: break;
819 }
821 int data_size = (*width)*(*height)*bpp/8; // Total data size in bytes
822 image_data = RLTEXGPU_MALLOC(data_size*sizeof(unsigned char));
824 RLTEXGPU_MEMCPY(image_data, file_data_ptr, data_size);
825 }
826 }
827 else if (pvr_version == 52) RLTEXGPU_LOG("PVRv2 format not supported, update your files to PVRv3");
828 }
830 return image_data;
831}
832#endif
834#if defined(RLTEXGPU_SUPPORT_ASTC)
835// Load ASTC compressed image data (ASTC compression)
836void *rl_load_astc_from_memory(const unsigned char *file_data, unsigned int file_size, int *width, int *height, int *format, int *mips)
837{
838 void *image_data = RLTEXGPU_NULL; // Image data pointer
840 unsigned char *file_data_ptr = (unsigned char *)file_data;
842 // Required extensions:
843 // GL_KHR_texture_compression_astc_hdr
844 // GL_KHR_texture_compression_astc_ldr
846 // Supported tokens (defined by extensions)
847 // GL_COMPRESSED_RGBA_ASTC_4x4_KHR 0x93b0
848 // GL_COMPRESSED_RGBA_ASTC_8x8_KHR 0x93b7
850 // ASTC file Header (16 bytes)
851 typedef struct {
852 unsigned char id[4]; // Signature: 0x13 0xAB 0xA1 0x5C
853 unsigned char blockX; // Block X dimensions
854 unsigned char blockY; // Block Y dimensions
855 unsigned char blockZ; // Block Z dimensions (1 for 2D images)
856 unsigned char width[3]; // void *width in pixels (24bit value)
857 unsigned char height[3]; // void *height in pixels (24bit value)
858 unsigned char length[3]; // void *Z-size (1 for 2D images)
859 } astc_header;
861 if (file_data_ptr != RLTEXGPU_NULL)
862 {
863 astc_header *header = (astc_header *)file_data_ptr;
865 if ((header->id[3] != 0x5c) || (header->id[2] != 0xa1) || (header->id[1] != 0xab) || (header->id[0] != 0x13))
866 {
867 RLTEXGPU_LOG("ASTC file data not valid");
868 }
869 else
870 {
871 file_data_ptr += sizeof(astc_header); // Skip header
873 // NOTE: Assuming Little Endian (could it be wrong?)
874 *width = 0x00000000 | ((int)header->width[2] << 16) | ((int)header->width[1] << 8) | ((int)header->width[0]);
875 *height = 0x00000000 | ((int)header->height[2] << 16) | ((int)header->height[1] << 8) | ((int)header->height[0]);
876 *mips = 1; // NOTE: ASTC format only contains one mipmap level
878 // NOTE: Each block is always stored in 128bit so we can calculate the bpp
879 int bpp = 128/(header->blockX*header->blockY);
881 // NOTE: Currently we only support 2 blocks configurations: 4x4 and 8x8
882 if ((bpp == 8) || (bpp == 2))
883 {
884 int data_size = (*width)*(*height)*bpp/8; // Data size in bytes
886 image_data = RLTEXGPU_MALLOC(data_size*sizeof(unsigned char));
888 RLTEXGPU_MEMCPY(image_data, file_data_ptr, data_size);
890 if (bpp == 8) *format = RLTEXGPU_PIXELFORMAT_COMPRESSED_ASTC_4x4_RGBA;
891 else if (bpp == 2) *format = RLTEXGPU_PIXELFORMAT_COMPRESSED_ASTC_8x8_RGBA;
892 }
893 else RLTEXGPU_LOG("ASTC block size configuration not supported");
894 }
895 }
897 return image_data;
898}
899#endif
901//----------------------------------------------------------------------------------
902// Module Internal Functions Definition
903//----------------------------------------------------------------------------------
904// Get pixel data size in bytes for certain pixel format
905static int get_pixel_data_size(int width, int height, int format)
906{
907 int data_size = 0; // Size in bytes
908 int bpp = 0; // Bits per pixel
910 switch (format)
911 {
912 case RLTEXGPU_PIXELFORMAT_UNCOMPRESSED_GRAYSCALE: bpp = 8; break;
913 case RLTEXGPU_PIXELFORMAT_UNCOMPRESSED_GRAY_ALPHA:
914 case RLTEXGPU_PIXELFORMAT_UNCOMPRESSED_R5G6B5:
915 case RLTEXGPU_PIXELFORMAT_UNCOMPRESSED_R5G5B5A1:
916 case RLTEXGPU_PIXELFORMAT_UNCOMPRESSED_R4G4B4A4: bpp = 16; break;
917 case RLTEXGPU_PIXELFORMAT_UNCOMPRESSED_R8G8B8A8: bpp = 32; break;
918 case RLTEXGPU_PIXELFORMAT_UNCOMPRESSED_R8G8B8: bpp = 24; break;
919 case RLTEXGPU_PIXELFORMAT_UNCOMPRESSED_R32: bpp = 32; break;
920 case RLTEXGPU_PIXELFORMAT_UNCOMPRESSED_R32G32B32: bpp = 32*3; break;
921 case RLTEXGPU_PIXELFORMAT_UNCOMPRESSED_R32G32B32A32: bpp = 32*4; break;
922 case RLTEXGPU_PIXELFORMAT_COMPRESSED_DXT1_RGB:
923 case RLTEXGPU_PIXELFORMAT_COMPRESSED_DXT1_RGBA:
924 case RLTEXGPU_PIXELFORMAT_COMPRESSED_ETC1_RGB:
925 case RLTEXGPU_PIXELFORMAT_COMPRESSED_ETC2_RGB:
926 case RLTEXGPU_PIXELFORMAT_COMPRESSED_PVRT_RGB:
927 case RLTEXGPU_PIXELFORMAT_COMPRESSED_PVRT_RGBA: bpp = 4; break;
928 case RLTEXGPU_PIXELFORMAT_COMPRESSED_DXT3_RGBA:
929 case RLTEXGPU_PIXELFORMAT_COMPRESSED_DXT5_RGBA:
930 case RLTEXGPU_PIXELFORMAT_COMPRESSED_ETC2_EAC_RGBA:
931 case RLTEXGPU_PIXELFORMAT_COMPRESSED_ASTC_4x4_RGBA: bpp = 8; break;
932 case RLTEXGPU_PIXELFORMAT_COMPRESSED_ASTC_8x8_RGBA: bpp = 2; break;
933 default: break;
934 }
936 data_size = width*height*bpp/8; // Total data size in bytes
938 // Most compressed formats works on 4x4 blocks,
939 // if texture is smaller, minimum dataSize is 8 or 16
940 if ((width < 4) && (height < 4))
941 {
942 if ((format >= RLTEXGPU_PIXELFORMAT_COMPRESSED_DXT1_RGB) && (format < RLTEXGPU_PIXELFORMAT_COMPRESSED_DXT3_RGBA)) data_size = 8;
943 else if ((format >= RLTEXGPU_PIXELFORMAT_COMPRESSED_DXT3_RGBA) && (format < RLTEXGPU_PIXELFORMAT_COMPRESSED_ASTC_8x8_RGBA)) data_size = 16;
944 }
946 return data_size;
947}
949// Get OpenGL internal formats and data type from rlGpuTexPixelFormat
950void get_gl_texture_formats(int format, unsigned int *gl_internal_format, unsigned int *gl_format, unsigned int *gl_type)
951{
952 // KTX 1.1 uses OpenGL formats on header info but KTX 2.0 uses Vulkan texture formats,
953 // if this library is being improved to support KTX 2.0, it requires those formats to be provided -> View list at the end!
955 /*
956 *gl_internal_format = 0;
957 *gl_format = 0;
958 *gl_type = 0;
960 switch (format)
961 {
962 #if defined(GRAPHICS_API_OPENGL_11) || defined(GRAPHICS_API_OPENGL_21) || defined(GRAPHICS_API_OPENGL_ES2)
963 // NOTE: on OpenGL ES 2.0 (WebGL), internalFormat must match format and options allowed are: GL_LUMINANCE, GL_RGB, GL_RGBA
964 case RLTEXGPU_PIXELFORMAT_UNCOMPRESSED_GRAYSCALE: *gl_internal_format = GL_LUMINANCE; *gl_format = GL_LUMINANCE; *gl_type = GL_UNSIGNED_BYTE; break;
965 case RLTEXGPU_PIXELFORMAT_UNCOMPRESSED_GRAY_ALPHA: *gl_internal_format = GL_LUMINANCE_ALPHA; *gl_format = GL_LUMINANCE_ALPHA; *gl_type = GL_UNSIGNED_BYTE; break;
966 case RLTEXGPU_PIXELFORMAT_UNCOMPRESSED_R5G6B5: *gl_internal_format = GL_RGB; *gl_format = GL_RGB; *gl_type = GL_UNSIGNED_SHORT_5_6_5; break;
967 case RLTEXGPU_PIXELFORMAT_UNCOMPRESSED_R8G8B8: *gl_internal_format = GL_RGB; *gl_format = GL_RGB; *gl_type = GL_UNSIGNED_BYTE; break;
968 case RLTEXGPU_PIXELFORMAT_UNCOMPRESSED_R5G5B5A1: *gl_internal_format = GL_RGBA; *gl_format = GL_RGBA; *gl_type = GL_UNSIGNED_SHORT_5_5_5_1; break;
969 case RLTEXGPU_PIXELFORMAT_UNCOMPRESSED_R4G4B4A4: *gl_internal_format = GL_RGBA; *gl_format = GL_RGBA; *gl_type = GL_UNSIGNED_SHORT_4_4_4_4; break;
970 case RLTEXGPU_PIXELFORMAT_UNCOMPRESSED_R8G8B8A8: *gl_internal_format = GL_RGBA; *gl_format = GL_RGBA; *gl_type = GL_UNSIGNED_BYTE; break;
971 #if !defined(GRAPHICS_API_OPENGL_11)
972 #if defined(GRAPHICS_API_OPENGL_ES3)
973 case RLTEXGPU_PIXELFORMAT_UNCOMPRESSED_R32: *gl_internal_format = GL_R32F_EXT; *gl_format = GL_RED_EXT; *gl_type = GL_FLOAT; break;
974 case RLTEXGPU_PIXELFORMAT_UNCOMPRESSED_R32G32B32: *gl_internal_format = GL_RGB32F_EXT; *gl_format = GL_RGB; *gl_type = GL_FLOAT; break;
975 case RLTEXGPU_PIXELFORMAT_UNCOMPRESSED_R32G32B32A32: *gl_internal_format = GL_RGBA32F_EXT; *gl_format = GL_RGBA; *gl_type = GL_FLOAT; break;
976 case RLTEXGPU_PIXELFORMAT_UNCOMPRESSED_R16: *gl_internal_format = GL_R16F_EXT; *gl_format = GL_RED_EXT; *gl_type = GL_HALF_FLOAT; break;
977 case RLTEXGPU_PIXELFORMAT_UNCOMPRESSED_R16G16B16: *gl_internal_format = GL_RGB16F_EXT; *gl_format = GL_RGB; *gl_type = GL_HALF_FLOAT; break;
978 case RLTEXGPU_PIXELFORMAT_UNCOMPRESSED_R16G16B16A16: *gl_internal_format = GL_RGBA16F_EXT; *gl_format = GL_RGBA; *gl_type = GL_HALF_FLOAT; break;
979 #else
980 case RLTEXGPU_PIXELFORMAT_UNCOMPRESSED_R32: *gl_internal_format = GL_LUMINANCE; *gl_format = GL_LUMINANCE; *gl_type = GL_FLOAT; break; // NOTE: Requires extension OES_texture_float
981 case RLTEXGPU_PIXELFORMAT_UNCOMPRESSED_R32G32B32: *gl_internal_format = GL_RGB; *gl_format = GL_RGB; *gl_type = GL_FLOAT; break; // NOTE: Requires extension OES_texture_float
982 case RLTEXGPU_PIXELFORMAT_UNCOMPRESSED_R32G32B32A32: *gl_internal_format = GL_RGBA; *gl_format = GL_RGBA; *gl_type = GL_FLOAT; break; // NOTE: Requires extension OES_texture_float
983 #if defined(GRAPHICS_API_OPENGL_21)
984 case RLTEXGPU_PIXELFORMAT_UNCOMPRESSED_R16: *gl_internal_format = GL_LUMINANCE; *gl_format = GL_LUMINANCE; *gl_type = GL_HALF_FLOAT_ARB; break;
985 case RLTEXGPU_PIXELFORMAT_UNCOMPRESSED_R16G16B16: *gl_internal_format = GL_RGB; *gl_format = GL_RGB; *gl_type = GL_HALF_FLOAT_ARB; break;
986 case RLTEXGPU_PIXELFORMAT_UNCOMPRESSED_R16G16B16A16: *gl_internal_format = GL_RGBA; *gl_format = GL_RGBA; *gl_type = GL_HALF_FLOAT_ARB; break;
987 #else // defined(GRAPHICS_API_OPENGL_ES2)
988 case RLTEXGPU_PIXELFORMAT_UNCOMPRESSED_R16: *gl_internal_format = GL_LUMINANCE; *gl_format = GL_LUMINANCE; *gl_type = GL_HALF_FLOAT_OES; break; // NOTE: Requires extension OES_texture_half_float
989 case RLTEXGPU_PIXELFORMAT_UNCOMPRESSED_R16G16B16: *gl_internal_format = GL_RGB; *gl_format = GL_RGB; *gl_type = GL_HALF_FLOAT_OES; break; // NOTE: Requires extension OES_texture_half_float
990 case RLTEXGPU_PIXELFORMAT_UNCOMPRESSED_R16G16B16A16: *gl_internal_format = GL_RGBA; *gl_format = GL_RGBA; *gl_type = GL_HALF_FLOAT_OES; break; // NOTE: Requires extension OES_texture_half_float
991 #endif
992 #endif
993 #endif
994 #elif defined(GRAPHICS_API_OPENGL_33)
995 case RLTEXGPU_PIXELFORMAT_UNCOMPRESSED_GRAYSCALE: *gl_internal_format = GL_R8; *gl_format = GL_RED; *gl_type = GL_UNSIGNED_BYTE; break;
996 case RLTEXGPU_PIXELFORMAT_UNCOMPRESSED_GRAY_ALPHA: *gl_internal_format = GL_RG8; *gl_format = GL_RG; *gl_type = GL_UNSIGNED_BYTE; break;
997 case RLTEXGPU_PIXELFORMAT_UNCOMPRESSED_R5G6B5: *gl_internal_format = GL_RGB565; *gl_format = GL_RGB; *gl_type = GL_UNSIGNED_SHORT_5_6_5; break;
998 case RLTEXGPU_PIXELFORMAT_UNCOMPRESSED_R8G8B8: *gl_internal_format = GL_RGB8; *gl_format = GL_RGB; *gl_type = GL_UNSIGNED_BYTE; break;
999 case RLTEXGPU_PIXELFORMAT_UNCOMPRESSED_R5G5B5A1: *gl_internal_format = GL_RGB5_A1; *gl_format = GL_RGBA; *gl_type = GL_UNSIGNED_SHORT_5_5_5_1; break;
1000 case RLTEXGPU_PIXELFORMAT_UNCOMPRESSED_R4G4B4A4: *gl_internal_format = GL_RGBA4; *gl_format = GL_RGBA; *gl_type = GL_UNSIGNED_SHORT_4_4_4_4; break;
1001 case RLTEXGPU_PIXELFORMAT_UNCOMPRESSED_R8G8B8A8: *gl_internal_format = GL_RGBA8; *gl_format = GL_RGBA; *gl_type = GL_UNSIGNED_BYTE; break;
1002 case RLTEXGPU_PIXELFORMAT_UNCOMPRESSED_R32: *gl_internal_format = GL_R32F; *gl_format = GL_RED; *gl_type = GL_FLOAT; break;
1003 case RLTEXGPU_PIXELFORMAT_UNCOMPRESSED_R32G32B32: *gl_internal_format = GL_RGB32F; *gl_format = GL_RGB; *gl_type = GL_FLOAT; break;
1004 case RLTEXGPU_PIXELFORMAT_UNCOMPRESSED_R32G32B32A32: *gl_internal_format = GL_RGBA32F; *gl_format = GL_RGBA; *gl_type = GL_FLOAT; break;
1005 case RLTEXGPU_PIXELFORMAT_UNCOMPRESSED_R16: *gl_internal_format = GL_R16F; *gl_format = GL_RED; *gl_type = GL_HALF_FLOAT; break;
1006 case RLTEXGPU_PIXELFORMAT_UNCOMPRESSED_R16G16B16: *gl_internal_format = GL_RGB16F; *gl_format = GL_RGB; *gl_type = GL_HALF_FLOAT; break;
1007 case RLTEXGPU_PIXELFORMAT_UNCOMPRESSED_R16G16B16A16: *gl_internal_format = GL_RGBA16F; *gl_format = GL_RGBA; *gl_type = GL_HALF_FLOAT; break;
1008 #endif
1009 #if !defined(GRAPHICS_API_OPENGL_11)
1010 case RLTEXGPU_PIXELFORMAT_COMPRESSED_DXT1_RGB: *gl_internal_format = GL_COMPRESSED_RGB_S3TC_DXT1_EXT; break;
1011 case RLTEXGPU_PIXELFORMAT_COMPRESSED_DXT1_RGBA: *gl_internal_format = GL_COMPRESSED_RGBA_S3TC_DXT1_EXT; break;
1012 case RLTEXGPU_PIXELFORMAT_COMPRESSED_DXT3_RGBA: *gl_internal_format = GL_COMPRESSED_RGBA_S3TC_DXT3_EXT; break;
1013 case RLTEXGPU_PIXELFORMAT_COMPRESSED_DXT5_RGBA: *gl_internal_format = GL_COMPRESSED_RGBA_S3TC_DXT5_EXT; break;
1014 case RLTEXGPU_PIXELFORMAT_COMPRESSED_ETC1_RGB: *gl_internal_format = GL_ETC1_RGB8_OES; break; // NOTE: Requires OpenGL ES 2.0 or OpenGL 4.3
1015 case RLTEXGPU_PIXELFORMAT_COMPRESSED_ETC2_RGB: *gl_internal_format = GL_COMPRESSED_RGB8_ETC2; break; // NOTE: Requires OpenGL ES 3.0 or OpenGL 4.3
1016 case RLTEXGPU_PIXELFORMAT_COMPRESSED_ETC2_EAC_RGBA: *gl_internal_format = GL_COMPRESSED_RGBA8_ETC2_EAC; break; // NOTE: Requires OpenGL ES 3.0 or OpenGL 4.3
1017 case RLTEXGPU_PIXELFORMAT_COMPRESSED_PVRT_RGB: *gl_internal_format = GL_COMPRESSED_RGB_PVRTC_4BPPV1_IMG; break; // NOTE: Requires PowerVR GPU
1018 case RLTEXGPU_PIXELFORMAT_COMPRESSED_PVRT_RGBA: *gl_internal_format = GL_COMPRESSED_RGBA_PVRTC_4BPPV1_IMG; break; // NOTE: Requires PowerVR GPU
1019 case RLTEXGPU_PIXELFORMAT_COMPRESSED_ASTC_4x4_RGBA: *gl_internal_format = GL_COMPRESSED_RGBA_ASTC_4x4_KHR; break; // NOTE: Requires OpenGL ES 3.1 or OpenGL 4.3
1020 case RLTEXGPU_PIXELFORMAT_COMPRESSED_ASTC_8x8_RGBA: *gl_internal_format = GL_COMPRESSED_RGBA_ASTC_8x8_KHR; break; // NOTE: Requires OpenGL ES 3.1 or OpenGL 4.3
1021 #endif
1022 default: RLTEXGPU_LOG("GPUTEX: Current format not supported (%i)", format); break;
1023 }
1024 */
1025}
1026#endif // RLTEXGPU_IMPLEMENTATION
1028/*
1029// OpenGL texture data formats
1030// NOTE: Those values can be useful for KTX 1.1 saving,
1031// probably only the latest OpenGL ones, not the extensions ones
1032// So, there is no need to include full OpenGL headers
1033#define GL_UNSIGNED_BYTE 0x1401
1034#define GL_UNSIGNED_SHORT_5_6_5 0x8363
1035#define GL_UNSIGNED_SHORT_4_4_4_4 0x8033
1036#define GL_UNSIGNED_SHORT_5_5_5_1 0x8034
1037#define GL_FLOAT 0x1406
1038#define GL_HALF_FLOAT 0x140b
1039#define GL_HALF_FLOAT_ARB 0x140b
1040#define GL_HALF_FLOAT_OES 0x8d61
1042#define GL_RED_EXT 0x1903
1043#define GL_RGB 0x1907
1044#define GL_RGBA 0x1908
1045#define GL_LUMINANCE 0x1909
1046#define GL_R8 0x8229
1047#define GL_RG8 0x822b
1048#define GL_RGB565 0x8d62
1049#define GL_RGB8 0x8051
1050#define GL_RGB5_A1 0x8057
1051#define GL_RGBA4 0x8056
1052#define GL_RGBA8 0x8058
1053#define GL_R16F 0x822d
1054#define GL_RGB16F 0x881b
1055#define GL_RGBA16F 0x881a
1056#define GL_R32F 0x822e
1057#define GL_RGB32F 0x8815
1058#define GL_RGBA32F 0x8814
1060#define GL_R32F_EXT 0x822e
1061#define GL_RGB32F_EXT 0x8815
1062#define GL_RGBA32F_EXT 0x8814
1063#define GL_R16F_EXT 0x822d
1064#define GL_RGB16F_EXT 0x881b
1065#define GL_RGBA16F_EXT 0x881a
1067// S3TC (DXT) compression
1068#define GL_COMPRESSED_RGB_S3TC_DXT1_EXT 0x83f0
1069#define GL_COMPRESSED_RGBA_S3TC_DXT1_EXT 0x83f1
1070#define GL_COMPRESSED_RGBA_S3TC_DXT3_EXT 0x83f2
1071#define GL_COMPRESSED_RGBA_S3TC_DXT5_EXT 0x83f3
1073// ETC formats
1074#define GL_ETC1_RGB8_OES 0x8d64
1075#define GL_COMPRESSED_RGB8_ETC2 0x9274
1076#define GL_COMPRESSED_RGBA8_ETC2_EAC 0x9278
1078// PVRTC
1079#define GL_COMPRESSED_RGB_PVRTC_4BPPV1_IMG 0x8c00
1080#define GL_COMPRESSED_RGBA_PVRTC_4BPPV1_IMG 0x8c02
1082// ASTC
1083#define GL_COMPRESSED_RGBA_ASTC_4x4_KHR 0x93b0
1084#define GL_COMPRESSED_RGBA_ASTC_8x8_KHR 0x93b7
1085*/
1087/*
1088// Vulkan texture formats
1089typedef enum VkFormat {
1090 // Provided by VK_VERSION_1_0
1091 VK_FORMAT_UNDEFINED = 0,
1092 VK_FORMAT_R4G4_UNORM_PACK8 = 1,
1093 VK_FORMAT_R4G4B4A4_UNORM_PACK16 = 2,
1094 VK_FORMAT_B4G4R4A4_UNORM_PACK16 = 3,
1095 VK_FORMAT_R5G6B5_UNORM_PACK16 = 4,
1096 VK_FORMAT_B5G6R5_UNORM_PACK16 = 5,
1097 VK_FORMAT_R5G5B5A1_UNORM_PACK16 = 6,
1098 VK_FORMAT_B5G5R5A1_UNORM_PACK16 = 7,
1099 VK_FORMAT_A1R5G5B5_UNORM_PACK16 = 8,
1100 VK_FORMAT_R8_UNORM = 9,
1101 VK_FORMAT_R8_SNORM = 10,
1102 VK_FORMAT_R8_USCALED = 11,
1103 VK_FORMAT_R8_SSCALED = 12,
1104 VK_FORMAT_R8_UINT = 13,
1105 VK_FORMAT_R8_SINT = 14,
1106 VK_FORMAT_R8_SRGB = 15,
1107 VK_FORMAT_R8G8_UNORM = 16,
1108 VK_FORMAT_R8G8_SNORM = 17,
1109 VK_FORMAT_R8G8_USCALED = 18,
1110 VK_FORMAT_R8G8_SSCALED = 19,
1111 VK_FORMAT_R8G8_UINT = 20,
1112 VK_FORMAT_R8G8_SINT = 21,
1113 VK_FORMAT_R8G8_SRGB = 22,
1114 VK_FORMAT_R8G8B8_UNORM = 23,
1115 VK_FORMAT_R8G8B8_SNORM = 24,
1116 VK_FORMAT_R8G8B8_USCALED = 25,
1117 VK_FORMAT_R8G8B8_SSCALED = 26,
1118 VK_FORMAT_R8G8B8_UINT = 27,
1119 VK_FORMAT_R8G8B8_SINT = 28,
1120 VK_FORMAT_R8G8B8_SRGB = 29,
1121 VK_FORMAT_B8G8R8_UNORM = 30,
1122 VK_FORMAT_B8G8R8_SNORM = 31,
1123 VK_FORMAT_B8G8R8_USCALED = 32,
1124 VK_FORMAT_B8G8R8_SSCALED = 33,
1125 VK_FORMAT_B8G8R8_UINT = 34,
1126 VK_FORMAT_B8G8R8_SINT = 35,
1127 VK_FORMAT_B8G8R8_SRGB = 36,
1128 VK_FORMAT_R8G8B8A8_UNORM = 37,
1129 VK_FORMAT_R8G8B8A8_SNORM = 38,
1130 VK_FORMAT_R8G8B8A8_USCALED = 39,
1131 VK_FORMAT_R8G8B8A8_SSCALED = 40,
1132 VK_FORMAT_R8G8B8A8_UINT = 41,
1133 VK_FORMAT_R8G8B8A8_SINT = 42,
1134 VK_FORMAT_R8G8B8A8_SRGB = 43,
1135 VK_FORMAT_B8G8R8A8_UNORM = 44,
1136 VK_FORMAT_B8G8R8A8_SNORM = 45,
1137 VK_FORMAT_B8G8R8A8_USCALED = 46,
1138 VK_FORMAT_B8G8R8A8_SSCALED = 47,
1139 VK_FORMAT_B8G8R8A8_UINT = 48,
1140 VK_FORMAT_B8G8R8A8_SINT = 49,
1141 VK_FORMAT_B8G8R8A8_SRGB = 50,
1142 VK_FORMAT_A8B8G8R8_UNORM_PACK32 = 51,
1143 VK_FORMAT_A8B8G8R8_SNORM_PACK32 = 52,
1144 VK_FORMAT_A8B8G8R8_USCALED_PACK32 = 53,
1145 VK_FORMAT_A8B8G8R8_SSCALED_PACK32 = 54,
1146 VK_FORMAT_A8B8G8R8_UINT_PACK32 = 55,
1147 VK_FORMAT_A8B8G8R8_SINT_PACK32 = 56,
1148 VK_FORMAT_A8B8G8R8_SRGB_PACK32 = 57,
1149 VK_FORMAT_A2R10G10B10_UNORM_PACK32 = 58,
1150 VK_FORMAT_A2R10G10B10_SNORM_PACK32 = 59,
1151 VK_FORMAT_A2R10G10B10_USCALED_PACK32 = 60,
1152 VK_FORMAT_A2R10G10B10_SSCALED_PACK32 = 61,
1153 VK_FORMAT_A2R10G10B10_UINT_PACK32 = 62,
1154 VK_FORMAT_A2R10G10B10_SINT_PACK32 = 63,
1155 VK_FORMAT_A2B10G10R10_UNORM_PACK32 = 64,
1156 VK_FORMAT_A2B10G10R10_SNORM_PACK32 = 65,
1157 VK_FORMAT_A2B10G10R10_USCALED_PACK32 = 66,
1158 VK_FORMAT_A2B10G10R10_SSCALED_PACK32 = 67,
1159 VK_FORMAT_A2B10G10R10_UINT_PACK32 = 68,
1160 VK_FORMAT_A2B10G10R10_SINT_PACK32 = 69,
1161 VK_FORMAT_R16_UNORM = 70,
1162 VK_FORMAT_R16_SNORM = 71,
1163 VK_FORMAT_R16_USCALED = 72,
1164 VK_FORMAT_R16_SSCALED = 73,
1165 VK_FORMAT_R16_UINT = 74,
1166 VK_FORMAT_R16_SINT = 75,
1167 VK_FORMAT_R16_SFLOAT = 76,
1168 VK_FORMAT_R16G16_UNORM = 77,
1169 VK_FORMAT_R16G16_SNORM = 78,
1170 VK_FORMAT_R16G16_USCALED = 79,
1171 VK_FORMAT_R16G16_SSCALED = 80,
1172 VK_FORMAT_R16G16_UINT = 81,
1173 VK_FORMAT_R16G16_SINT = 82,
1174 VK_FORMAT_R16G16_SFLOAT = 83,
1175 VK_FORMAT_R16G16B16_UNORM = 84,
1176 VK_FORMAT_R16G16B16_SNORM = 85,
1177 VK_FORMAT_R16G16B16_USCALED = 86,
1178 VK_FORMAT_R16G16B16_SSCALED = 87,
1179 VK_FORMAT_R16G16B16_UINT = 88,
1180 VK_FORMAT_R16G16B16_SINT = 89,
1181 VK_FORMAT_R16G16B16_SFLOAT = 90,
1182 VK_FORMAT_R16G16B16A16_UNORM = 91,
1183 VK_FORMAT_R16G16B16A16_SNORM = 92,
1184 VK_FORMAT_R16G16B16A16_USCALED = 93,
1185 VK_FORMAT_R16G16B16A16_SSCALED = 94,
1186 VK_FORMAT_R16G16B16A16_UINT = 95,
1187 VK_FORMAT_R16G16B16A16_SINT = 96,
1188 VK_FORMAT_R16G16B16A16_SFLOAT = 97,
1189 VK_FORMAT_R32_UINT = 98,
1190 VK_FORMAT_R32_SINT = 99,
1191 VK_FORMAT_R32_SFLOAT = 100,
1192 VK_FORMAT_R32G32_UINT = 101,
1193 VK_FORMAT_R32G32_SINT = 102,
1194 VK_FORMAT_R32G32_SFLOAT = 103,
1195 VK_FORMAT_R32G32B32_UINT = 104,
1196 VK_FORMAT_R32G32B32_SINT = 105,
1197 VK_FORMAT_R32G32B32_SFLOAT = 106,
1198 VK_FORMAT_R32G32B32A32_UINT = 107,
1199 VK_FORMAT_R32G32B32A32_SINT = 108,
1200 VK_FORMAT_R32G32B32A32_SFLOAT = 109,
1201 VK_FORMAT_R64_UINT = 110,
1202 VK_FORMAT_R64_SINT = 111,
1203 VK_FORMAT_R64_SFLOAT = 112,
1204 VK_FORMAT_R64G64_UINT = 113,
1205 VK_FORMAT_R64G64_SINT = 114,
1206 VK_FORMAT_R64G64_SFLOAT = 115,
1207 VK_FORMAT_R64G64B64_UINT = 116,
1208 VK_FORMAT_R64G64B64_SINT = 117,
1209 VK_FORMAT_R64G64B64_SFLOAT = 118,
1210 VK_FORMAT_R64G64B64A64_UINT = 119,
1211 VK_FORMAT_R64G64B64A64_SINT = 120,
1212 VK_FORMAT_R64G64B64A64_SFLOAT = 121,
1213 VK_FORMAT_B10G11R11_UFLOAT_PACK32 = 122,
1214 VK_FORMAT_E5B9G9R9_UFLOAT_PACK32 = 123,
1215 VK_FORMAT_D16_UNORM = 124,
1216 VK_FORMAT_X8_D24_UNORM_PACK32 = 125,
1217 VK_FORMAT_D32_SFLOAT = 126,
1218 VK_FORMAT_S8_UINT = 127,
1219 VK_FORMAT_D16_UNORM_S8_UINT = 128,
1220 VK_FORMAT_D24_UNORM_S8_UINT = 129,
1221 VK_FORMAT_D32_SFLOAT_S8_UINT = 130,
1222 VK_FORMAT_BC1_RGB_UNORM_BLOCK = 131,
1223 VK_FORMAT_BC1_RGB_SRGB_BLOCK = 132,
1224 VK_FORMAT_BC1_RGBA_UNORM_BLOCK = 133,
1225 VK_FORMAT_BC1_RGBA_SRGB_BLOCK = 134,
1226 VK_FORMAT_BC2_UNORM_BLOCK = 135,
1227 VK_FORMAT_BC2_SRGB_BLOCK = 136,
1228 VK_FORMAT_BC3_UNORM_BLOCK = 137,
1229 VK_FORMAT_BC3_SRGB_BLOCK = 138,
1230 VK_FORMAT_BC4_UNORM_BLOCK = 139,
1231 VK_FORMAT_BC4_SNORM_BLOCK = 140,
1232 VK_FORMAT_BC5_UNORM_BLOCK = 141,
1233 VK_FORMAT_BC5_SNORM_BLOCK = 142,
1234 VK_FORMAT_BC6H_UFLOAT_BLOCK = 143,
1235 VK_FORMAT_BC6H_SFLOAT_BLOCK = 144,
1236 VK_FORMAT_BC7_UNORM_BLOCK = 145,
1237 VK_FORMAT_BC7_SRGB_BLOCK = 146,
1238 VK_FORMAT_ETC2_R8G8B8_UNORM_BLOCK = 147,
1239 VK_FORMAT_ETC2_R8G8B8_SRGB_BLOCK = 148,
1240 VK_FORMAT_ETC2_R8G8B8A1_UNORM_BLOCK = 149,
1241 VK_FORMAT_ETC2_R8G8B8A1_SRGB_BLOCK = 150,
1242 VK_FORMAT_ETC2_R8G8B8A8_UNORM_BLOCK = 151,
1243 VK_FORMAT_ETC2_R8G8B8A8_SRGB_BLOCK = 152,
1244 VK_FORMAT_EAC_R11_UNORM_BLOCK = 153,
1245 VK_FORMAT_EAC_R11_SNORM_BLOCK = 154,
1246 VK_FORMAT_EAC_R11G11_UNORM_BLOCK = 155,
1247 VK_FORMAT_EAC_R11G11_SNORM_BLOCK = 156,
1248 VK_FORMAT_ASTC_4x4_UNORM_BLOCK = 157,
1249 VK_FORMAT_ASTC_4x4_SRGB_BLOCK = 158,
1250 VK_FORMAT_ASTC_5x4_UNORM_BLOCK = 159,
1251 VK_FORMAT_ASTC_5x4_SRGB_BLOCK = 160,
1252 VK_FORMAT_ASTC_5x5_UNORM_BLOCK = 161,
1253 VK_FORMAT_ASTC_5x5_SRGB_BLOCK = 162,
1254 VK_FORMAT_ASTC_6x5_UNORM_BLOCK = 163,
1255 VK_FORMAT_ASTC_6x5_SRGB_BLOCK = 164,
1256 VK_FORMAT_ASTC_6x6_UNORM_BLOCK = 165,
1257 VK_FORMAT_ASTC_6x6_SRGB_BLOCK = 166,
1258 VK_FORMAT_ASTC_8x5_UNORM_BLOCK = 167,
1259 VK_FORMAT_ASTC_8x5_SRGB_BLOCK = 168,
1260 VK_FORMAT_ASTC_8x6_UNORM_BLOCK = 169,
1261 VK_FORMAT_ASTC_8x6_SRGB_BLOCK = 170,
1262 VK_FORMAT_ASTC_8x8_UNORM_BLOCK = 171,
1263 VK_FORMAT_ASTC_8x8_SRGB_BLOCK = 172,
1264 VK_FORMAT_ASTC_10x5_UNORM_BLOCK = 173,
1265 VK_FORMAT_ASTC_10x5_SRGB_BLOCK = 174,
1266 VK_FORMAT_ASTC_10x6_UNORM_BLOCK = 175,
1267 VK_FORMAT_ASTC_10x6_SRGB_BLOCK = 176,
1268 VK_FORMAT_ASTC_10x8_UNORM_BLOCK = 177,
1269 VK_FORMAT_ASTC_10x8_SRGB_BLOCK = 178,
1270 VK_FORMAT_ASTC_10x10_UNORM_BLOCK = 179,
1271 VK_FORMAT_ASTC_10x10_SRGB_BLOCK = 180,
1272 VK_FORMAT_ASTC_12x10_UNORM_BLOCK = 181,
1273 VK_FORMAT_ASTC_12x10_SRGB_BLOCK = 182,
1274 VK_FORMAT_ASTC_12x12_UNORM_BLOCK = 183,
1275 VK_FORMAT_ASTC_12x12_SRGB_BLOCK = 184,
1276 // Provided by VK_VERSION_1_1
1277 VK_FORMAT_G8B8G8R8_422_UNORM = 1000156000,
1278 // Provided by VK_VERSION_1_1
1279 VK_FORMAT_B8G8R8G8_422_UNORM = 1000156001,
1280 // Provided by VK_VERSION_1_1
1281 VK_FORMAT_G8_B8_R8_3PLANE_420_UNORM = 1000156002,
1282 // Provided by VK_VERSION_1_1
1283 VK_FORMAT_G8_B8R8_2PLANE_420_UNORM = 1000156003,
1284 // Provided by VK_VERSION_1_1
1285 VK_FORMAT_G8_B8_R8_3PLANE_422_UNORM = 1000156004,
1286 // Provided by VK_VERSION_1_1
1287 VK_FORMAT_G8_B8R8_2PLANE_422_UNORM = 1000156005,
1288 // Provided by VK_VERSION_1_1
1289 VK_FORMAT_G8_B8_R8_3PLANE_444_UNORM = 1000156006,
1290 // Provided by VK_VERSION_1_1
1291 VK_FORMAT_R10X6_UNORM_PACK16 = 1000156007,
1292 // Provided by VK_VERSION_1_1
1293 VK_FORMAT_R10X6G10X6_UNORM_2PACK16 = 1000156008,
1294 // Provided by VK_VERSION_1_1
1295 VK_FORMAT_R10X6G10X6B10X6A10X6_UNORM_4PACK16 = 1000156009,
1296 // Provided by VK_VERSION_1_1
1297 VK_FORMAT_G10X6B10X6G10X6R10X6_422_UNORM_4PACK16 = 1000156010,
1298 // Provided by VK_VERSION_1_1
1299 VK_FORMAT_B10X6G10X6R10X6G10X6_422_UNORM_4PACK16 = 1000156011,
1300 // Provided by VK_VERSION_1_1
1301 VK_FORMAT_G10X6_B10X6_R10X6_3PLANE_420_UNORM_3PACK16 = 1000156012,
1302 // Provided by VK_VERSION_1_1
1303 VK_FORMAT_G10X6_B10X6R10X6_2PLANE_420_UNORM_3PACK16 = 1000156013,
1304 // Provided by VK_VERSION_1_1
1305 VK_FORMAT_G10X6_B10X6_R10X6_3PLANE_422_UNORM_3PACK16 = 1000156014,
1306 // Provided by VK_VERSION_1_1
1307 VK_FORMAT_G10X6_B10X6R10X6_2PLANE_422_UNORM_3PACK16 = 1000156015,
1308 // Provided by VK_VERSION_1_1
1309 VK_FORMAT_G10X6_B10X6_R10X6_3PLANE_444_UNORM_3PACK16 = 1000156016,
1310 // Provided by VK_VERSION_1_1
1311 VK_FORMAT_R12X4_UNORM_PACK16 = 1000156017,
1312 // Provided by VK_VERSION_1_1
1313 VK_FORMAT_R12X4G12X4_UNORM_2PACK16 = 1000156018,
1314 // Provided by VK_VERSION_1_1
1315 VK_FORMAT_R12X4G12X4B12X4A12X4_UNORM_4PACK16 = 1000156019,
1316 // Provided by VK_VERSION_1_1
1317 VK_FORMAT_G12X4B12X4G12X4R12X4_422_UNORM_4PACK16 = 1000156020,
1318 // Provided by VK_VERSION_1_1
1319 VK_FORMAT_B12X4G12X4R12X4G12X4_422_UNORM_4PACK16 = 1000156021,
1320 // Provided by VK_VERSION_1_1
1321 VK_FORMAT_G12X4_B12X4_R12X4_3PLANE_420_UNORM_3PACK16 = 1000156022,
1322 // Provided by VK_VERSION_1_1
1323 VK_FORMAT_G12X4_B12X4R12X4_2PLANE_420_UNORM_3PACK16 = 1000156023,
1324 // Provided by VK_VERSION_1_1
1325 VK_FORMAT_G12X4_B12X4_R12X4_3PLANE_422_UNORM_3PACK16 = 1000156024,
1326 // Provided by VK_VERSION_1_1
1327 VK_FORMAT_G12X4_B12X4R12X4_2PLANE_422_UNORM_3PACK16 = 1000156025,
1328 // Provided by VK_VERSION_1_1
1329 VK_FORMAT_G12X4_B12X4_R12X4_3PLANE_444_UNORM_3PACK16 = 1000156026,
1330 // Provided by VK_VERSION_1_1
1331 VK_FORMAT_G16B16G16R16_422_UNORM = 1000156027,
1332 // Provided by VK_VERSION_1_1
1333 VK_FORMAT_B16G16R16G16_422_UNORM = 1000156028,
1334 // Provided by VK_VERSION_1_1
1335 VK_FORMAT_G16_B16_R16_3PLANE_420_UNORM = 1000156029,
1336 // Provided by VK_VERSION_1_1
1337 VK_FORMAT_G16_B16R16_2PLANE_420_UNORM = 1000156030,
1338 // Provided by VK_VERSION_1_1
1339 VK_FORMAT_G16_B16_R16_3PLANE_422_UNORM = 1000156031,
1340 // Provided by VK_VERSION_1_1
1341 VK_FORMAT_G16_B16R16_2PLANE_422_UNORM = 1000156032,
1342 // Provided by VK_VERSION_1_1
1343 VK_FORMAT_G16_B16_R16_3PLANE_444_UNORM = 1000156033,
1344 // Provided by VK_VERSION_1_3
1345 VK_FORMAT_G8_B8R8_2PLANE_444_UNORM = 1000330000,
1346 // Provided by VK_VERSION_1_3
1347 VK_FORMAT_G10X6_B10X6R10X6_2PLANE_444_UNORM_3PACK16 = 1000330001,
1348 // Provided by VK_VERSION_1_3
1349 VK_FORMAT_G12X4_B12X4R12X4_2PLANE_444_UNORM_3PACK16 = 1000330002,
1350 // Provided by VK_VERSION_1_3
1351 VK_FORMAT_G16_B16R16_2PLANE_444_UNORM = 1000330003,
1352 // Provided by VK_VERSION_1_3
1353 VK_FORMAT_A4R4G4B4_UNORM_PACK16 = 1000340000,
1354 // Provided by VK_VERSION_1_3
1355 VK_FORMAT_A4B4G4R4_UNORM_PACK16 = 1000340001,
1356 // Provided by VK_VERSION_1_3
1357 VK_FORMAT_ASTC_4x4_SFLOAT_BLOCK = 1000066000,
1358 // Provided by VK_VERSION_1_3
1359 VK_FORMAT_ASTC_5x4_SFLOAT_BLOCK = 1000066001,
1360 // Provided by VK_VERSION_1_3
1361 VK_FORMAT_ASTC_5x5_SFLOAT_BLOCK = 1000066002,
1362 // Provided by VK_VERSION_1_3
1363 VK_FORMAT_ASTC_6x5_SFLOAT_BLOCK = 1000066003,
1364 // Provided by VK_VERSION_1_3
1365 VK_FORMAT_ASTC_6x6_SFLOAT_BLOCK = 1000066004,
1366 // Provided by VK_VERSION_1_3
1367 VK_FORMAT_ASTC_8x5_SFLOAT_BLOCK = 1000066005,
1368 // Provided by VK_VERSION_1_3
1369 VK_FORMAT_ASTC_8x6_SFLOAT_BLOCK = 1000066006,
1370 // Provided by VK_VERSION_1_3
1371 VK_FORMAT_ASTC_8x8_SFLOAT_BLOCK = 1000066007,
1372 // Provided by VK_VERSION_1_3
1373 VK_FORMAT_ASTC_10x5_SFLOAT_BLOCK = 1000066008,
1374 // Provided by VK_VERSION_1_3
1375 VK_FORMAT_ASTC_10x6_SFLOAT_BLOCK = 1000066009,
1376 // Provided by VK_VERSION_1_3
1377 VK_FORMAT_ASTC_10x8_SFLOAT_BLOCK = 1000066010,
1378 // Provided by VK_VERSION_1_3
1379 VK_FORMAT_ASTC_10x10_SFLOAT_BLOCK = 1000066011,
1380 // Provided by VK_VERSION_1_3
1381 VK_FORMAT_ASTC_12x10_SFLOAT_BLOCK = 1000066012,
1382 // Provided by VK_VERSION_1_3
1383 VK_FORMAT_ASTC_12x12_SFLOAT_BLOCK = 1000066013,
1384 // Provided by VK_VERSION_1_4
1385 VK_FORMAT_A1B5G5R5_UNORM_PACK16 = 1000470000,
1386 // Provided by VK_VERSION_1_4
1387 VK_FORMAT_A8_UNORM = 1000470001,
1388 // Provided by VK_IMG_format_pvrtc
1389 VK_FORMAT_PVRTC1_2BPP_UNORM_BLOCK_IMG = 1000054000,
1390 // Provided by VK_IMG_format_pvrtc
1391 VK_FORMAT_PVRTC1_4BPP_UNORM_BLOCK_IMG = 1000054001,
1392 // Provided by VK_IMG_format_pvrtc
1393 VK_FORMAT_PVRTC2_2BPP_UNORM_BLOCK_IMG = 1000054002,
1394 // Provided by VK_IMG_format_pvrtc
1395 VK_FORMAT_PVRTC2_4BPP_UNORM_BLOCK_IMG = 1000054003,
1396 // Provided by VK_IMG_format_pvrtc
1397 VK_FORMAT_PVRTC1_2BPP_SRGB_BLOCK_IMG = 1000054004,
1398 // Provided by VK_IMG_format_pvrtc
1399 VK_FORMAT_PVRTC1_4BPP_SRGB_BLOCK_IMG = 1000054005,
1400 // Provided by VK_IMG_format_pvrtc
1401 VK_FORMAT_PVRTC2_2BPP_SRGB_BLOCK_IMG = 1000054006,
1402 // Provided by VK_IMG_format_pvrtc
1403 VK_FORMAT_PVRTC2_4BPP_SRGB_BLOCK_IMG = 1000054007,
1404 // Provided by VK_ARM_tensors
1405 VK_FORMAT_R8_BOOL_ARM = 1000460000,
1406 // Provided by VK_NV_optical_flow
1407 VK_FORMAT_R16G16_SFIXED5_NV = 1000464000,
1408 // Provided by VK_ARM_format_pack
1409 VK_FORMAT_R10X6_UINT_PACK16_ARM = 1000609000,
1410 // Provided by VK_ARM_format_pack
1411 VK_FORMAT_R10X6G10X6_UINT_2PACK16_ARM = 1000609001,
1412 // Provided by VK_ARM_format_pack
1413 VK_FORMAT_R10X6G10X6B10X6A10X6_UINT_4PACK16_ARM = 1000609002,
1414 // Provided by VK_ARM_format_pack
1415 VK_FORMAT_R12X4_UINT_PACK16_ARM = 1000609003,
1416 // Provided by VK_ARM_format_pack
1417 VK_FORMAT_R12X4G12X4_UINT_2PACK16_ARM = 1000609004,
1418 // Provided by VK_ARM_format_pack
1419 VK_FORMAT_R12X4G12X4B12X4A12X4_UINT_4PACK16_ARM = 1000609005,
1420 // Provided by VK_ARM_format_pack
1421 VK_FORMAT_R14X2_UINT_PACK16_ARM = 1000609006,
1422 // Provided by VK_ARM_format_pack
1423 VK_FORMAT_R14X2G14X2_UINT_2PACK16_ARM = 1000609007,
1424 // Provided by VK_ARM_format_pack
1425 VK_FORMAT_R14X2G14X2B14X2A14X2_UINT_4PACK16_ARM = 1000609008,
1426 // Provided by VK_ARM_format_pack
1427 VK_FORMAT_R14X2_UNORM_PACK16_ARM = 1000609009,
1428 // Provided by VK_ARM_format_pack
1429 VK_FORMAT_R14X2G14X2_UNORM_2PACK16_ARM = 1000609010,
1430 // Provided by VK_ARM_format_pack
1431 VK_FORMAT_R14X2G14X2B14X2A14X2_UNORM_4PACK16_ARM = 1000609011,
1432 // Provided by VK_ARM_format_pack
1433 VK_FORMAT_G14X2_B14X2R14X2_2PLANE_420_UNORM_3PACK16_ARM = 1000609012,
1434 // Provided by VK_ARM_format_pack
1435 VK_FORMAT_G14X2_B14X2R14X2_2PLANE_422_UNORM_3PACK16_ARM = 1000609013,
1436 // Provided by VK_EXT_texture_compression_astc_hdr
1437 VK_FORMAT_ASTC_4x4_SFLOAT_BLOCK_EXT = VK_FORMAT_ASTC_4x4_SFLOAT_BLOCK,
1438 // Provided by VK_EXT_texture_compression_astc_hdr
1439 VK_FORMAT_ASTC_5x4_SFLOAT_BLOCK_EXT = VK_FORMAT_ASTC_5x4_SFLOAT_BLOCK,
1440 // Provided by VK_EXT_texture_compression_astc_hdr
1441 VK_FORMAT_ASTC_5x5_SFLOAT_BLOCK_EXT = VK_FORMAT_ASTC_5x5_SFLOAT_BLOCK,
1442 // Provided by VK_EXT_texture_compression_astc_hdr
1443 VK_FORMAT_ASTC_6x5_SFLOAT_BLOCK_EXT = VK_FORMAT_ASTC_6x5_SFLOAT_BLOCK,
1444 // Provided by VK_EXT_texture_compression_astc_hdr
1445 VK_FORMAT_ASTC_6x6_SFLOAT_BLOCK_EXT = VK_FORMAT_ASTC_6x6_SFLOAT_BLOCK,
1446 // Provided by VK_EXT_texture_compression_astc_hdr
1447 VK_FORMAT_ASTC_8x5_SFLOAT_BLOCK_EXT = VK_FORMAT_ASTC_8x5_SFLOAT_BLOCK,
1448 // Provided by VK_EXT_texture_compression_astc_hdr
1449 VK_FORMAT_ASTC_8x6_SFLOAT_BLOCK_EXT = VK_FORMAT_ASTC_8x6_SFLOAT_BLOCK,
1450 // Provided by VK_EXT_texture_compression_astc_hdr
1451 VK_FORMAT_ASTC_8x8_SFLOAT_BLOCK_EXT = VK_FORMAT_ASTC_8x8_SFLOAT_BLOCK,
1452 // Provided by VK_EXT_texture_compression_astc_hdr
1453 VK_FORMAT_ASTC_10x5_SFLOAT_BLOCK_EXT = VK_FORMAT_ASTC_10x5_SFLOAT_BLOCK,
1454 // Provided by VK_EXT_texture_compression_astc_hdr
1455 VK_FORMAT_ASTC_10x6_SFLOAT_BLOCK_EXT = VK_FORMAT_ASTC_10x6_SFLOAT_BLOCK,
1456 // Provided by VK_EXT_texture_compression_astc_hdr
1457 VK_FORMAT_ASTC_10x8_SFLOAT_BLOCK_EXT = VK_FORMAT_ASTC_10x8_SFLOAT_BLOCK,
1458 // Provided by VK_EXT_texture_compression_astc_hdr
1459 VK_FORMAT_ASTC_10x10_SFLOAT_BLOCK_EXT = VK_FORMAT_ASTC_10x10_SFLOAT_BLOCK,
1460 // Provided by VK_EXT_texture_compression_astc_hdr
1461 VK_FORMAT_ASTC_12x10_SFLOAT_BLOCK_EXT = VK_FORMAT_ASTC_12x10_SFLOAT_BLOCK,
1462 // Provided by VK_EXT_texture_compression_astc_hdr
1463 VK_FORMAT_ASTC_12x12_SFLOAT_BLOCK_EXT = VK_FORMAT_ASTC_12x12_SFLOAT_BLOCK,
1464 // Provided by VK_KHR_sampler_ycbcr_conversion
1465 VK_FORMAT_G8B8G8R8_422_UNORM_KHR = VK_FORMAT_G8B8G8R8_422_UNORM,
1466 // Provided by VK_KHR_sampler_ycbcr_conversion
1467 VK_FORMAT_B8G8R8G8_422_UNORM_KHR = VK_FORMAT_B8G8R8G8_422_UNORM,
1468 // Provided by VK_KHR_sampler_ycbcr_conversion
1469 VK_FORMAT_G8_B8_R8_3PLANE_420_UNORM_KHR = VK_FORMAT_G8_B8_R8_3PLANE_420_UNORM,
1470 // Provided by VK_KHR_sampler_ycbcr_conversion
1471 VK_FORMAT_G8_B8R8_2PLANE_420_UNORM_KHR = VK_FORMAT_G8_B8R8_2PLANE_420_UNORM,
1472 // Provided by VK_KHR_sampler_ycbcr_conversion
1473 VK_FORMAT_G8_B8_R8_3PLANE_422_UNORM_KHR = VK_FORMAT_G8_B8_R8_3PLANE_422_UNORM,
1474 // Provided by VK_KHR_sampler_ycbcr_conversion
1475 VK_FORMAT_G8_B8R8_2PLANE_422_UNORM_KHR = VK_FORMAT_G8_B8R8_2PLANE_422_UNORM,
1476 // Provided by VK_KHR_sampler_ycbcr_conversion
1477 VK_FORMAT_G8_B8_R8_3PLANE_444_UNORM_KHR = VK_FORMAT_G8_B8_R8_3PLANE_444_UNORM,
1478 // Provided by VK_KHR_sampler_ycbcr_conversion
1479 VK_FORMAT_R10X6_UNORM_PACK16_KHR = VK_FORMAT_R10X6_UNORM_PACK16,
1480 // Provided by VK_KHR_sampler_ycbcr_conversion
1481 VK_FORMAT_R10X6G10X6_UNORM_2PACK16_KHR = VK_FORMAT_R10X6G10X6_UNORM_2PACK16,
1482 // Provided by VK_KHR_sampler_ycbcr_conversion
1483 VK_FORMAT_R10X6G10X6B10X6A10X6_UNORM_4PACK16_KHR = VK_FORMAT_R10X6G10X6B10X6A10X6_UNORM_4PACK16,
1484 // Provided by VK_KHR_sampler_ycbcr_conversion
1485 VK_FORMAT_G10X6B10X6G10X6R10X6_422_UNORM_4PACK16_KHR = VK_FORMAT_G10X6B10X6G10X6R10X6_422_UNORM_4PACK16,
1486 // Provided by VK_KHR_sampler_ycbcr_conversion
1487 VK_FORMAT_B10X6G10X6R10X6G10X6_422_UNORM_4PACK16_KHR = VK_FORMAT_B10X6G10X6R10X6G10X6_422_UNORM_4PACK16,
1488 // Provided by VK_KHR_sampler_ycbcr_conversion
1489 VK_FORMAT_G10X6_B10X6_R10X6_3PLANE_420_UNORM_3PACK16_KHR = VK_FORMAT_G10X6_B10X6_R10X6_3PLANE_420_UNORM_3PACK16,
1490 // Provided by VK_KHR_sampler_ycbcr_conversion
1491 VK_FORMAT_G10X6_B10X6R10X6_2PLANE_420_UNORM_3PACK16_KHR = VK_FORMAT_G10X6_B10X6R10X6_2PLANE_420_UNORM_3PACK16,
1492 // Provided by VK_KHR_sampler_ycbcr_conversion
1493 VK_FORMAT_G10X6_B10X6_R10X6_3PLANE_422_UNORM_3PACK16_KHR = VK_FORMAT_G10X6_B10X6_R10X6_3PLANE_422_UNORM_3PACK16,
1494 // Provided by VK_KHR_sampler_ycbcr_conversion
1495 VK_FORMAT_G10X6_B10X6R10X6_2PLANE_422_UNORM_3PACK16_KHR = VK_FORMAT_G10X6_B10X6R10X6_2PLANE_422_UNORM_3PACK16,
1496 // Provided by VK_KHR_sampler_ycbcr_conversion
1497 VK_FORMAT_G10X6_B10X6_R10X6_3PLANE_444_UNORM_3PACK16_KHR = VK_FORMAT_G10X6_B10X6_R10X6_3PLANE_444_UNORM_3PACK16,
1498 // Provided by VK_KHR_sampler_ycbcr_conversion
1499 VK_FORMAT_R12X4_UNORM_PACK16_KHR = VK_FORMAT_R12X4_UNORM_PACK16,
1500 // Provided by VK_KHR_sampler_ycbcr_conversion
1501 VK_FORMAT_R12X4G12X4_UNORM_2PACK16_KHR = VK_FORMAT_R12X4G12X4_UNORM_2PACK16,
1502 // Provided by VK_KHR_sampler_ycbcr_conversion
1503 VK_FORMAT_R12X4G12X4B12X4A12X4_UNORM_4PACK16_KHR = VK_FORMAT_R12X4G12X4B12X4A12X4_UNORM_4PACK16,
1504 // Provided by VK_KHR_sampler_ycbcr_conversion
1505 VK_FORMAT_G12X4B12X4G12X4R12X4_422_UNORM_4PACK16_KHR = VK_FORMAT_G12X4B12X4G12X4R12X4_422_UNORM_4PACK16,
1506 // Provided by VK_KHR_sampler_ycbcr_conversion
1507 VK_FORMAT_B12X4G12X4R12X4G12X4_422_UNORM_4PACK16_KHR = VK_FORMAT_B12X4G12X4R12X4G12X4_422_UNORM_4PACK16,
1508 // Provided by VK_KHR_sampler_ycbcr_conversion
1509 VK_FORMAT_G12X4_B12X4_R12X4_3PLANE_420_UNORM_3PACK16_KHR = VK_FORMAT_G12X4_B12X4_R12X4_3PLANE_420_UNORM_3PACK16,
1510 // Provided by VK_KHR_sampler_ycbcr_conversion
1511 VK_FORMAT_G12X4_B12X4R12X4_2PLANE_420_UNORM_3PACK16_KHR = VK_FORMAT_G12X4_B12X4R12X4_2PLANE_420_UNORM_3PACK16,
1512 // Provided by VK_KHR_sampler_ycbcr_conversion
1513 VK_FORMAT_G12X4_B12X4_R12X4_3PLANE_422_UNORM_3PACK16_KHR = VK_FORMAT_G12X4_B12X4_R12X4_3PLANE_422_UNORM_3PACK16,
1514 // Provided by VK_KHR_sampler_ycbcr_conversion
1515 VK_FORMAT_G12X4_B12X4R12X4_2PLANE_422_UNORM_3PACK16_KHR = VK_FORMAT_G12X4_B12X4R12X4_2PLANE_422_UNORM_3PACK16,
1516 // Provided by VK_KHR_sampler_ycbcr_conversion
1517 VK_FORMAT_G12X4_B12X4_R12X4_3PLANE_444_UNORM_3PACK16_KHR = VK_FORMAT_G12X4_B12X4_R12X4_3PLANE_444_UNORM_3PACK16,
1518 // Provided by VK_KHR_sampler_ycbcr_conversion
1519 VK_FORMAT_G16B16G16R16_422_UNORM_KHR = VK_FORMAT_G16B16G16R16_422_UNORM,
1520 // Provided by VK_KHR_sampler_ycbcr_conversion
1521 VK_FORMAT_B16G16R16G16_422_UNORM_KHR = VK_FORMAT_B16G16R16G16_422_UNORM,
1522 // Provided by VK_KHR_sampler_ycbcr_conversion
1523 VK_FORMAT_G16_B16_R16_3PLANE_420_UNORM_KHR = VK_FORMAT_G16_B16_R16_3PLANE_420_UNORM,
1524 // Provided by VK_KHR_sampler_ycbcr_conversion
1525 VK_FORMAT_G16_B16R16_2PLANE_420_UNORM_KHR = VK_FORMAT_G16_B16R16_2PLANE_420_UNORM,
1526 // Provided by VK_KHR_sampler_ycbcr_conversion
1527 VK_FORMAT_G16_B16_R16_3PLANE_422_UNORM_KHR = VK_FORMAT_G16_B16_R16_3PLANE_422_UNORM,
1528 // Provided by VK_KHR_sampler_ycbcr_conversion
1529 VK_FORMAT_G16_B16R16_2PLANE_422_UNORM_KHR = VK_FORMAT_G16_B16R16_2PLANE_422_UNORM,
1530 // Provided by VK_KHR_sampler_ycbcr_conversion
1531 VK_FORMAT_G16_B16_R16_3PLANE_444_UNORM_KHR = VK_FORMAT_G16_B16_R16_3PLANE_444_UNORM,
1532 // Provided by VK_EXT_ycbcr_2plane_444_formats
1533 VK_FORMAT_G8_B8R8_2PLANE_444_UNORM_EXT = VK_FORMAT_G8_B8R8_2PLANE_444_UNORM,
1534 // Provided by VK_EXT_ycbcr_2plane_444_formats
1535 VK_FORMAT_G10X6_B10X6R10X6_2PLANE_444_UNORM_3PACK16_EXT = VK_FORMAT_G10X6_B10X6R10X6_2PLANE_444_UNORM_3PACK16,
1536 // Provided by VK_EXT_ycbcr_2plane_444_formats
1537 VK_FORMAT_G12X4_B12X4R12X4_2PLANE_444_UNORM_3PACK16_EXT = VK_FORMAT_G12X4_B12X4R12X4_2PLANE_444_UNORM_3PACK16,
1538 // Provided by VK_EXT_ycbcr_2plane_444_formats
1539 VK_FORMAT_G16_B16R16_2PLANE_444_UNORM_EXT = VK_FORMAT_G16_B16R16_2PLANE_444_UNORM,
1540 // Provided by VK_EXT_4444_formats
1541 VK_FORMAT_A4R4G4B4_UNORM_PACK16_EXT = VK_FORMAT_A4R4G4B4_UNORM_PACK16,
1542 // Provided by VK_EXT_4444_formats
1543 VK_FORMAT_A4B4G4R4_UNORM_PACK16_EXT = VK_FORMAT_A4B4G4R4_UNORM_PACK16,
1544 // Provided by VK_NV_optical_flow
1545 // VK_FORMAT_R16G16_S10_5_NV is a deprecated alias
1546 VK_FORMAT_R16G16_S10_5_NV = VK_FORMAT_R16G16_SFIXED5_NV,
1547 // Provided by VK_KHR_maintenance5
1548 VK_FORMAT_A1B5G5R5_UNORM_PACK16_KHR = VK_FORMAT_A1B5G5R5_UNORM_PACK16,
1549 // Provided by VK_KHR_maintenance5
1550 VK_FORMAT_A8_UNORM_KHR = VK_FORMAT_A8_UNORM,
1551} VkFormat;
1552*/
index : raylib-jai
---