1 /*
2  * XML DRI client-side driver configuration
3  * Copyright (C) 2003 Felix Kuehling
4  *
5  * Permission is hereby granted, free of charge, to any person obtaining a
6  * copy of this software and associated documentation files (the "Software"),
7  * to deal in the Software without restriction, including without limitation
8  * the rights to use, copy, modify, merge, publish, distribute, sublicense,
9  * and/or sell copies of the Software, and to permit persons to whom the
10  * Software is furnished to do so, subject to the following conditions:
11  *
12  * The above copyright notice and this permission notice shall be included
13  * in all copies or substantial portions of the Software.
14  *
15  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
16  * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
18  * FELIX KUEHLING, OR ANY OTHER CONTRIBUTORS BE LIABLE FOR ANY CLAIM,
19  * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
20  * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE
21  * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
22  *
23  */
24 /**
25  * \file t_options.h
26  * \brief Templates of common options
27  * \author Felix Kuehling
28  *
29  * This file defines macros for common options that can be used to
30  * construct driConfigOptions in the drivers. This file is only a
31  * template containing English descriptions for options wrapped in
32  * gettext(). xgettext can be used to extract translatable
33  * strings. These strings can then be translated by anyone familiar
34  * with GNU gettext. gen_xmlpool.py takes this template and fills in
35  * all the translations. The result (options.h) is included by
36  * xmlpool.h which in turn can be included by drivers.
37  *
38  * The macros used to describe otions in this file are defined in
39  * ../xmlpool.h.
40  */
41 
42 /* This is needed for xgettext to extract translatable strings.
43  * gen_xmlpool.py will discard this line. */
44 #include <libintl.h>
45 
46 /*
47  * predefined option sections and options with multi-lingual descriptions
48  */
49 
50 /** \brief Debugging options */
51 #define DRI_CONF_SECTION_DEBUG \
52 DRI_CONF_SECTION_BEGIN \
53 	DRI_CONF_DESC(en,gettext("Debugging"))
54 
55 #define DRI_CONF_NO_RAST(def) \
56 DRI_CONF_OPT_BEGIN(no_rast,bool,def) \
57         DRI_CONF_DESC(en,gettext("Disable 3D acceleration")) \
58 DRI_CONF_OPT_END
59 
60 #define DRI_CONF_PERFORMANCE_BOXES(def) \
61 DRI_CONF_OPT_BEGIN(performance_boxes,bool,def) \
62         DRI_CONF_DESC(en,gettext("Show performance boxes")) \
63 DRI_CONF_OPT_END
64 
65 
66 /** \brief Texture-related options */
67 #define DRI_CONF_SECTION_QUALITY \
68 DRI_CONF_SECTION_BEGIN \
69 	DRI_CONF_DESC(en,gettext("Image Quality"))
70 
71 #define DRI_CONF_EXCESS_MIPMAP(def) \
72 DRI_CONF_OPT_BEGIN(excess_mipmap,bool,def) \
73 	DRI_CONF_DESC(en,"Enable extra mipmap level") \
74 DRI_CONF_OPT_END
75 
76 #define DRI_CONF_TEXTURE_DEPTH_FB       0
77 #define DRI_CONF_TEXTURE_DEPTH_32       1
78 #define DRI_CONF_TEXTURE_DEPTH_16       2
79 #define DRI_CONF_TEXTURE_DEPTH_FORCE_16 3
80 #define DRI_CONF_TEXTURE_DEPTH(def) \
81 DRI_CONF_OPT_BEGIN_V(texture_depth,enum,def,"0:3") \
82 	DRI_CONF_DESC_BEGIN(en,gettext("Texture color depth")) \
83                 DRI_CONF_ENUM(0,gettext("Prefer frame buffer color depth")) \
84                 DRI_CONF_ENUM(1,gettext("Prefer 32 bits per texel")) \
85                 DRI_CONF_ENUM(2,gettext("Prefer 16 bits per texel")) \
86                 DRI_CONF_ENUM(3,gettext("Force 16 bits per texel")) \
87         DRI_CONF_DESC_END \
88 DRI_CONF_OPT_END
89 
90 #define DRI_CONF_DEF_MAX_ANISOTROPY(def,range) \
91 DRI_CONF_OPT_BEGIN_V(def_max_anisotropy,float,def,range) \
92         DRI_CONF_DESC(en,gettext("Initial maximum value for anisotropic texture filtering")) \
93 DRI_CONF_OPT_END
94 
95 #define DRI_CONF_NO_NEG_LOD_BIAS(def) \
96 DRI_CONF_OPT_BEGIN(no_neg_lod_bias,bool,def) \
97         DRI_CONF_DESC(en,gettext("Forbid negative texture LOD bias")) \
98 DRI_CONF_OPT_END
99 
100 #define DRI_CONF_FORCE_S3TC_ENABLE(def) \
101 DRI_CONF_OPT_BEGIN(force_s3tc_enable,bool,def) \
102         DRI_CONF_DESC(en,gettext("Enable S3TC texture compression even if software support is not available")) \
103 DRI_CONF_OPT_END
104 
105 #define DRI_CONF_COLOR_REDUCTION_ROUND 0
106 #define DRI_CONF_COLOR_REDUCTION_DITHER 1
107 #define DRI_CONF_COLOR_REDUCTION(def) \
108 DRI_CONF_OPT_BEGIN_V(color_reduction,enum,def,"0:1") \
109         DRI_CONF_DESC_BEGIN(en,gettext("Initial color reduction method")) \
110                 DRI_CONF_ENUM(0,gettext("Round colors")) \
111                 DRI_CONF_ENUM(1,gettext("Dither colors")) \
112         DRI_CONF_DESC_END \
113 DRI_CONF_OPT_END
114 
115 #define DRI_CONF_ROUND_TRUNC 0
116 #define DRI_CONF_ROUND_ROUND 1
117 #define DRI_CONF_ROUND_MODE(def) \
118 DRI_CONF_OPT_BEGIN_V(round_mode,enum,def,"0:1") \
119 	DRI_CONF_DESC_BEGIN(en,gettext("Color rounding method")) \
120                 DRI_CONF_ENUM(0,gettext("Round color components downward")) \
121                 DRI_CONF_ENUM(1,gettext("Round to nearest color")) \
122         DRI_CONF_DESC_END \
123 DRI_CONF_OPT_END
124 
125 #define DRI_CONF_DITHER_XERRORDIFF 0
126 #define DRI_CONF_DITHER_XERRORDIFFRESET 1
127 #define DRI_CONF_DITHER_ORDERED 2
128 #define DRI_CONF_DITHER_MODE(def) \
129 DRI_CONF_OPT_BEGIN_V(dither_mode,enum,def,"0:2") \
130 	DRI_CONF_DESC_BEGIN(en,gettext("Color dithering method")) \
131                 DRI_CONF_ENUM(0,gettext("Horizontal error diffusion")) \
132                 DRI_CONF_ENUM(1,gettext("Horizontal error diffusion, reset error at line start")) \
133                 DRI_CONF_ENUM(2,gettext("Ordered 2D color dithering")) \
134         DRI_CONF_DESC_END \
135 DRI_CONF_OPT_END
136 
137 #define DRI_CONF_FLOAT_DEPTH(def) \
138 DRI_CONF_OPT_BEGIN(float_depth,bool,def) \
139         DRI_CONF_DESC(en,gettext("Floating point depth buffer")) \
140 DRI_CONF_OPT_END
141 
142 /** \brief Performance-related options */
143 #define DRI_CONF_SECTION_PERFORMANCE \
144 DRI_CONF_SECTION_BEGIN \
145         DRI_CONF_DESC(en,gettext("Performance"))
146 
147 #define DRI_CONF_TCL_SW 0
148 #define DRI_CONF_TCL_PIPELINED 1
149 #define DRI_CONF_TCL_VTXFMT 2
150 #define DRI_CONF_TCL_CODEGEN 3
151 #define DRI_CONF_TCL_MODE(def) \
152 DRI_CONF_OPT_BEGIN_V(tcl_mode,enum,def,"0:3") \
153         DRI_CONF_DESC_BEGIN(en,gettext("TCL mode (Transformation, Clipping, Lighting)")) \
154                 DRI_CONF_ENUM(0,gettext("Use software TCL pipeline")) \
155                 DRI_CONF_ENUM(1,gettext("Use hardware TCL as first TCL pipeline stage")) \
156                 DRI_CONF_ENUM(2,gettext("Bypass the TCL pipeline")) \
157                 DRI_CONF_ENUM(3,gettext("Bypass the TCL pipeline with state-based machine code generated on-the-fly")) \
158         DRI_CONF_DESC_END \
159 DRI_CONF_OPT_END
160 
161 #define DRI_CONF_FTHROTTLE_BUSY 0
162 #define DRI_CONF_FTHROTTLE_USLEEPS 1
163 #define DRI_CONF_FTHROTTLE_IRQS 2
164 #define DRI_CONF_FTHROTTLE_MODE(def) \
165 DRI_CONF_OPT_BEGIN_V(fthrottle_mode,enum,def,"0:2") \
166         DRI_CONF_DESC_BEGIN(en,gettext("Method to limit rendering latency")) \
167                 DRI_CONF_ENUM(0,gettext("Busy waiting for the graphics hardware")) \
168                 DRI_CONF_ENUM(1,gettext("Sleep for brief intervals while waiting for the graphics hardware")) \
169                 DRI_CONF_ENUM(2,gettext("Let the graphics hardware emit a software interrupt and sleep")) \
170         DRI_CONF_DESC_END \
171 DRI_CONF_OPT_END
172 
173 #define DRI_CONF_VBLANK_NEVER 0
174 #define DRI_CONF_VBLANK_DEF_INTERVAL_0 1
175 #define DRI_CONF_VBLANK_DEF_INTERVAL_1 2
176 #define DRI_CONF_VBLANK_ALWAYS_SYNC 3
177 #define DRI_CONF_VBLANK_MODE(def) \
178 DRI_CONF_OPT_BEGIN_V(vblank_mode,enum,def,"0:3") \
179         DRI_CONF_DESC_BEGIN(en,gettext("Synchronization with vertical refresh (swap intervals)")) \
180                 DRI_CONF_ENUM(0,gettext("Never synchronize with vertical refresh, ignore application's choice")) \
181                 DRI_CONF_ENUM(1,gettext("Initial swap interval 0, obey application's choice")) \
182                 DRI_CONF_ENUM(2,gettext("Initial swap interval 1, obey application's choice")) \
183                 DRI_CONF_ENUM(3,gettext("Always synchronize with vertical refresh, application chooses the minimum swap interval")) \
184         DRI_CONF_DESC_END \
185 DRI_CONF_OPT_END
186 
187 #define DRI_CONF_HYPERZ_DISABLED 0
188 #define DRI_CONF_HYPERZ_ENABLED 1
189 #define DRI_CONF_HYPERZ(def) \
190 DRI_CONF_OPT_BEGIN(hyperz,bool,def) \
191         DRI_CONF_DESC(en,gettext("Use HyperZ to boost performance")) \
192 DRI_CONF_OPT_END
193 
194 #define DRI_CONF_PP_CELSHADE(def) \
195 DRI_CONF_OPT_BEGIN_V(pp_celshade,enum,def,"0:1") \
196         DRI_CONF_DESC(en,gettext("A post-processing filter to cel-shade the output")) \
197 DRI_CONF_OPT_END
198 
199 #define DRI_CONF_PP_NORED(def) \
200 DRI_CONF_OPT_BEGIN_V(pp_nored,enum,def,"0:1") \
201         DRI_CONF_DESC(en,gettext("A post-processing filter to remove the red channel")) \
202 DRI_CONF_OPT_END
203 
204 #define DRI_CONF_PP_NOGREEN(def) \
205 DRI_CONF_OPT_BEGIN_V(pp_nogreen,enum,def,"0:1") \
206         DRI_CONF_DESC(en,gettext("A post-processing filter to remove the green channel")) \
207 DRI_CONF_OPT_END
208 
209 #define DRI_CONF_PP_NOBLUE(def) \
210 DRI_CONF_OPT_BEGIN_V(pp_noblue,enum,def,"0:1") \
211         DRI_CONF_DESC(en,gettext("A post-processing filter to remove the blue channel")) \
212 DRI_CONF_OPT_END
213 
214 #define DRI_CONF_PP_JIMENEZMLAA(def,min,max) \
215 DRI_CONF_OPT_BEGIN_V(pp_jimenezmlaa,int,def, # min ":" # max ) \
216         DRI_CONF_DESC(en,gettext("Morphological anti-aliasing based on Jimenez\\\' MLAA. 0 to disable, 8 for default quality")) \
217 DRI_CONF_OPT_END
218 
219 #define DRI_CONF_PP_JIMENEZMLAA_COLOR(def,min,max) \
220 DRI_CONF_OPT_BEGIN_V(pp_jimenezmlaa_color,int,def, # min ":" # max ) \
221         DRI_CONF_DESC(en,gettext("Morphological anti-aliasing based on Jimenez\\\' MLAA. 0 to disable, 8 for default quality. Color version, usable with 2d GL apps")) \
222 DRI_CONF_OPT_END
223 
224 #define DRI_CONF_MAX_TEXTURE_UNITS(def,min,max) \
225 DRI_CONF_OPT_BEGIN_V(texture_units,int,def, # min ":" # max ) \
226         DRI_CONF_DESC(en,gettext("Number of texture units used")) \
227 DRI_CONF_OPT_END
228 
229 #define DRI_CONF_ALLOW_LARGE_TEXTURES(def) \
230 DRI_CONF_OPT_BEGIN_V(allow_large_textures,enum,def,"0:2") \
231 	DRI_CONF_DESC_BEGIN(en,gettext("Support larger textures not guaranteed to fit into graphics memory")) \
232 		DRI_CONF_ENUM(0,gettext("No")) \
233 		DRI_CONF_ENUM(1,gettext("At least 1 texture must fit under worst-case assumptions")) \
234 		DRI_CONF_ENUM(2,gettext("Announce hardware limits")) \
235 	DRI_CONF_DESC_END \
236 DRI_CONF_OPT_END
237 
238 #define DRI_CONF_TEXTURE_BLEND_QUALITY(def,range) \
239 DRI_CONF_OPT_BEGIN_V(texture_blend_quality,float,def,range) \
240 	DRI_CONF_DESC(en,gettext("Texture filtering quality vs. speed, AKA “brilinear” texture filtering")) \
241 DRI_CONF_OPT_END
242 
243 #define DRI_CONF_TEXTURE_HEAPS_ALL 0
244 #define DRI_CONF_TEXTURE_HEAPS_CARD 1
245 #define DRI_CONF_TEXTURE_HEAPS_GART 2
246 #define DRI_CONF_TEXTURE_HEAPS(def) \
247 DRI_CONF_OPT_BEGIN_V(texture_heaps,enum,def,"0:2") \
248 	DRI_CONF_DESC_BEGIN(en,gettext("Used types of texture memory")) \
249 		DRI_CONF_ENUM(0,gettext("All available memory")) \
250 		DRI_CONF_ENUM(1,gettext("Only card memory (if available)")) \
251 		DRI_CONF_ENUM(2,gettext("Only GART (AGP/PCIE) memory (if available)")) \
252 	DRI_CONF_DESC_END \
253 DRI_CONF_OPT_END
254 
255 /* Options for features that are not done in hardware by the driver (like GL_ARB_vertex_program
256    On cards where there is no documentation (r200) or on rasterization-only hardware). */
257 #define DRI_CONF_SECTION_SOFTWARE \
258 DRI_CONF_SECTION_BEGIN \
259         DRI_CONF_DESC(en,gettext("Features that are not hardware-accelerated"))
260 
261 #define DRI_CONF_ARB_VERTEX_PROGRAM(def) \
262 DRI_CONF_OPT_BEGIN(arb_vertex_program,bool,def) \
263         DRI_CONF_DESC(en,gettext("Enable extension GL_ARB_vertex_program")) \
264 DRI_CONF_OPT_END
265 
266 #define DRI_CONF_NV_VERTEX_PROGRAM(def) \
267 DRI_CONF_OPT_BEGIN(nv_vertex_program,bool,def) \
268         DRI_CONF_DESC(en,gettext("Enable extension GL_NV_vertex_program")) \
269 DRI_CONF_OPT_END
270 
271 #define DRI_CONF_ALWAYS_FLUSH_BATCH(def) \
272 DRI_CONF_OPT_BEGIN(always_flush_batch,bool,def) \
273         DRI_CONF_DESC(en,gettext("Enable flushing batchbuffer after each draw call")) \
274 DRI_CONF_OPT_END
275 
276 #define DRI_CONF_ALWAYS_FLUSH_CACHE(def) \
277 DRI_CONF_OPT_BEGIN(always_flush_cache,bool,def) \
278         DRI_CONF_DESC(en,gettext("Enable flushing GPU caches with each draw call")) \
279 DRI_CONF_OPT_END
280