Added two new options: def_max_anisotropy and no_neg_lod_bias. The latter one
[mesa.git] / src / mesa / drivers / dri / common / xmlpool.h
1 /* -*- mode:C; coding: mult-utf-8-unix -*-
2 *
3 * !!! Important: This file is encoded in UTF-8 !!!
4 *
5 * Note (Emacs): You need Mule. In Debian the package is called
6 * mule-ucs.
7 *
8 * Note (Emacs): You may have to enable multibyte characters in the
9 * Mule customization group or by setting
10 * default-enable-multibyte-characters to t in your .emacs:
11 */
12 /*
13 * XML DRI client-side driver configuration
14 * Copyright (C) 2003 Felix Kuehling
15 *
16 * Permission is hereby granted, free of charge, to any person obtaining a
17 * copy of this software and associated documentation files (the "Software"),
18 * to deal in the Software without restriction, including without limitation
19 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
20 * and/or sell copies of the Software, and to permit persons to whom the
21 * Software is furnished to do so, subject to the following conditions:
22 *
23 * The above copyright notice and this permission notice shall be included
24 * in all copies or substantial portions of the Software.
25 *
26 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
27 * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
28 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
29 * FELIX KUEHLING, OR ANY OTHER CONTRIBUTORS BE LIABLE FOR ANY CLAIM,
30 * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
31 * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE
32 * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
33 *
34 */
35 /**
36 * \file xmlpool.h
37 * \brief Pool of common options
38 * \author Felix Kuehling
39 *
40 * This file defines macros that can be used to construct driConfigOptions
41 * in the drivers.
42 */
43
44 #ifndef __XMLPOOL_H
45 #define __XMLPOOL_H
46
47 /*
48 * generic macros
49 */
50
51 /** \brief Begin __driConfigOptions */
52 #define DRI_CONF_BEGIN \
53 "<driinfo>\n"
54
55 /** \brief End __driConfigOptions */
56 #define DRI_CONF_END \
57 "</driinfo>\n"
58
59 /** \brief Begin a section of related options */
60 #define DRI_CONF_SECTION_BEGIN \
61 "<section>\n"
62
63 /** \brief End a section of related options */
64 #define DRI_CONF_SECTION_END \
65 "</section>\n"
66
67 /** \brief Begin an option definition */
68 #define DRI_CONF_OPT_BEGIN(name,type,def) \
69 "<option name=\""#name"\" type=\""#type"\" default=\""#def"\">\n"
70
71 /** \brief Begin an option definition with restrictions on valid values */
72 #define DRI_CONF_OPT_BEGIN_V(name,type,def,valid) \
73 "<option name=\""#name"\" type=\""#type"\" default=\""#def"\" valid=\""valid"\">\n"
74
75 /** \brief End an option description */
76 #define DRI_CONF_OPT_END \
77 "</option>\n"
78
79 /** \brief A verbal description in a specified language (empty version) */
80 #define DRI_CONF_DESC(lang,text) \
81 "<description lang=\""#lang"\" text=\""text"\"/>\n"
82
83 /** \brief A verbal description in a specified language */
84 #define DRI_CONF_DESC_BEGIN(lang,text) \
85 "<description lang=\""#lang"\" text=\""text"\">\n"
86
87 /** \brief End a description */
88 #define DRI_CONF_DESC_END \
89 "</description>\n"
90
91 /** \brief A verbal description of an enum value */
92 #define DRI_CONF_ENUM(value,text) \
93 "<enum value=\""#value"\" text=\""text"\"/>\n"
94
95 /*
96 * predefined option sections and options with multi-lingual descriptions
97 */
98
99 /** \brief Debugging options */
100 #define DRI_CONF_SECTION_DEBUG \
101 DRI_CONF_SECTION_BEGIN \
102 DRI_CONF_DESC(en,"Debugging") \
103 DRI_CONF_DESC(de,"Fehlersuche")
104
105 #define DRI_CONF_NO_RAST(def) \
106 DRI_CONF_OPT_BEGIN(no_rast,bool,def) \
107 DRI_CONF_DESC(en,"Disable 3D acceleration") \
108 DRI_CONF_DESC(de,"3D-Beschleunigung abschalten") \
109 DRI_CONF_OPT_END
110
111 #define DRI_CONF_PERFORMANCE_BOXES(def) \
112 DRI_CONF_OPT_BEGIN(performance_boxes,bool,def) \
113 DRI_CONF_DESC(en,"Show performance boxes") \
114 DRI_CONF_DESC(de,"Zeige Performanceboxen") \
115 DRI_CONF_OPT_END
116
117 #define DRI_CONF_DEBUG_DMA(def) \
118 DRI_CONF_OPT_BEGIN(debug_dma,bool,def) \
119 DRI_CONF_DESC(en,"Debug DMA buffers") \
120 DRI_CONF_DESC(de,"DMA Puffer debuggen") \
121 DRI_CONF_OPT_END
122
123
124 /** \brief Texture-related options */
125 #define DRI_CONF_SECTION_QUALITY \
126 DRI_CONF_SECTION_BEGIN \
127 DRI_CONF_DESC(en,"Image Quality") \
128 DRI_CONF_DESC(de,"Bildqualität")
129
130 #define DRI_CONF_TEXTURE_DEPTH_FB 0
131 #define DRI_CONF_TEXTURE_DEPTH_32 1
132 #define DRI_CONF_TEXTURE_DEPTH_16 2
133 #define DRI_CONF_TEXTURE_DEPTH_FORCE_16 3
134 #define DRI_CONF_TEXTURE_DEPTH(def) \
135 DRI_CONF_OPT_BEGIN_V(texture_depth,enum,def,"0:3") \
136 DRI_CONF_DESC_BEGIN(en,"Texture color depth") \
137 DRI_CONF_ENUM(0,"Prefer frame buffer color depth") \
138 DRI_CONF_ENUM(1,"Prefer 32 bits") \
139 DRI_CONF_ENUM(2,"Prefer 16 bits") \
140 DRI_CONF_ENUM(3,"Force 16 bits") \
141 DRI_CONF_DESC_END \
142 DRI_CONF_DESC_BEGIN(de,"Texturfarbtiefe") \
143 DRI_CONF_ENUM(0,"Bevorzugt so wie Frambuffer") \
144 DRI_CONF_ENUM(1,"Bevorzugt 32 Bits") \
145 DRI_CONF_ENUM(2,"Bevorzugt 16 Bits") \
146 DRI_CONF_ENUM(3,"Höchstens 16 Bits") \
147 DRI_CONF_DESC_END \
148 DRI_CONF_OPT_END
149
150 #define DRI_CONF_DEF_MAX_ANISOTROPY(def,range) \
151 DRI_CONF_OPT_BEGIN_V(def_max_anisotropy,float,def,range) \
152 DRI_CONF_DESC(en,"Default maximum value for anisotropic texture filtering") \
153 DRI_CONF_DESC(de,"Standard Maximalwert für anisotropische Texturfilterung") \
154 DRI_CONF_OPT_END
155
156 #define DRI_CONF_NO_NEG_LOD_BIAS(def) \
157 DRI_CONF_OPT_BEGIN(no_neg_lod_bias,bool,def) \
158 DRI_CONF_DESC(en,"Forbid negative texture LOD bias") \
159 DRI_CONF_DESC(de,"Verbiete negativen Textur-LOD-Bias") \
160 DRI_CONF_OPT_END
161
162 #define DRI_CONF_COLOR_REDUCTION_ROUND 0
163 #define DRI_CONF_COLOR_REDUCTION_DITHER 1
164 #define DRI_CONF_COLOR_REDUCTION(def) \
165 DRI_CONF_OPT_BEGIN_V(color_reduction,enum,def,"0:1") \
166 DRI_CONF_DESC_BEGIN(en,"Default color reduction method") \
167 DRI_CONF_ENUM(0,"Round or truncate") \
168 DRI_CONF_ENUM(1,"Dither") \
169 DRI_CONF_DESC_END \
170 DRI_CONF_DESC_BEGIN(de,"Standardmethode zur Farbreduktion") \
171 DRI_CONF_ENUM(0,"Runden oder Abschneiden") \
172 DRI_CONF_ENUM(1,"Rastern") \
173 DRI_CONF_DESC_END \
174 DRI_CONF_OPT_END
175
176 #define DRI_CONF_ROUND_TRUNC 0
177 #define DRI_CONF_ROUND_ROUND 1
178 #define DRI_CONF_ROUND_MODE(def) \
179 DRI_CONF_OPT_BEGIN_V(round_mode,enum,def,"0:1") \
180 DRI_CONF_DESC_BEGIN(en,"Round or truncate colors") \
181 DRI_CONF_ENUM(0,"Truncate") \
182 DRI_CONF_ENUM(1,"Round") \
183 DRI_CONF_DESC_END \
184 DRI_CONF_DESC_BEGIN(de,"Farben runden oder abschneiden") \
185 DRI_CONF_ENUM(0,"Abschneiden") \
186 DRI_CONF_ENUM(1,"Runden") \
187 DRI_CONF_DESC_END \
188 DRI_CONF_OPT_END
189
190 #define DRI_CONF_DITHER_XERRORDIFF 0
191 #define DRI_CONF_DITHER_XERRORDIFFRESET 1
192 #define DRI_CONF_DITHER_ORDERED 2
193 #define DRI_CONF_DITHER_MODE(def) \
194 DRI_CONF_OPT_BEGIN_V(dither_mode,enum,def,"0:2") \
195 DRI_CONF_DESC_BEGIN(en,"Color dithering") \
196 DRI_CONF_ENUM(0,"Horizontal error diffusion") \
197 DRI_CONF_ENUM(1,"Horizontal error diffusion, reset error at line start") \
198 DRI_CONF_ENUM(2,"Ordered 2D dithering") \
199 DRI_CONF_DESC_END \
200 DRI_CONF_DESC_BEGIN(de,"Farben rastern") \
201 DRI_CONF_ENUM(0,"Horizontale Fehlerstreuung") \
202 DRI_CONF_ENUM(1,"Horizontale Fehlerstreuung, Fehler am Zeilenanfang zurücksetzen") \
203 DRI_CONF_ENUM(2,"Geordnete 2D Farbrasterung") \
204 DRI_CONF_DESC_END \
205 DRI_CONF_OPT_END
206
207 /** \brief Performance-related options */
208 #define DRI_CONF_SECTION_PERFORMANCE \
209 DRI_CONF_SECTION_BEGIN \
210 DRI_CONF_DESC(en,"Performance") \
211 DRI_CONF_DESC(de,"Leistung")
212
213 #define DRI_CONF_TCL_SW 0
214 #define DRI_CONF_TCL_PIPELINED 1
215 #define DRI_CONF_TCL_VTXFMT 2
216 #define DRI_CONF_TCL_CODEGEN 3
217 #define DRI_CONF_TCL_MODE(def) \
218 DRI_CONF_OPT_BEGIN_V(tcl_mode,enum,def,"0:3") \
219 DRI_CONF_DESC_BEGIN(en,"TCL mode (Transformation, Clipping, Lighting)") \
220 DRI_CONF_ENUM(0,"Software") \
221 DRI_CONF_ENUM(1,"TCL stage in MESA pipeline") \
222 DRI_CONF_ENUM(2,"Bypass MESA's pipeline") \
223 DRI_CONF_ENUM(3,"Bypass MESA's pipeline with state-based code generation") \
224 DRI_CONF_DESC_END \
225 DRI_CONF_DESC_BEGIN(de,"TCL Modus (Transformation, Clipping, Licht)") \
226 DRI_CONF_ENUM(0,"Software") \
227 DRI_CONF_ENUM(1,"TCL Stufe in MESA Pipeline") \
228 DRI_CONF_ENUM(2,"Umgehe MESA's Pipeline") \
229 DRI_CONF_ENUM(3,"Umgehe MESA's Pipeline mit zustandsbasierter Codegenerierung") \
230 DRI_CONF_DESC_END \
231 DRI_CONF_OPT_END
232
233 #define DRI_CONF_FTHROTTLE_BUSY 0
234 #define DRI_CONF_FTHROTTLE_USLEEPS 1
235 #define DRI_CONF_FTHROTTLE_IRQS 2
236 #define DRI_CONF_FTHROTTLE_MODE(def) \
237 DRI_CONF_OPT_BEGIN_V(fthrottle_mode,enum,def,"0:2") \
238 DRI_CONF_DESC_BEGIN(en,"Frame throttling") \
239 DRI_CONF_ENUM(0,"Busy waiting") \
240 DRI_CONF_ENUM(1,"Usleeps") \
241 DRI_CONF_ENUM(2,"Software interrupts") \
242 DRI_CONF_DESC_END \
243 DRI_CONF_DESC_BEGIN(de,"Framethrottling") \
244 DRI_CONF_ENUM(0,"Aktives Warten") \
245 DRI_CONF_ENUM(1,"Usleeps") \
246 DRI_CONF_ENUM(2,"Sortware Interrutps") \
247 DRI_CONF_DESC_END \
248 DRI_CONF_OPT_END
249
250 #define DRI_CONF_VBLANK_NEVER 0
251 #define DRI_CONF_VBLANK_DEF_INTERVAL_0 1
252 #define DRI_CONF_VBLANK_DEF_INTERVAL_1 2
253 #define DRI_CONF_VBLANK_ALWAYS_SYNC 3
254 #define DRI_CONF_VBLANK_MODE(def) \
255 DRI_CONF_OPT_BEGIN_V(vblank_mode,enum,def,"0:3") \
256 DRI_CONF_DESC_BEGIN(en,"Synchronization with vertical refresh (swap intervals)") \
257 DRI_CONF_ENUM(0,"Never, FPS rulez!") \
258 DRI_CONF_ENUM(1,"Application preference, default interval 0") \
259 DRI_CONF_ENUM(2,"Application preference, default interval 1") \
260 DRI_CONF_ENUM(3,"Application preference, always synchronize with refresh") \
261 DRI_CONF_DESC_END \
262 DRI_CONF_DESC_BEGIN(de,"Synchronisation mit dem vertikalen Bildaufbau (swap intervals)") \
263 DRI_CONF_ENUM(0,"Niemals, immer die maximale Framerate") \
264 DRI_CONF_ENUM(1,"Anwendung entscheidet, Standardinterval 0") \
265 DRI_CONF_ENUM(2,"Anwendung entscheidet, Standardinterval 1") \
266 DRI_CONF_ENUM(3,"Anwendung entscheidet, immer mit Bildaufbau synchronisieren") \
267 DRI_CONF_DESC_END \
268 DRI_CONF_OPT_END
269
270 #endif