1 /**************************************************************************
3 * Copyright 2007 Tungsten Graphics, Inc., Cedar Park, Texas.
4 * Copyright (c) 2008 VMware, Inc.
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:
15 * The above copyright notice and this permission notice (including the
16 * next paragraph) shall be included in all copies or substantial portions
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 TUNGSTEN GRAPHICS 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.
27 **************************************************************************/
32 #include "p_compiler.h"
39 * Texture/surface image formats (preliminary)
42 /* KW: Added lots of surface formats to support vertex element layout
43 * definitions, and eventually render-to-vertex-buffer.
48 PIPE_FORMAT_B8G8R8A8_UNORM = 1,
49 PIPE_FORMAT_B8G8R8X8_UNORM = 2,
50 PIPE_FORMAT_A8R8G8B8_UNORM = 3,
51 PIPE_FORMAT_X8R8G8B8_UNORM = 4,
52 PIPE_FORMAT_B5G5R5A1_UNORM = 5,
53 PIPE_FORMAT_B4G4R4A4_UNORM = 6,
54 PIPE_FORMAT_B5G6R5_UNORM = 7,
55 PIPE_FORMAT_R10G10B10A2_UNORM = 8,
56 PIPE_FORMAT_L8_UNORM = 9, /**< ubyte luminance */
57 PIPE_FORMAT_A8_UNORM = 10, /**< ubyte alpha */
58 PIPE_FORMAT_I8_UNORM = 11, /**< ubyte intensity */
59 PIPE_FORMAT_L8A8_UNORM = 12, /**< ubyte alpha, luminance */
60 PIPE_FORMAT_L16_UNORM = 13, /**< ushort luminance */
61 PIPE_FORMAT_UYVY = 14,
62 PIPE_FORMAT_YUYV = 15,
63 PIPE_FORMAT_Z16_UNORM = 16,
64 PIPE_FORMAT_Z32_UNORM = 17,
65 PIPE_FORMAT_Z32_FLOAT = 18,
66 PIPE_FORMAT_Z24_UNORM_S8_USCALED = 19,
67 PIPE_FORMAT_S8_USCALED_Z24_UNORM = 20,
68 PIPE_FORMAT_Z24X8_UNORM = 21,
69 PIPE_FORMAT_X8Z24_UNORM = 22,
70 PIPE_FORMAT_S8_USCALED = 23, /**< ubyte stencil */
71 PIPE_FORMAT_R64_FLOAT = 24,
72 PIPE_FORMAT_R64G64_FLOAT = 25,
73 PIPE_FORMAT_R64G64B64_FLOAT = 26,
74 PIPE_FORMAT_R64G64B64A64_FLOAT = 27,
75 PIPE_FORMAT_R32_FLOAT = 28,
76 PIPE_FORMAT_R32G32_FLOAT = 29,
77 PIPE_FORMAT_R32G32B32_FLOAT = 30,
78 PIPE_FORMAT_R32G32B32A32_FLOAT = 31,
79 PIPE_FORMAT_R32_UNORM = 32,
80 PIPE_FORMAT_R32G32_UNORM = 33,
81 PIPE_FORMAT_R32G32B32_UNORM = 34,
82 PIPE_FORMAT_R32G32B32A32_UNORM = 35,
83 PIPE_FORMAT_R32_USCALED = 36,
84 PIPE_FORMAT_R32G32_USCALED = 37,
85 PIPE_FORMAT_R32G32B32_USCALED = 38,
86 PIPE_FORMAT_R32G32B32A32_USCALED = 39,
87 PIPE_FORMAT_R32_SNORM = 40,
88 PIPE_FORMAT_R32G32_SNORM = 41,
89 PIPE_FORMAT_R32G32B32_SNORM = 42,
90 PIPE_FORMAT_R32G32B32A32_SNORM = 43,
91 PIPE_FORMAT_R32_SSCALED = 44,
92 PIPE_FORMAT_R32G32_SSCALED = 45,
93 PIPE_FORMAT_R32G32B32_SSCALED = 46,
94 PIPE_FORMAT_R32G32B32A32_SSCALED = 47,
95 PIPE_FORMAT_R16_UNORM = 48,
96 PIPE_FORMAT_R16G16_UNORM = 49,
97 PIPE_FORMAT_R16G16B16_UNORM = 50,
98 PIPE_FORMAT_R16G16B16A16_UNORM = 51,
99 PIPE_FORMAT_R16_USCALED = 52,
100 PIPE_FORMAT_R16G16_USCALED = 53,
101 PIPE_FORMAT_R16G16B16_USCALED = 54,
102 PIPE_FORMAT_R16G16B16A16_USCALED = 55,
103 PIPE_FORMAT_R16_SNORM = 56,
104 PIPE_FORMAT_R16G16_SNORM = 57,
105 PIPE_FORMAT_R16G16B16_SNORM = 58,
106 PIPE_FORMAT_R16G16B16A16_SNORM = 59,
107 PIPE_FORMAT_R16_SSCALED = 60,
108 PIPE_FORMAT_R16G16_SSCALED = 61,
109 PIPE_FORMAT_R16G16B16_SSCALED = 62,
110 PIPE_FORMAT_R16G16B16A16_SSCALED = 63,
111 PIPE_FORMAT_R8_UNORM = 64,
112 PIPE_FORMAT_R8G8_UNORM = 65,
113 PIPE_FORMAT_R8G8B8_UNORM = 66,
114 PIPE_FORMAT_R8G8B8A8_UNORM = 67,
115 PIPE_FORMAT_X8B8G8R8_UNORM = 68,
116 PIPE_FORMAT_R8_USCALED = 69,
117 PIPE_FORMAT_R8G8_USCALED = 70,
118 PIPE_FORMAT_R8G8B8_USCALED = 71,
119 PIPE_FORMAT_R8G8B8A8_USCALED = 72,
120 PIPE_FORMAT_R8_SNORM = 74,
121 PIPE_FORMAT_R8G8_SNORM = 75,
122 PIPE_FORMAT_R8G8B8_SNORM = 76,
123 PIPE_FORMAT_R8G8B8A8_SNORM = 77,
124 PIPE_FORMAT_R8_SSCALED = 82,
125 PIPE_FORMAT_R8G8_SSCALED = 83,
126 PIPE_FORMAT_R8G8B8_SSCALED = 84,
127 PIPE_FORMAT_R8G8B8A8_SSCALED = 85,
128 PIPE_FORMAT_R32_FIXED = 87,
129 PIPE_FORMAT_R32G32_FIXED = 88,
130 PIPE_FORMAT_R32G32B32_FIXED = 89,
131 PIPE_FORMAT_R32G32B32A32_FIXED = 90,
132 PIPE_FORMAT_R16_FLOAT = 91,
133 PIPE_FORMAT_R16G16_FLOAT = 92,
134 PIPE_FORMAT_R16G16B16_FLOAT = 93,
135 PIPE_FORMAT_R16G16B16A16_FLOAT = 94,
138 PIPE_FORMAT_L8_SRGB = 95,
139 PIPE_FORMAT_L8A8_SRGB = 96,
140 PIPE_FORMAT_R8G8B8_SRGB = 97,
141 PIPE_FORMAT_A8B8G8R8_SRGB = 98,
142 PIPE_FORMAT_X8B8G8R8_SRGB = 99,
143 PIPE_FORMAT_B8G8R8A8_SRGB = 100,
144 PIPE_FORMAT_B8G8R8X8_SRGB = 101,
145 PIPE_FORMAT_A8R8G8B8_SRGB = 102,
146 PIPE_FORMAT_X8R8G8B8_SRGB = 103,
147 PIPE_FORMAT_R8G8B8A8_SRGB = 104,
149 /* compressed formats */
150 PIPE_FORMAT_DXT1_RGB = 105,
151 PIPE_FORMAT_DXT1_RGBA = 106,
152 PIPE_FORMAT_DXT3_RGBA = 107,
153 PIPE_FORMAT_DXT5_RGBA = 108,
155 /* sRGB, compressed */
156 PIPE_FORMAT_DXT1_SRGB = 109,
157 PIPE_FORMAT_DXT1_SRGBA = 110,
158 PIPE_FORMAT_DXT3_SRGBA = 111,
159 PIPE_FORMAT_DXT5_SRGBA = 112,
161 /* rgtc compressed */
162 PIPE_FORMAT_RGTC1_UNORM = 113,
163 PIPE_FORMAT_RGTC1_SNORM = 114,
164 PIPE_FORMAT_RGTC2_UNORM = 115,
165 PIPE_FORMAT_RGTC2_SNORM = 116,
167 PIPE_FORMAT_R8G8_B8G8_UNORM = 117,
168 PIPE_FORMAT_G8R8_G8B8_UNORM = 118,
171 PIPE_FORMAT_R8SG8SB8UX8U_NORM = 119,
172 PIPE_FORMAT_R5SG5SB6U_NORM = 120,
174 /* TODO: re-order these */
175 PIPE_FORMAT_A8B8G8R8_UNORM = 121,
176 PIPE_FORMAT_B5G5R5X1_UNORM = 122,
177 PIPE_FORMAT_R10G10B10A2_USCALED = 123,
178 PIPE_FORMAT_R11G11B10_FLOAT = 124,
179 PIPE_FORMAT_R9G9B9E5_FLOAT = 125,
180 PIPE_FORMAT_Z32_FLOAT_S8X24_USCALED = 126,
181 PIPE_FORMAT_R1_UNORM = 127,
182 PIPE_FORMAT_R10G10B10X2_USCALED = 128,
183 PIPE_FORMAT_R10G10B10X2_SNORM = 129,
184 PIPE_FORMAT_L4A4_UNORM = 130,
185 PIPE_FORMAT_B10G10R10A2_UNORM = 131,
186 PIPE_FORMAT_R10SG10SB10SA2U_NORM = 132,
187 PIPE_FORMAT_R8G8Bx_SNORM = 133,
188 PIPE_FORMAT_R8G8B8X8_UNORM = 134,
189 PIPE_FORMAT_B4G4R4X4_UNORM = 135,