Hook in new draw_arrays() code, disabled for now.
[mesa.git] / src / mesa / pipe / p_defines.h
1 /**************************************************************************
2 *
3 * Copyright 2007 Tungsten Graphics, Inc., Cedar Park, Texas.
4 * All Rights Reserved.
5 *
6 * Permission is hereby granted, free of charge, to any person obtaining a
7 * copy of this software and associated documentation files (the
8 * "Software"), to deal in the Software without restriction, including
9 * without limitation the rights to use, copy, modify, merge, publish,
10 * distribute, sub license, and/or sell copies of the Software, and to
11 * permit persons to whom the Software is furnished to do so, subject to
12 * the following conditions:
13 *
14 * The above copyright notice and this permission notice (including the
15 * next paragraph) shall be included in all copies or substantial portions
16 * of the Software.
17 *
18 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
19 * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
20 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
21 * IN NO EVENT SHALL TUNGSTEN GRAPHICS AND/OR ITS SUPPLIERS BE LIABLE FOR
22 * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
23 * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
24 * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
25 *
26 **************************************************************************/
27
28 #ifndef PIPE_DEFINES_H
29 #define PIPE_DEFINES_H
30
31 #define PIPE_BLENDFACTOR_ONE 0x1
32 #define PIPE_BLENDFACTOR_SRC_COLOR 0x2
33 #define PIPE_BLENDFACTOR_SRC_ALPHA 0x3
34 #define PIPE_BLENDFACTOR_DST_ALPHA 0x4
35 #define PIPE_BLENDFACTOR_DST_COLOR 0x5
36 #define PIPE_BLENDFACTOR_SRC_ALPHA_SATURATE 0x6
37 #define PIPE_BLENDFACTOR_CONST_COLOR 0x7
38 #define PIPE_BLENDFACTOR_CONST_ALPHA 0x8
39 #define PIPE_BLENDFACTOR_SRC1_COLOR 0x9
40 #define PIPE_BLENDFACTOR_SRC1_ALPHA 0x0A
41 #define PIPE_BLENDFACTOR_ZERO 0x11
42 #define PIPE_BLENDFACTOR_INV_SRC_COLOR 0x12
43 #define PIPE_BLENDFACTOR_INV_SRC_ALPHA 0x13
44 #define PIPE_BLENDFACTOR_INV_DST_ALPHA 0x14
45 #define PIPE_BLENDFACTOR_INV_DST_COLOR 0x15
46 #define PIPE_BLENDFACTOR_INV_CONST_COLOR 0x17
47 #define PIPE_BLENDFACTOR_INV_CONST_ALPHA 0x18
48 #define PIPE_BLENDFACTOR_INV_SRC1_COLOR 0x19
49 #define PIPE_BLENDFACTOR_INV_SRC1_ALPHA 0x1A
50
51 #define PIPE_BLEND_ADD 0
52 #define PIPE_BLEND_SUBTRACT 1
53 #define PIPE_BLEND_REVERSE_SUBTRACT 2
54 #define PIPE_BLEND_MIN 3
55 #define PIPE_BLEND_MAX 4
56
57 #define PIPE_LOGICOP_CLEAR 0
58 #define PIPE_LOGICOP_NOR 1
59 #define PIPE_LOGICOP_AND_INVERTED 2
60 #define PIPE_LOGICOP_COPY_INVERTED 3
61 #define PIPE_LOGICOP_AND_REVERSE 4
62 #define PIPE_LOGICOP_INVERT 5
63 #define PIPE_LOGICOP_XOR 6
64 #define PIPE_LOGICOP_NAND 7
65 #define PIPE_LOGICOP_AND 8
66 #define PIPE_LOGICOP_EQUIV 9
67 #define PIPE_LOGICOP_NOOP 10
68 #define PIPE_LOGICOP_OR_INVERTED 11
69 #define PIPE_LOGICOP_COPY 12
70 #define PIPE_LOGICOP_OR_REVERSE 13
71 #define PIPE_LOGICOP_OR 14
72 #define PIPE_LOGICOP_SET 15
73
74 #define PIPE_MASK_R 0x1
75 #define PIPE_MASK_G 0x2
76 #define PIPE_MASK_B 0x4
77 #define PIPE_MASK_A 0x8
78 #define PIPE_MASK_RGBA 0xf
79
80
81 /**
82 * Inequality functions. Used for depth test, stencil compare, alpha
83 * test, shadow compare, etc.
84 */
85 #define PIPE_FUNC_NEVER 0
86 #define PIPE_FUNC_LESS 1
87 #define PIPE_FUNC_EQUAL 2
88 #define PIPE_FUNC_LEQUAL 3
89 #define PIPE_FUNC_GREATER 4
90 #define PIPE_FUNC_NOTEQUAL 5
91 #define PIPE_FUNC_GEQUAL 6
92 #define PIPE_FUNC_ALWAYS 7
93
94 /** Polygon fill mode */
95 #define PIPE_POLYGON_MODE_FILL 0
96 #define PIPE_POLYGON_MODE_LINE 1
97 #define PIPE_POLYGON_MODE_POINT 2
98
99 /** Polygon front/back window, also for culling */
100 #define PIPE_WINDING_NONE 0
101 #define PIPE_WINDING_CW 1
102 #define PIPE_WINDING_CCW 2
103 #define PIPE_WINDING_BOTH (PIPE_WINDING_CW | PIPE_WINDING_CCW)
104
105 /** Stencil ops */
106 #define PIPE_STENCIL_OP_KEEP 0
107 #define PIPE_STENCIL_OP_ZERO 1
108 #define PIPE_STENCIL_OP_REPLACE 2
109 #define PIPE_STENCIL_OP_INCR 3
110 #define PIPE_STENCIL_OP_DECR 4
111 #define PIPE_STENCIL_OP_INCR_WRAP 5
112 #define PIPE_STENCIL_OP_DECR_WRAP 6
113 #define PIPE_STENCIL_OP_INVERT 7
114
115 /** Texture types */
116 #define PIPE_TEXTURE_1D 0
117 #define PIPE_TEXTURE_2D 1
118 #define PIPE_TEXTURE_3D 2
119 #define PIPE_TEXTURE_CUBE 3
120
121 #define PIPE_TEX_FACE_POS_X 0
122 #define PIPE_TEX_FACE_NEG_X 1
123 #define PIPE_TEX_FACE_POS_Y 2
124 #define PIPE_TEX_FACE_NEG_Y 3
125 #define PIPE_TEX_FACE_POS_Z 4
126 #define PIPE_TEX_FACE_NEG_Z 5
127
128 #define PIPE_TEX_WRAP_REPEAT 0
129 #define PIPE_TEX_WRAP_CLAMP 1
130 #define PIPE_TEX_WRAP_CLAMP_TO_EDGE 2
131 #define PIPE_TEX_WRAP_CLAMP_TO_BORDER 3
132 #define PIPE_TEX_WRAP_MIRROR_REPEAT 4
133 #define PIPE_TEX_WRAP_MIRROR_CLAMP 5
134 #define PIPE_TEX_WRAP_MIRROR_CLAMP_TO_EDGE 6
135 #define PIPE_TEX_WRAP_MIRROR_CLAMP_TO_BORDER 7
136
137 /* Between mipmaps, ie mipfilter
138 */
139 #define PIPE_TEX_MIPFILTER_NEAREST 0
140 #define PIPE_TEX_MIPFILTER_LINEAR 1
141 #define PIPE_TEX_MIPFILTER_NONE 2
142
143 /* Within a mipmap, ie min/mag filter
144 */
145 #define PIPE_TEX_FILTER_NEAREST 0
146 #define PIPE_TEX_FILTER_LINEAR 1
147 //#define PIPE_TEX_FILTER_ANISO 2
148
149
150 #define PIPE_TEX_COMPARE_NONE 0
151 #define PIPE_TEX_COMPARE_R_TO_TEXTURE 1
152
153 #define PIPE_TEX_FACE_POS_X 0
154 #define PIPE_TEX_FACE_NEG_X 1
155 #define PIPE_TEX_FACE_POS_Y 2
156 #define PIPE_TEX_FACE_NEG_Y 3
157 #define PIPE_TEX_FACE_POS_Z 4
158 #define PIPE_TEX_FACE_NEG_Z 5
159 #define PIPE_TEX_FACE_MAX 6
160
161
162 /**
163 * Texture/surface image formats (preliminary)
164 */
165
166 /* KW: Added lots of surface formats to support vertex element layout
167 * definitions, and eventually render-to-vertex-buffer. Could
168 * consider making float/int/uint/scaled/normalized a separate
169 * parameter, but on the other hand there are special cases like
170 * z24s8, compressed textures, ycbcr, etc that won't fit that model.
171 */
172
173 #define PIPE_FORMAT_NONE 0 /**< unstructured */
174 #define PIPE_FORMAT_U_A8_R8_G8_B8 2 /**< ubyte[4] ARGB */
175 #define PIPE_FORMAT_U_A1_R5_G5_B5 3 /**< 16-bit packed RGBA */
176 #define PIPE_FORMAT_U_A4_R4_G4_B4 4 /**< 16-bit packed RGBA */
177 #define PIPE_FORMAT_U_R5_G6_B5 5 /**< 16-bit packed RGB */
178 #define PIPE_FORMAT_U_L8 6 /**< ubyte luminance */
179 #define PIPE_FORMAT_U_A8 7 /**< ubyte alpha */
180 #define PIPE_FORMAT_U_I8 8 /**< ubyte intensity */
181 #define PIPE_FORMAT_U_L8_A8 9 /**< ubyte luminance, alpha */
182 #define PIPE_FORMAT_S_R16_G16_B16_A16 10 /**< signed 16-bit RGBA (accum) */
183 #define PIPE_FORMAT_YCBCR 11
184 #define PIPE_FORMAT_YCBCR_REV 12
185 #define PIPE_FORMAT_U_Z16 13 /**< ushort Z/depth */
186 #define PIPE_FORMAT_U_Z32 14 /**< uint Z/depth */
187 #define PIPE_FORMAT_F_Z32 15 /**< float Z/depth */
188 #define PIPE_FORMAT_S8_Z24 16 /**< 8-bit stencil + 24-bit Z */
189 #define PIPE_FORMAT_U_S8 17 /**< 8-bit stencil */
190 #define PIPE_FORMAT_R64_FLOAT 0x20
191 #define PIPE_FORMAT_R64G64_FLOAT 0x21
192 #define PIPE_FORMAT_R64G64B64_FLOAT 0x22
193 #define PIPE_FORMAT_R64G64B64A64_FLOAT 0x23
194 #define PIPE_FORMAT_R32_FLOAT 0x24
195 #define PIPE_FORMAT_R32G32_FLOAT 0x25
196 #define PIPE_FORMAT_R32G32B32_FLOAT 0x26
197 #define PIPE_FORMAT_R32G32B32A32_FLOAT 0x27
198 #define PIPE_FORMAT_R32_UNORM 0x28
199 #define PIPE_FORMAT_R32G32_UNORM 0x29
200 #define PIPE_FORMAT_R32G32B32_UNORM 0x2a
201 #define PIPE_FORMAT_R32G32B32A32_UNORM 0x2b
202 #define PIPE_FORMAT_R32_USCALED 0x2c
203 #define PIPE_FORMAT_R32G32_USCALED 0x2d
204 #define PIPE_FORMAT_R32G32B32_USCALED 0x2e
205 #define PIPE_FORMAT_R32G32B32A32_USCALED 0x2f
206 #define PIPE_FORMAT_R32_SNORM 0x30
207 #define PIPE_FORMAT_R32G32_SNORM 0x31
208 #define PIPE_FORMAT_R32G32B32_SNORM 0x32
209 #define PIPE_FORMAT_R32G32B32A32_SNORM 0x33
210 #define PIPE_FORMAT_R32_SSCALED 0x34
211 #define PIPE_FORMAT_R32G32_SSCALED 0x35
212 #define PIPE_FORMAT_R32G32B32_SSCALED 0x36
213 #define PIPE_FORMAT_R32G32B32A32_SSCALED 0x37
214 #define PIPE_FORMAT_R16_UNORM 0x38
215 #define PIPE_FORMAT_R16G16_UNORM 0x39
216 #define PIPE_FORMAT_R16G16B16_UNORM 0x3a
217 #define PIPE_FORMAT_R16G16B16A16_UNORM 0x3b
218 #define PIPE_FORMAT_R16_USCALED 0x3c
219 #define PIPE_FORMAT_R16G16_USCALED 0x3d
220 #define PIPE_FORMAT_R16G16B16_USCALED 0x3e
221 #define PIPE_FORMAT_R16G16B16A16_USCALED 0x3f
222 #define PIPE_FORMAT_R16_SNORM 0x40
223 #define PIPE_FORMAT_R16G16_SNORM 0x41
224 #define PIPE_FORMAT_R16G16B16_SNORM 0x42
225 #define PIPE_FORMAT_R16G16B16A16_SNORM 0x43
226 #define PIPE_FORMAT_R16_SSCALED 0x44
227 #define PIPE_FORMAT_R16G16_SSCALED 0x45
228 #define PIPE_FORMAT_R16G16B16_SSCALED 0x46
229 #define PIPE_FORMAT_R16G16B16A16_SSCALED 0x47
230 #define PIPE_FORMAT_R8_UNORM 0x48
231 #define PIPE_FORMAT_R8G8_UNORM 0x49
232 #define PIPE_FORMAT_R8G8B8_UNORM 0x4a
233 #define PIPE_FORMAT_R8G8B8A8_UNORM 0x4b
234 #define PIPE_FORMAT_R8_USCALED 0x4c
235 #define PIPE_FORMAT_R8G8_USCALED 0x4d
236 #define PIPE_FORMAT_R8G8B8_USCALED 0x4e
237 #define PIPE_FORMAT_R8G8B8A8_USCALED 0x4f
238 #define PIPE_FORMAT_R8_SNORM 0x50
239 #define PIPE_FORMAT_R8G8_SNORM 0x51
240 #define PIPE_FORMAT_R8G8B8_SNORM 0x52
241 #define PIPE_FORMAT_R8G8B8A8_SNORM 0x53
242 #define PIPE_FORMAT_R8_SSCALED 0x54
243 #define PIPE_FORMAT_R8G8_SSCALED 0x55
244 #define PIPE_FORMAT_R8G8B8_SSCALED 0x56
245 #define PIPE_FORMAT_R8G8B8A8_SSCALED 0x57
246
247 #define PIPE_FORMAT_COUNT 0x58 /**< number of formats */
248
249 /* Duplicated formats:
250 */
251 #define PIPE_FORMAT_U_R8_G8_B8_A8 PIPE_FORMAT_R8G8B8A8_UNORM
252
253 /**
254 * Surface flags
255 */
256 #define PIPE_SURFACE_FLAG_TEXTURE 0x1
257 #define PIPE_SURFACE_FLAG_RENDER 0x2
258
259
260 /**
261 * Buffer flags
262 */
263 #define PIPE_BUFFER_FLAG_READ 0x1
264 #define PIPE_BUFFER_FLAG_WRITE 0x2
265
266 #define PIPE_BUFFER_USE_TEXTURE 0x1
267 #define PIPE_BUFFER_USE_VERTEX_BUFFER 0x2
268 #define PIPE_BUFFER_USE_INDEX_BUFFER 0x4
269 #define PIPE_BUFFER_USE_RENDER_TARGET 0x8
270
271
272 /**
273 * Flush types:
274 */
275 #define PIPE_FLUSH_RENDER_CACHE 0x1
276 #define PIPE_FLUSH_TEXTURE_CACHE 0x2
277
278
279
280 #endif