8b10aae40a6602c96df865bc84cd39c5317a069b
[mesa.git] / src / gallium / include / pipe / p_format.h
1 /**************************************************************************
2 *
3 * Copyright 2007 VMware, Inc.
4 * Copyright (c) 2008 VMware, Inc.
5 * All Rights Reserved.
6 *
7 * Permission is hereby granted, free of charge, to any person obtaining a
8 * copy of this software and associated documentation files (the
9 * "Software"), to deal in the Software without restriction, including
10 * without limitation the rights to use, copy, modify, merge, publish,
11 * distribute, sub license, and/or sell copies of the Software, and to
12 * permit persons to whom the Software is furnished to do so, subject to
13 * the following conditions:
14 *
15 * The above copyright notice and this permission notice (including the
16 * next paragraph) shall be included in all copies or substantial portions
17 * of the Software.
18 *
19 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
20 * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
21 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
22 * IN NO EVENT SHALL VMWARE AND/OR ITS SUPPLIERS BE LIABLE FOR
23 * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
24 * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
25 * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
26 *
27 **************************************************************************/
28
29 #ifndef PIPE_FORMAT_H
30 #define PIPE_FORMAT_H
31
32 #include "p_config.h"
33
34 #ifdef __cplusplus
35 extern "C" {
36 #endif
37
38 /**
39 * Formats for textures, surfaces and vertex data
40 */
41 enum pipe_format {
42 PIPE_FORMAT_NONE,
43 PIPE_FORMAT_B8G8R8A8_UNORM,
44 PIPE_FORMAT_B8G8R8X8_UNORM,
45 PIPE_FORMAT_A8R8G8B8_UNORM,
46 PIPE_FORMAT_X8R8G8B8_UNORM,
47 PIPE_FORMAT_B5G5R5A1_UNORM,
48 PIPE_FORMAT_R4G4B4A4_UNORM,
49 PIPE_FORMAT_B4G4R4A4_UNORM,
50 PIPE_FORMAT_R5G6B5_UNORM,
51 PIPE_FORMAT_B5G6R5_UNORM,
52 PIPE_FORMAT_R10G10B10A2_UNORM,
53 PIPE_FORMAT_L8_UNORM, /**< ubyte luminance */
54 PIPE_FORMAT_A8_UNORM, /**< ubyte alpha */
55 PIPE_FORMAT_I8_UNORM, /**< ubyte intensity */
56 PIPE_FORMAT_L8A8_UNORM, /**< ubyte alpha, luminance */
57 PIPE_FORMAT_L16_UNORM, /**< ushort luminance */
58 PIPE_FORMAT_UYVY,
59 PIPE_FORMAT_YUYV,
60 PIPE_FORMAT_Z16_UNORM,
61 PIPE_FORMAT_Z16_UNORM_S8_UINT,
62 PIPE_FORMAT_Z32_UNORM,
63 PIPE_FORMAT_Z32_FLOAT,
64 PIPE_FORMAT_Z24_UNORM_S8_UINT,
65 PIPE_FORMAT_S8_UINT_Z24_UNORM,
66 PIPE_FORMAT_Z24X8_UNORM,
67 PIPE_FORMAT_X8Z24_UNORM,
68 PIPE_FORMAT_S8_UINT, /**< ubyte stencil */
69 PIPE_FORMAT_R64_FLOAT,
70 PIPE_FORMAT_R64G64_FLOAT,
71 PIPE_FORMAT_R64G64B64_FLOAT,
72 PIPE_FORMAT_R64G64B64A64_FLOAT,
73 PIPE_FORMAT_R32_FLOAT,
74 PIPE_FORMAT_R32G32_FLOAT,
75 PIPE_FORMAT_R32G32B32_FLOAT,
76 PIPE_FORMAT_R32G32B32A32_FLOAT,
77 PIPE_FORMAT_R32_UNORM,
78 PIPE_FORMAT_R32G32_UNORM,
79 PIPE_FORMAT_R32G32B32_UNORM,
80 PIPE_FORMAT_R32G32B32A32_UNORM,
81 PIPE_FORMAT_R32_USCALED,
82 PIPE_FORMAT_R32G32_USCALED,
83 PIPE_FORMAT_R32G32B32_USCALED,
84 PIPE_FORMAT_R32G32B32A32_USCALED,
85 PIPE_FORMAT_R32_SNORM,
86 PIPE_FORMAT_R32G32_SNORM,
87 PIPE_FORMAT_R32G32B32_SNORM,
88 PIPE_FORMAT_R32G32B32A32_SNORM,
89 PIPE_FORMAT_R32_SSCALED,
90 PIPE_FORMAT_R32G32_SSCALED,
91 PIPE_FORMAT_R32G32B32_SSCALED,
92 PIPE_FORMAT_R32G32B32A32_SSCALED,
93 PIPE_FORMAT_R16_UNORM,
94 PIPE_FORMAT_R16G16_UNORM,
95 PIPE_FORMAT_R16G16B16_UNORM,
96 PIPE_FORMAT_R16G16B16A16_UNORM,
97 PIPE_FORMAT_R16_USCALED,
98 PIPE_FORMAT_R16G16_USCALED,
99 PIPE_FORMAT_R16G16B16_USCALED,
100 PIPE_FORMAT_R16G16B16A16_USCALED,
101 PIPE_FORMAT_R16_SNORM,
102 PIPE_FORMAT_R16G16_SNORM,
103 PIPE_FORMAT_R16G16B16_SNORM,
104 PIPE_FORMAT_R16G16B16A16_SNORM,
105 PIPE_FORMAT_R16_SSCALED,
106 PIPE_FORMAT_R16G16_SSCALED,
107 PIPE_FORMAT_R16G16B16_SSCALED,
108 PIPE_FORMAT_R16G16B16A16_SSCALED,
109 PIPE_FORMAT_R8_UNORM,
110 PIPE_FORMAT_R8G8_UNORM,
111 PIPE_FORMAT_R8G8B8_UNORM,
112 PIPE_FORMAT_B8G8R8_UNORM,
113 PIPE_FORMAT_R8G8B8A8_UNORM,
114 PIPE_FORMAT_X8B8G8R8_UNORM,
115 PIPE_FORMAT_R8_USCALED,
116 PIPE_FORMAT_R8G8_USCALED,
117 PIPE_FORMAT_R8G8B8_USCALED,
118 PIPE_FORMAT_B8G8R8_USCALED,
119 PIPE_FORMAT_R8G8B8A8_USCALED,
120 PIPE_FORMAT_B8G8R8A8_USCALED,
121 PIPE_FORMAT_A8B8G8R8_USCALED,
122 PIPE_FORMAT_R8_SNORM,
123 PIPE_FORMAT_R8G8_SNORM,
124 PIPE_FORMAT_R8G8B8_SNORM,
125 PIPE_FORMAT_B8G8R8_SNORM,
126 PIPE_FORMAT_R8G8B8A8_SNORM,
127 PIPE_FORMAT_B8G8R8A8_SNORM,
128 PIPE_FORMAT_R8_SSCALED,
129 PIPE_FORMAT_R8G8_SSCALED,
130 PIPE_FORMAT_R8G8B8_SSCALED,
131 PIPE_FORMAT_B8G8R8_SSCALED,
132 PIPE_FORMAT_R8G8B8A8_SSCALED,
133 PIPE_FORMAT_B8G8R8A8_SSCALED,
134 PIPE_FORMAT_A8B8G8R8_SSCALED,
135 PIPE_FORMAT_R32_FIXED,
136 PIPE_FORMAT_R32G32_FIXED,
137 PIPE_FORMAT_R32G32B32_FIXED,
138 PIPE_FORMAT_R32G32B32A32_FIXED,
139 PIPE_FORMAT_R16_FLOAT,
140 PIPE_FORMAT_R16G16_FLOAT,
141 PIPE_FORMAT_R16G16B16_FLOAT,
142 PIPE_FORMAT_R16G16B16A16_FLOAT,
143
144 /* sRGB formats */
145 PIPE_FORMAT_L8_SRGB,
146 PIPE_FORMAT_R8_SRGB,
147 PIPE_FORMAT_L8A8_SRGB,
148 PIPE_FORMAT_R8G8_SRGB,
149 PIPE_FORMAT_R8G8B8_SRGB,
150 PIPE_FORMAT_B8G8R8_SRGB,
151 PIPE_FORMAT_A8B8G8R8_SRGB,
152 PIPE_FORMAT_X8B8G8R8_SRGB,
153 PIPE_FORMAT_B8G8R8A8_SRGB,
154 PIPE_FORMAT_B8G8R8X8_SRGB,
155 PIPE_FORMAT_A8R8G8B8_SRGB,
156 PIPE_FORMAT_X8R8G8B8_SRGB,
157 PIPE_FORMAT_R8G8B8A8_SRGB,
158
159 /* compressed formats */
160 PIPE_FORMAT_DXT1_RGB,
161 PIPE_FORMAT_DXT1_RGBA,
162 PIPE_FORMAT_DXT3_RGBA,
163 PIPE_FORMAT_DXT5_RGBA,
164
165 /* sRGB, compressed */
166 PIPE_FORMAT_DXT1_SRGB,
167 PIPE_FORMAT_DXT1_SRGBA,
168 PIPE_FORMAT_DXT3_SRGBA,
169 PIPE_FORMAT_DXT5_SRGBA,
170
171 /* rgtc compressed */
172 PIPE_FORMAT_RGTC1_UNORM,
173 PIPE_FORMAT_RGTC1_SNORM,
174 PIPE_FORMAT_RGTC2_UNORM,
175 PIPE_FORMAT_RGTC2_SNORM,
176
177 PIPE_FORMAT_R8G8_B8G8_UNORM,
178 PIPE_FORMAT_G8R8_G8B8_UNORM,
179
180 /* mixed formats */
181 PIPE_FORMAT_R8SG8SB8UX8U_NORM,
182 PIPE_FORMAT_R5SG5SB6U_NORM,
183
184 /* TODO: re-order these */
185 PIPE_FORMAT_A8B8G8R8_UNORM,
186 PIPE_FORMAT_B5G5R5X1_UNORM,
187 PIPE_FORMAT_R10G10B10A2_USCALED,
188 PIPE_FORMAT_R11G11B10_FLOAT,
189 PIPE_FORMAT_R9G9B9E5_FLOAT,
190 PIPE_FORMAT_Z32_FLOAT_S8X24_UINT,
191 PIPE_FORMAT_R1_UNORM,
192 PIPE_FORMAT_R10G10B10X2_USCALED,
193 PIPE_FORMAT_R10G10B10X2_SNORM,
194 PIPE_FORMAT_L4A4_UNORM,
195 PIPE_FORMAT_A2R10G10B10_UNORM,
196 PIPE_FORMAT_A2B10G10R10_UNORM,
197 PIPE_FORMAT_B10G10R10A2_UNORM,
198 PIPE_FORMAT_R10SG10SB10SA2U_NORM,
199 PIPE_FORMAT_R8G8Bx_SNORM,
200 PIPE_FORMAT_R8G8B8X8_UNORM,
201 PIPE_FORMAT_B4G4R4X4_UNORM,
202
203 /* some stencil samplers formats */
204 PIPE_FORMAT_X24S8_UINT,
205 PIPE_FORMAT_S8X24_UINT,
206 PIPE_FORMAT_X32_S8X24_UINT,
207
208 PIPE_FORMAT_R3G3B2_UNORM,
209 PIPE_FORMAT_B2G3R3_UNORM,
210 PIPE_FORMAT_L16A16_UNORM,
211 PIPE_FORMAT_A16_UNORM,
212 PIPE_FORMAT_I16_UNORM,
213
214 PIPE_FORMAT_LATC1_UNORM,
215 PIPE_FORMAT_LATC1_SNORM,
216 PIPE_FORMAT_LATC2_UNORM,
217 PIPE_FORMAT_LATC2_SNORM,
218
219 PIPE_FORMAT_A8_SNORM,
220 PIPE_FORMAT_L8_SNORM,
221 PIPE_FORMAT_L8A8_SNORM,
222 PIPE_FORMAT_I8_SNORM,
223 PIPE_FORMAT_A16_SNORM,
224 PIPE_FORMAT_L16_SNORM,
225 PIPE_FORMAT_L16A16_SNORM,
226 PIPE_FORMAT_I16_SNORM,
227
228 PIPE_FORMAT_A16_FLOAT,
229 PIPE_FORMAT_L16_FLOAT,
230 PIPE_FORMAT_L16A16_FLOAT,
231 PIPE_FORMAT_I16_FLOAT,
232 PIPE_FORMAT_A32_FLOAT,
233 PIPE_FORMAT_L32_FLOAT,
234 PIPE_FORMAT_L32A32_FLOAT,
235 PIPE_FORMAT_I32_FLOAT,
236
237 PIPE_FORMAT_YV12,
238 PIPE_FORMAT_YV16,
239 PIPE_FORMAT_IYUV, /**< aka I420 */
240 PIPE_FORMAT_NV12,
241 PIPE_FORMAT_NV21,
242
243 PIPE_FORMAT_A4R4_UNORM,
244 PIPE_FORMAT_R4A4_UNORM,
245 PIPE_FORMAT_R8A8_UNORM,
246 PIPE_FORMAT_A8R8_UNORM,
247
248 PIPE_FORMAT_R10G10B10A2_SSCALED,
249 PIPE_FORMAT_R10G10B10A2_SNORM,
250
251 PIPE_FORMAT_B10G10R10A2_USCALED,
252 PIPE_FORMAT_B10G10R10A2_SSCALED,
253 PIPE_FORMAT_B10G10R10A2_SNORM,
254
255 PIPE_FORMAT_R8_UINT,
256 PIPE_FORMAT_R8G8_UINT,
257 PIPE_FORMAT_R8G8B8_UINT,
258 PIPE_FORMAT_R8G8B8A8_UINT,
259
260 PIPE_FORMAT_R8_SINT,
261 PIPE_FORMAT_R8G8_SINT,
262 PIPE_FORMAT_R8G8B8_SINT,
263 PIPE_FORMAT_R8G8B8A8_SINT,
264
265 PIPE_FORMAT_R16_UINT,
266 PIPE_FORMAT_R16G16_UINT,
267 PIPE_FORMAT_R16G16B16_UINT,
268 PIPE_FORMAT_R16G16B16A16_UINT,
269
270 PIPE_FORMAT_R16_SINT,
271 PIPE_FORMAT_R16G16_SINT,
272 PIPE_FORMAT_R16G16B16_SINT,
273 PIPE_FORMAT_R16G16B16A16_SINT,
274
275 PIPE_FORMAT_R32_UINT,
276 PIPE_FORMAT_R32G32_UINT,
277 PIPE_FORMAT_R32G32B32_UINT,
278 PIPE_FORMAT_R32G32B32A32_UINT,
279
280 PIPE_FORMAT_R32_SINT,
281 PIPE_FORMAT_R32G32_SINT,
282 PIPE_FORMAT_R32G32B32_SINT,
283 PIPE_FORMAT_R32G32B32A32_SINT,
284
285 PIPE_FORMAT_A8_UINT,
286 PIPE_FORMAT_I8_UINT,
287 PIPE_FORMAT_L8_UINT,
288 PIPE_FORMAT_L8A8_UINT,
289
290 PIPE_FORMAT_A8_SINT,
291 PIPE_FORMAT_I8_SINT,
292 PIPE_FORMAT_L8_SINT,
293 PIPE_FORMAT_L8A8_SINT,
294
295 PIPE_FORMAT_A16_UINT,
296 PIPE_FORMAT_I16_UINT,
297 PIPE_FORMAT_L16_UINT,
298 PIPE_FORMAT_L16A16_UINT,
299
300 PIPE_FORMAT_A16_SINT,
301 PIPE_FORMAT_I16_SINT,
302 PIPE_FORMAT_L16_SINT,
303 PIPE_FORMAT_L16A16_SINT,
304
305 PIPE_FORMAT_A32_UINT,
306 PIPE_FORMAT_I32_UINT,
307 PIPE_FORMAT_L32_UINT,
308 PIPE_FORMAT_L32A32_UINT,
309
310 PIPE_FORMAT_A32_SINT,
311 PIPE_FORMAT_I32_SINT,
312 PIPE_FORMAT_L32_SINT,
313 PIPE_FORMAT_L32A32_SINT,
314
315 PIPE_FORMAT_B8G8R8_UINT,
316 PIPE_FORMAT_B8G8R8A8_UINT,
317
318 PIPE_FORMAT_B8G8R8_SINT,
319 PIPE_FORMAT_B8G8R8A8_SINT,
320
321 PIPE_FORMAT_A8R8G8B8_UINT,
322 PIPE_FORMAT_A8B8G8R8_UINT,
323 PIPE_FORMAT_A2R10G10B10_UINT,
324 PIPE_FORMAT_A2B10G10R10_UINT,
325 PIPE_FORMAT_B10G10R10A2_UINT,
326 PIPE_FORMAT_B10G10R10A2_SINT,
327 PIPE_FORMAT_R5G6B5_UINT,
328 PIPE_FORMAT_B5G6R5_UINT,
329 PIPE_FORMAT_R5G5B5A1_UINT,
330 PIPE_FORMAT_B5G5R5A1_UINT,
331 PIPE_FORMAT_A1R5G5B5_UINT,
332 PIPE_FORMAT_A1B5G5R5_UINT,
333 PIPE_FORMAT_R4G4B4A4_UINT,
334 PIPE_FORMAT_B4G4R4A4_UINT,
335 PIPE_FORMAT_A4R4G4B4_UINT,
336 PIPE_FORMAT_A4B4G4R4_UINT,
337 PIPE_FORMAT_R3G3B2_UINT,
338 PIPE_FORMAT_B2G3R3_UINT,
339
340 PIPE_FORMAT_ETC1_RGB8,
341
342 PIPE_FORMAT_R8G8_R8B8_UNORM,
343 PIPE_FORMAT_G8R8_B8R8_UNORM,
344
345 PIPE_FORMAT_R8G8B8X8_SNORM,
346 PIPE_FORMAT_R8G8B8X8_SRGB,
347 PIPE_FORMAT_R8G8B8X8_UINT,
348 PIPE_FORMAT_R8G8B8X8_SINT,
349 PIPE_FORMAT_B10G10R10X2_UNORM,
350 PIPE_FORMAT_R16G16B16X16_UNORM,
351 PIPE_FORMAT_R16G16B16X16_SNORM,
352 PIPE_FORMAT_R16G16B16X16_FLOAT,
353 PIPE_FORMAT_R16G16B16X16_UINT,
354 PIPE_FORMAT_R16G16B16X16_SINT,
355 PIPE_FORMAT_R32G32B32X32_FLOAT,
356 PIPE_FORMAT_R32G32B32X32_UINT,
357 PIPE_FORMAT_R32G32B32X32_SINT,
358
359 PIPE_FORMAT_R8A8_SNORM,
360 PIPE_FORMAT_R16A16_UNORM,
361 PIPE_FORMAT_R16A16_SNORM,
362 PIPE_FORMAT_R16A16_FLOAT,
363 PIPE_FORMAT_R32A32_FLOAT,
364 PIPE_FORMAT_R8A8_UINT,
365 PIPE_FORMAT_R8A8_SINT,
366 PIPE_FORMAT_R16A16_UINT,
367 PIPE_FORMAT_R16A16_SINT,
368 PIPE_FORMAT_R32A32_UINT,
369 PIPE_FORMAT_R32A32_SINT,
370 PIPE_FORMAT_R10G10B10A2_UINT,
371 PIPE_FORMAT_R10G10B10A2_SINT,
372
373 PIPE_FORMAT_B5G6R5_SRGB,
374
375 PIPE_FORMAT_BPTC_RGBA_UNORM,
376 PIPE_FORMAT_BPTC_SRGBA,
377 PIPE_FORMAT_BPTC_RGB_FLOAT,
378 PIPE_FORMAT_BPTC_RGB_UFLOAT,
379
380 PIPE_FORMAT_G8R8_UNORM,
381 PIPE_FORMAT_G8R8_SNORM,
382 PIPE_FORMAT_G16R16_UNORM,
383 PIPE_FORMAT_G16R16_SNORM,
384
385 PIPE_FORMAT_A8B8G8R8_SNORM,
386 PIPE_FORMAT_X8B8G8R8_SNORM,
387
388 PIPE_FORMAT_ETC2_RGB8,
389 PIPE_FORMAT_ETC2_SRGB8,
390 PIPE_FORMAT_ETC2_RGB8A1,
391 PIPE_FORMAT_ETC2_SRGB8A1,
392 PIPE_FORMAT_ETC2_RGBA8,
393 PIPE_FORMAT_ETC2_SRGBA8,
394 PIPE_FORMAT_ETC2_R11_UNORM,
395 PIPE_FORMAT_ETC2_R11_SNORM,
396 PIPE_FORMAT_ETC2_RG11_UNORM,
397 PIPE_FORMAT_ETC2_RG11_SNORM,
398
399 PIPE_FORMAT_ASTC_4x4,
400 PIPE_FORMAT_ASTC_5x4,
401 PIPE_FORMAT_ASTC_5x5,
402 PIPE_FORMAT_ASTC_6x5,
403 PIPE_FORMAT_ASTC_6x6,
404 PIPE_FORMAT_ASTC_8x5,
405 PIPE_FORMAT_ASTC_8x6,
406 PIPE_FORMAT_ASTC_8x8,
407 PIPE_FORMAT_ASTC_10x5,
408 PIPE_FORMAT_ASTC_10x6,
409 PIPE_FORMAT_ASTC_10x8,
410 PIPE_FORMAT_ASTC_10x10,
411 PIPE_FORMAT_ASTC_12x10,
412 PIPE_FORMAT_ASTC_12x12,
413
414 PIPE_FORMAT_ASTC_4x4_SRGB,
415 PIPE_FORMAT_ASTC_5x4_SRGB,
416 PIPE_FORMAT_ASTC_5x5_SRGB,
417 PIPE_FORMAT_ASTC_6x5_SRGB,
418 PIPE_FORMAT_ASTC_6x6_SRGB,
419 PIPE_FORMAT_ASTC_8x5_SRGB,
420 PIPE_FORMAT_ASTC_8x6_SRGB,
421 PIPE_FORMAT_ASTC_8x8_SRGB,
422 PIPE_FORMAT_ASTC_10x5_SRGB,
423 PIPE_FORMAT_ASTC_10x6_SRGB,
424 PIPE_FORMAT_ASTC_10x8_SRGB,
425 PIPE_FORMAT_ASTC_10x10_SRGB,
426 PIPE_FORMAT_ASTC_12x10_SRGB,
427 PIPE_FORMAT_ASTC_12x12_SRGB,
428
429 PIPE_FORMAT_ASTC_3x3x3,
430 PIPE_FORMAT_ASTC_4x3x3,
431 PIPE_FORMAT_ASTC_4x4x3,
432 PIPE_FORMAT_ASTC_4x4x4,
433 PIPE_FORMAT_ASTC_5x4x4,
434 PIPE_FORMAT_ASTC_5x5x4,
435 PIPE_FORMAT_ASTC_5x5x5,
436 PIPE_FORMAT_ASTC_6x5x5,
437 PIPE_FORMAT_ASTC_6x6x5,
438 PIPE_FORMAT_ASTC_6x6x6,
439
440 PIPE_FORMAT_ASTC_3x3x3_SRGB,
441 PIPE_FORMAT_ASTC_4x3x3_SRGB,
442 PIPE_FORMAT_ASTC_4x4x3_SRGB,
443 PIPE_FORMAT_ASTC_4x4x4_SRGB,
444 PIPE_FORMAT_ASTC_5x4x4_SRGB,
445 PIPE_FORMAT_ASTC_5x5x4_SRGB,
446 PIPE_FORMAT_ASTC_5x5x5_SRGB,
447 PIPE_FORMAT_ASTC_6x5x5_SRGB,
448 PIPE_FORMAT_ASTC_6x6x5_SRGB,
449 PIPE_FORMAT_ASTC_6x6x6_SRGB,
450
451 PIPE_FORMAT_FXT1_RGB,
452 PIPE_FORMAT_FXT1_RGBA,
453
454 PIPE_FORMAT_P010,
455 PIPE_FORMAT_P016,
456
457 PIPE_FORMAT_R10G10B10X2_UNORM,
458 PIPE_FORMAT_A1R5G5B5_UNORM,
459 PIPE_FORMAT_A1B5G5R5_UNORM,
460 PIPE_FORMAT_X1B5G5R5_UNORM,
461 PIPE_FORMAT_R5G5B5A1_UNORM,
462 PIPE_FORMAT_A4R4G4B4_UNORM,
463 PIPE_FORMAT_A4B4G4R4_UNORM,
464
465 PIPE_FORMAT_G8R8_SINT,
466 PIPE_FORMAT_A8B8G8R8_SINT,
467 PIPE_FORMAT_X8B8G8R8_SINT,
468
469 PIPE_FORMAT_ATC_RGB,
470 PIPE_FORMAT_ATC_RGBA_EXPLICIT,
471 PIPE_FORMAT_ATC_RGBA_INTERPOLATED,
472
473 PIPE_FORMAT_Z24_UNORM_S8_UINT_AS_R8G8B8A8,
474
475 PIPE_FORMAT_AYUV,
476 PIPE_FORMAT_XYUV,
477
478 PIPE_FORMAT_COUNT
479 };
480
481 #if UTIL_ARCH_LITTLE_ENDIAN
482 #define PIPE_FORMAT_RGBA8888_UNORM PIPE_FORMAT_R8G8B8A8_UNORM
483 #define PIPE_FORMAT_RGBX8888_UNORM PIPE_FORMAT_R8G8B8X8_UNORM
484 #define PIPE_FORMAT_BGRA8888_UNORM PIPE_FORMAT_B8G8R8A8_UNORM
485 #define PIPE_FORMAT_BGRX8888_UNORM PIPE_FORMAT_B8G8R8X8_UNORM
486 #define PIPE_FORMAT_ARGB8888_UNORM PIPE_FORMAT_A8R8G8B8_UNORM
487 #define PIPE_FORMAT_XRGB8888_UNORM PIPE_FORMAT_X8R8G8B8_UNORM
488 #define PIPE_FORMAT_ABGR8888_UNORM PIPE_FORMAT_A8B8G8R8_UNORM
489 #define PIPE_FORMAT_XBGR8888_UNORM PIPE_FORMAT_X8B8G8R8_UNORM
490 #define PIPE_FORMAT_RGBA8888_SNORM PIPE_FORMAT_R8G8B8A8_SNORM
491 #define PIPE_FORMAT_RGBX8888_SNORM PIPE_FORMAT_R8G8B8X8_SNORM
492 #define PIPE_FORMAT_ABGR8888_SNORM PIPE_FORMAT_A8B8G8R8_SNORM
493 #define PIPE_FORMAT_XBGR8888_SNORM PIPE_FORMAT_X8B8G8R8_SNORM
494 #define PIPE_FORMAT_RGBA8888_SRGB PIPE_FORMAT_R8G8B8A8_SRGB
495 #define PIPE_FORMAT_RGBX8888_SRGB PIPE_FORMAT_R8G8B8X8_SRGB
496 #define PIPE_FORMAT_BGRA8888_SRGB PIPE_FORMAT_B8G8R8A8_SRGB
497 #define PIPE_FORMAT_BGRX8888_SRGB PIPE_FORMAT_B8G8R8X8_SRGB
498 #define PIPE_FORMAT_ARGB8888_SRGB PIPE_FORMAT_A8R8G8B8_SRGB
499 #define PIPE_FORMAT_XRGB8888_SRGB PIPE_FORMAT_X8R8G8B8_SRGB
500 #define PIPE_FORMAT_ABGR8888_SRGB PIPE_FORMAT_A8B8G8R8_SRGB
501 #define PIPE_FORMAT_XBGR8888_SRGB PIPE_FORMAT_X8B8G8R8_SRGB
502 #define PIPE_FORMAT_RGBA8888_USCALED PIPE_FORMAT_R8G8B8A8_USCALED
503 #define PIPE_FORMAT_RGBA8888_SSCALED PIPE_FORMAT_R8G8B8A8_SSCALED
504 #define PIPE_FORMAT_RGBA8888_UINT PIPE_FORMAT_R8G8B8A8_UINT
505 #define PIPE_FORMAT_BGRA8888_UINT PIPE_FORMAT_B8G8R8A8_UINT
506 #define PIPE_FORMAT_ARGB8888_UINT PIPE_FORMAT_A8R8G8B8_UINT
507 #define PIPE_FORMAT_ABGR8888_UINT PIPE_FORMAT_A8B8G8R8_UINT
508 #define PIPE_FORMAT_RGBA8888_SINT PIPE_FORMAT_R8G8B8A8_SINT
509 #define PIPE_FORMAT_RG88_UNORM PIPE_FORMAT_R8G8_UNORM
510 #define PIPE_FORMAT_GR88_UNORM PIPE_FORMAT_G8R8_UNORM
511 #define PIPE_FORMAT_RG88_SNORM PIPE_FORMAT_R8G8_SNORM
512 #define PIPE_FORMAT_GR88_SNORM PIPE_FORMAT_G8R8_SNORM
513 #define PIPE_FORMAT_RG1616_UNORM PIPE_FORMAT_R16G16_UNORM
514 #define PIPE_FORMAT_GR1616_UNORM PIPE_FORMAT_G16R16_UNORM
515 #define PIPE_FORMAT_RG1616_SNORM PIPE_FORMAT_R16G16_SNORM
516 #define PIPE_FORMAT_GR1616_SNORM PIPE_FORMAT_G16R16_SNORM
517 #elif UTIL_ARCH_BIG_ENDIAN
518 #define PIPE_FORMAT_ABGR8888_UNORM PIPE_FORMAT_R8G8B8A8_UNORM
519 #define PIPE_FORMAT_XBGR8888_UNORM PIPE_FORMAT_R8G8B8X8_UNORM
520 #define PIPE_FORMAT_ARGB8888_UNORM PIPE_FORMAT_B8G8R8A8_UNORM
521 #define PIPE_FORMAT_XRGB8888_UNORM PIPE_FORMAT_B8G8R8X8_UNORM
522 #define PIPE_FORMAT_BGRA8888_UNORM PIPE_FORMAT_A8R8G8B8_UNORM
523 #define PIPE_FORMAT_BGRX8888_UNORM PIPE_FORMAT_X8R8G8B8_UNORM
524 #define PIPE_FORMAT_RGBA8888_UNORM PIPE_FORMAT_A8B8G8R8_UNORM
525 #define PIPE_FORMAT_RGBX8888_UNORM PIPE_FORMAT_X8B8G8R8_UNORM
526 #define PIPE_FORMAT_ABGR8888_SNORM PIPE_FORMAT_R8G8B8A8_SNORM
527 #define PIPE_FORMAT_XBGR8888_SNORM PIPE_FORMAT_R8G8B8X8_SNORM
528 #define PIPE_FORMAT_RGBA8888_SNORM PIPE_FORMAT_A8B8G8R8_SNORM
529 #define PIPE_FORMAT_RGBX8888_SNORM PIPE_FORMAT_X8B8G8R8_SNORM
530 #define PIPE_FORMAT_ABGR8888_SRGB PIPE_FORMAT_R8G8B8A8_SRGB
531 #define PIPE_FORMAT_XBGR8888_SRGB PIPE_FORMAT_R8G8B8X8_SRGB
532 #define PIPE_FORMAT_ARGB8888_SRGB PIPE_FORMAT_B8G8R8A8_SRGB
533 #define PIPE_FORMAT_XRGB8888_SRGB PIPE_FORMAT_B8G8R8X8_SRGB
534 #define PIPE_FORMAT_BGRA8888_SRGB PIPE_FORMAT_A8R8G8B8_SRGB
535 #define PIPE_FORMAT_BGRX8888_SRGB PIPE_FORMAT_X8R8G8B8_SRGB
536 #define PIPE_FORMAT_RGBA8888_SRGB PIPE_FORMAT_A8B8G8R8_SRGB
537 #define PIPE_FORMAT_RGBX8888_SRGB PIPE_FORMAT_X8B8G8R8_SRGB
538 #define PIPE_FORMAT_RGBA8888_USCALED PIPE_FORMAT_A8B8G8R8_USCALED
539 #define PIPE_FORMAT_RGBA8888_SSCALED PIPE_FORMAT_A8B8G8R8_SSCALED
540 #define PIPE_FORMAT_RGBA8888_UINT PIPE_FORMAT_A8B8G8R8_UINT
541 #define PIPE_FORMAT_BGRA8888_UINT PIPE_FORMAT_A8R8G8B8_UINT
542 #define PIPE_FORMAT_ARGB8888_UINT PIPE_FORMAT_B8G8R8A8_UINT
543 #define PIPE_FORMAT_ABGR8888_UINT PIPE_FORMAT_R8G8B8A8_UINT
544 #define PIPE_FORMAT_RGBA8888_SINT PIPE_FORMAT_A8B8G8R8_SINT
545 #define PIPE_FORMAT_RG88_UNORM PIPE_FORMAT_G8R8_UNORM
546 #define PIPE_FORMAT_GR88_UNORM PIPE_FORMAT_R8G8_UNORM
547 #define PIPE_FORMAT_RG88_SNORM PIPE_FORMAT_G8R8_SNORM
548 #define PIPE_FORMAT_GR88_SNORM PIPE_FORMAT_R8G8_SNORM
549 #define PIPE_FORMAT_RG1616_UNORM PIPE_FORMAT_G16R16_UNORM
550 #define PIPE_FORMAT_GR1616_UNORM PIPE_FORMAT_R16G16_UNORM
551 #define PIPE_FORMAT_RG1616_SNORM PIPE_FORMAT_G16R16_SNORM
552 #define PIPE_FORMAT_GR1616_SNORM PIPE_FORMAT_R16G16_SNORM
553 #endif
554
555 enum pipe_video_chroma_format
556 {
557 PIPE_VIDEO_CHROMA_FORMAT_400,
558 PIPE_VIDEO_CHROMA_FORMAT_420,
559 PIPE_VIDEO_CHROMA_FORMAT_422,
560 PIPE_VIDEO_CHROMA_FORMAT_444,
561 PIPE_VIDEO_CHROMA_FORMAT_NONE
562 };
563
564 static inline enum pipe_video_chroma_format
565 pipe_format_to_chroma_format(enum pipe_format format)
566 {
567 switch (format) {
568 case PIPE_FORMAT_NV12:
569 case PIPE_FORMAT_NV21:
570 case PIPE_FORMAT_YV12:
571 case PIPE_FORMAT_IYUV:
572 case PIPE_FORMAT_P010:
573 case PIPE_FORMAT_P016:
574 return PIPE_VIDEO_CHROMA_FORMAT_420;
575 case PIPE_FORMAT_UYVY:
576 case PIPE_FORMAT_YUYV:
577 case PIPE_FORMAT_YV16:
578 return PIPE_VIDEO_CHROMA_FORMAT_422;
579 default:
580 return PIPE_VIDEO_CHROMA_FORMAT_NONE;
581 }
582 }
583
584 #ifdef __cplusplus
585 }
586 #endif
587
588 #endif