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
51/**
52 * \brief Debugging options
53 */
54#define DRI_CONF_SECTION_DEBUG \
55DRI_CONF_SECTION_BEGIN \
56	DRI_CONF_DESC(en,gettext("Debugging"))
57
58#define DRI_CONF_NO_RAST(def) \
59DRI_CONF_OPT_BEGIN_B(no_rast, def) \
60        DRI_CONF_DESC(en,gettext("Disable 3D acceleration")) \
61DRI_CONF_OPT_END
62
63#define DRI_CONF_PERFORMANCE_BOXES(def) \
64DRI_CONF_OPT_BEGIN_B(performance_boxes, def) \
65        DRI_CONF_DESC(en,gettext("Show performance boxes")) \
66DRI_CONF_OPT_END
67
68#define DRI_CONF_ALWAYS_FLUSH_BATCH(def) \
69DRI_CONF_OPT_BEGIN_B(always_flush_batch, def) \
70        DRI_CONF_DESC(en,gettext("Enable flushing batchbuffer after each draw call")) \
71DRI_CONF_OPT_END
72
73#define DRI_CONF_ALWAYS_FLUSH_CACHE(def) \
74DRI_CONF_OPT_BEGIN_B(always_flush_cache, def) \
75        DRI_CONF_DESC(en,gettext("Enable flushing GPU caches with each draw call")) \
76DRI_CONF_OPT_END
77
78#define DRI_CONF_DISABLE_THROTTLING(def) \
79DRI_CONF_OPT_BEGIN_B(disable_throttling, def) \
80	DRI_CONF_DESC(en,gettext("Disable throttling on first batch after flush")) \
81DRI_CONF_OPT_END
82
83#define DRI_CONF_FORCE_GLSL_EXTENSIONS_WARN(def) \
84DRI_CONF_OPT_BEGIN_B(force_glsl_extensions_warn, def) \
85        DRI_CONF_DESC(en,gettext("Force GLSL extension default behavior to 'warn'")) \
86DRI_CONF_OPT_END
87
88#define DRI_CONF_DISABLE_BLEND_FUNC_EXTENDED(def) \
89DRI_CONF_OPT_BEGIN_B(disable_blend_func_extended, def) \
90        DRI_CONF_DESC(en,gettext("Disable dual source blending")) \
91DRI_CONF_OPT_END
92
93#define DRI_CONF_DUAL_COLOR_BLEND_BY_LOCATION(def) \
94DRI_CONF_OPT_BEGIN_B(dual_color_blend_by_location, def) \
95        DRI_CONF_DESC(en,gettext("Identify dual color blending sources by location rather than index")) \
96DRI_CONF_OPT_END
97
98#define DRI_CONF_DISABLE_GLSL_LINE_CONTINUATIONS(def) \
99DRI_CONF_OPT_BEGIN_B(disable_glsl_line_continuations, def) \
100        DRI_CONF_DESC(en,gettext("Disable backslash-based line continuations in GLSL source")) \
101DRI_CONF_OPT_END
102
103#define DRI_CONF_DISABLE_SHADER_BIT_ENCODING(def) \
104DRI_CONF_OPT_BEGIN_B(disable_shader_bit_encoding, def) \
105        DRI_CONF_DESC(en,gettext("Disable GL_ARB_shader_bit_encoding")) \
106DRI_CONF_OPT_END
107
108#define DRI_CONF_FORCE_GLSL_VERSION(def) \
109DRI_CONF_OPT_BEGIN_V(force_glsl_version, int, def, "0:999") \
110        DRI_CONF_DESC(en,gettext("Force a default GLSL version for shaders that lack an explicit #version line")) \
111DRI_CONF_OPT_END
112
113#define DRI_CONF_ALLOW_GLSL_EXTENSION_DIRECTIVE_MIDSHADER(def) \
114DRI_CONF_OPT_BEGIN_B(allow_glsl_extension_directive_midshader, def) \
115        DRI_CONF_DESC(en,gettext("Allow GLSL #extension directives in the middle of shaders")) \
116DRI_CONF_OPT_END
117
118
119
120/**
121 * \brief Image quality-related options
122 */
123#define DRI_CONF_SECTION_QUALITY \
124DRI_CONF_SECTION_BEGIN \
125	DRI_CONF_DESC(en,gettext("Image Quality"))
126
127#define DRI_CONF_EXCESS_MIPMAP(def) \
128DRI_CONF_OPT_BEGIN_B(excess_mipmap, def) \
129	DRI_CONF_DESC(en,"Enable extra mipmap level") \
130DRI_CONF_OPT_END
131
132#define DRI_CONF_TEXTURE_DEPTH_FB       0
133#define DRI_CONF_TEXTURE_DEPTH_32       1
134#define DRI_CONF_TEXTURE_DEPTH_16       2
135#define DRI_CONF_TEXTURE_DEPTH_FORCE_16 3
136#define DRI_CONF_TEXTURE_DEPTH(def) \
137DRI_CONF_OPT_BEGIN_V(texture_depth,enum,def,"0:3") \
138	DRI_CONF_DESC_BEGIN(en,gettext("Texture color depth")) \
139                DRI_CONF_ENUM(0,gettext("Prefer frame buffer color depth")) \
140                DRI_CONF_ENUM(1,gettext("Prefer 32 bits per texel")) \
141                DRI_CONF_ENUM(2,gettext("Prefer 16 bits per texel")) \
142                DRI_CONF_ENUM(3,gettext("Force 16 bits per texel")) \
143        DRI_CONF_DESC_END \
144DRI_CONF_OPT_END
145
146#define DRI_CONF_DEF_MAX_ANISOTROPY(def,range) \
147DRI_CONF_OPT_BEGIN_V(def_max_anisotropy,float,def,range) \
148        DRI_CONF_DESC(en,gettext("Initial maximum value for anisotropic texture filtering")) \
149DRI_CONF_OPT_END
150
151#define DRI_CONF_NO_NEG_LOD_BIAS(def) \
152DRI_CONF_OPT_BEGIN_B(no_neg_lod_bias, def) \
153        DRI_CONF_DESC(en,gettext("Forbid negative texture LOD bias")) \
154DRI_CONF_OPT_END
155
156#define DRI_CONF_FORCE_S3TC_ENABLE(def) \
157DRI_CONF_OPT_BEGIN_B(force_s3tc_enable, def) \
158        DRI_CONF_DESC(en,gettext("Enable S3TC texture compression even if software support is not available")) \
159DRI_CONF_OPT_END
160
161#define DRI_CONF_PRECISE_TRIG(def) \
162DRI_CONF_OPT_BEGIN_B(precise_trig, def) \
163        DRI_CONF_DESC(en,gettext("Prefer accuracy over performance in trig functions")) \
164DRI_CONF_OPT_END
165
166#define DRI_CONF_COLOR_REDUCTION_ROUND 0
167#define DRI_CONF_COLOR_REDUCTION_DITHER 1
168#define DRI_CONF_COLOR_REDUCTION(def) \
169DRI_CONF_OPT_BEGIN_V(color_reduction,enum,def,"0:1") \
170        DRI_CONF_DESC_BEGIN(en,gettext("Initial color reduction method")) \
171                DRI_CONF_ENUM(0,gettext("Round colors")) \
172                DRI_CONF_ENUM(1,gettext("Dither colors")) \
173        DRI_CONF_DESC_END \
174DRI_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) \
179DRI_CONF_OPT_BEGIN_V(round_mode,enum,def,"0:1") \
180	DRI_CONF_DESC_BEGIN(en,gettext("Color rounding method")) \
181                DRI_CONF_ENUM(0,gettext("Round color components downward")) \
182                DRI_CONF_ENUM(1,gettext("Round to nearest color")) \
183        DRI_CONF_DESC_END \
184DRI_CONF_OPT_END
185
186#define DRI_CONF_DITHER_XERRORDIFF 0
187#define DRI_CONF_DITHER_XERRORDIFFRESET 1
188#define DRI_CONF_DITHER_ORDERED 2
189#define DRI_CONF_DITHER_MODE(def) \
190DRI_CONF_OPT_BEGIN_V(dither_mode,enum,def,"0:2") \
191	DRI_CONF_DESC_BEGIN(en,gettext("Color dithering method")) \
192                DRI_CONF_ENUM(0,gettext("Horizontal error diffusion")) \
193                DRI_CONF_ENUM(1,gettext("Horizontal error diffusion, reset error at line start")) \
194                DRI_CONF_ENUM(2,gettext("Ordered 2D color dithering")) \
195        DRI_CONF_DESC_END \
196DRI_CONF_OPT_END
197
198#define DRI_CONF_FLOAT_DEPTH(def) \
199DRI_CONF_OPT_BEGIN_B(float_depth, def) \
200        DRI_CONF_DESC(en,gettext("Floating point depth buffer")) \
201DRI_CONF_OPT_END
202
203#define DRI_CONF_PP_CELSHADE(def) \
204DRI_CONF_OPT_BEGIN_V(pp_celshade,enum,def,"0:1") \
205        DRI_CONF_DESC(en,gettext("A post-processing filter to cel-shade the output")) \
206DRI_CONF_OPT_END
207
208#define DRI_CONF_PP_NORED(def) \
209DRI_CONF_OPT_BEGIN_V(pp_nored,enum,def,"0:1") \
210        DRI_CONF_DESC(en,gettext("A post-processing filter to remove the red channel")) \
211DRI_CONF_OPT_END
212
213#define DRI_CONF_PP_NOGREEN(def) \
214DRI_CONF_OPT_BEGIN_V(pp_nogreen,enum,def,"0:1") \
215        DRI_CONF_DESC(en,gettext("A post-processing filter to remove the green channel")) \
216DRI_CONF_OPT_END
217
218#define DRI_CONF_PP_NOBLUE(def) \
219DRI_CONF_OPT_BEGIN_V(pp_noblue,enum,def,"0:1") \
220        DRI_CONF_DESC(en,gettext("A post-processing filter to remove the blue channel")) \
221DRI_CONF_OPT_END
222
223#define DRI_CONF_PP_JIMENEZMLAA(def,min,max) \
224DRI_CONF_OPT_BEGIN_V(pp_jimenezmlaa,int,def, # min ":" # max ) \
225        DRI_CONF_DESC(en,gettext("Morphological anti-aliasing based on Jimenez\\\' MLAA. 0 to disable, 8 for default quality")) \
226DRI_CONF_OPT_END
227
228#define DRI_CONF_PP_JIMENEZMLAA_COLOR(def,min,max) \
229DRI_CONF_OPT_BEGIN_V(pp_jimenezmlaa_color,int,def, # min ":" # max ) \
230        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")) \
231DRI_CONF_OPT_END
232
233
234
235/**
236 * \brief Performance-related options
237 */
238#define DRI_CONF_SECTION_PERFORMANCE \
239DRI_CONF_SECTION_BEGIN \
240        DRI_CONF_DESC(en,gettext("Performance"))
241
242#define DRI_CONF_TCL_SW 0
243#define DRI_CONF_TCL_PIPELINED 1
244#define DRI_CONF_TCL_VTXFMT 2
245#define DRI_CONF_TCL_CODEGEN 3
246#define DRI_CONF_TCL_MODE(def) \
247DRI_CONF_OPT_BEGIN_V(tcl_mode,enum,def,"0:3") \
248        DRI_CONF_DESC_BEGIN(en,gettext("TCL mode (Transformation, Clipping, Lighting)")) \
249                DRI_CONF_ENUM(0,gettext("Use software TCL pipeline")) \
250                DRI_CONF_ENUM(1,gettext("Use hardware TCL as first TCL pipeline stage")) \
251                DRI_CONF_ENUM(2,gettext("Bypass the TCL pipeline")) \
252                DRI_CONF_ENUM(3,gettext("Bypass the TCL pipeline with state-based machine code generated on-the-fly")) \
253        DRI_CONF_DESC_END \
254DRI_CONF_OPT_END
255
256#define DRI_CONF_FTHROTTLE_BUSY 0
257#define DRI_CONF_FTHROTTLE_USLEEPS 1
258#define DRI_CONF_FTHROTTLE_IRQS 2
259#define DRI_CONF_FTHROTTLE_MODE(def) \
260DRI_CONF_OPT_BEGIN_V(fthrottle_mode,enum,def,"0:2") \
261        DRI_CONF_DESC_BEGIN(en,gettext("Method to limit rendering latency")) \
262                DRI_CONF_ENUM(0,gettext("Busy waiting for the graphics hardware")) \
263                DRI_CONF_ENUM(1,gettext("Sleep for brief intervals while waiting for the graphics hardware")) \
264                DRI_CONF_ENUM(2,gettext("Let the graphics hardware emit a software interrupt and sleep")) \
265        DRI_CONF_DESC_END \
266DRI_CONF_OPT_END
267
268#define DRI_CONF_VBLANK_NEVER 0
269#define DRI_CONF_VBLANK_DEF_INTERVAL_0 1
270#define DRI_CONF_VBLANK_DEF_INTERVAL_1 2
271#define DRI_CONF_VBLANK_ALWAYS_SYNC 3
272#define DRI_CONF_VBLANK_MODE(def) \
273DRI_CONF_OPT_BEGIN_V(vblank_mode,enum,def,"0:3") \
274        DRI_CONF_DESC_BEGIN(en,gettext("Synchronization with vertical refresh (swap intervals)")) \
275                DRI_CONF_ENUM(0,gettext("Never synchronize with vertical refresh, ignore application's choice")) \
276                DRI_CONF_ENUM(1,gettext("Initial swap interval 0, obey application's choice")) \
277                DRI_CONF_ENUM(2,gettext("Initial swap interval 1, obey application's choice")) \
278                DRI_CONF_ENUM(3,gettext("Always synchronize with vertical refresh, application chooses the minimum swap interval")) \
279        DRI_CONF_DESC_END \
280DRI_CONF_OPT_END
281
282#define DRI_CONF_HYPERZ_DISABLED 0
283#define DRI_CONF_HYPERZ_ENABLED 1
284#define DRI_CONF_HYPERZ(def) \
285DRI_CONF_OPT_BEGIN_B(hyperz, def) \
286        DRI_CONF_DESC(en,gettext("Use HyperZ to boost performance")) \
287DRI_CONF_OPT_END
288
289#define DRI_CONF_MAX_TEXTURE_UNITS(def,min,max) \
290DRI_CONF_OPT_BEGIN_V(texture_units,int,def, # min ":" # max ) \
291        DRI_CONF_DESC(en,gettext("Number of texture units used")) \
292DRI_CONF_OPT_END
293
294#define DRI_CONF_TEXTURE_BLEND_QUALITY(def,range) \
295DRI_CONF_OPT_BEGIN_V(texture_blend_quality,float,def,range) \
296	DRI_CONF_DESC(en,gettext("Texture filtering quality vs. speed, AKA “brilinear” texture filtering")) \
297DRI_CONF_OPT_END
298
299#define DRI_CONF_TEXTURE_HEAPS_ALL 0
300#define DRI_CONF_TEXTURE_HEAPS_CARD 1
301#define DRI_CONF_TEXTURE_HEAPS_GART 2
302#define DRI_CONF_TEXTURE_HEAPS(def) \
303DRI_CONF_OPT_BEGIN_V(texture_heaps,enum,def,"0:2") \
304	DRI_CONF_DESC_BEGIN(en,gettext("Used types of texture memory")) \
305		DRI_CONF_ENUM(0,gettext("All available memory")) \
306		DRI_CONF_ENUM(1,gettext("Only card memory (if available)")) \
307		DRI_CONF_ENUM(2,gettext("Only GART (AGP/PCIE) memory (if available)")) \
308	DRI_CONF_DESC_END \
309DRI_CONF_OPT_END
310
311
312
313/**
314 * \brief Software-fallback options.  To allow using features (like
315 * GL_ARB_vertex_program) on GPUs that don't otherwise support the feature.
316 */
317#define DRI_CONF_SECTION_SOFTWARE \
318DRI_CONF_SECTION_BEGIN \
319        DRI_CONF_DESC(en,gettext("Features that are not hardware-accelerated"))
320
321#define DRI_CONF_ARB_VERTEX_PROGRAM(def) \
322DRI_CONF_OPT_BEGIN_B(arb_vertex_program, def) \
323        DRI_CONF_DESC(en,gettext("Enable extension GL_ARB_vertex_program")) \
324DRI_CONF_OPT_END
325
326
327
328/**
329 * \brief Miscellaneous configuration options
330 */
331#define DRI_CONF_SECTION_MISCELLANEOUS \
332DRI_CONF_SECTION_BEGIN \
333        DRI_CONF_DESC(en,gettext("Miscellaneous"))
334
335#define DRI_CONF_ALWAYS_HAVE_DEPTH_BUFFER(def) \
336DRI_CONF_OPT_BEGIN_B(always_have_depth_buffer, def) \
337        DRI_CONF_DESC(en,gettext("Create all visuals with a depth buffer")) \
338DRI_CONF_OPT_END
339
340#define DRI_CONF_GLSL_ZERO_INIT(def) \
341DRI_CONF_OPT_BEGIN_B(glsl_zero_init, def) \
342        DRI_CONF_DESC(en,gettext("Force uninitialized variables to default to zero")) \
343DRI_CONF_OPT_END
344
345/**
346 * \brief Initialization configuration options
347 */
348#define DRI_CONF_SECTION_INITIALIZATION \
349DRI_CONF_SECTION_BEGIN \
350        DRI_CONF_DESC(en,gettext("Initialization"))
351
352#define DRI_CONF_DEVICE_ID_PATH_TAG(def) \
353DRI_CONF_OPT_BEGIN(device_id, string, def) \
354        DRI_CONF_DESC(en,gettext("Define the graphic device to use if possible")) \
355DRI_CONF_OPT_END
356
357/**
358 * \brief Gallium-Nine specific configuration options
359 */
360
361#define DRI_CONF_SECTION_NINE \
362DRI_CONF_SECTION_BEGIN \
363        DRI_CONF_DESC(en,gettext("Gallium Nine"))
364
365#define DRI_CONF_NINE_THROTTLE(def) \
366DRI_CONF_OPT_BEGIN(throttle_value, int, def) \
367        DRI_CONF_DESC(en,gettext("Define the throttling value. -1 for no throttling, -2 for default (usually 2), 0 for glfinish behaviour")) \
368DRI_CONF_OPT_END
369
370#define DRI_CONF_NINE_THREADSUBMIT(def) \
371DRI_CONF_OPT_BEGIN_B(thread_submit, def) \
372        DRI_CONF_DESC(en,gettext("Use an additional thread to submit buffers.")) \
373DRI_CONF_OPT_END
374
375#define DRI_CONF_NINE_OVERRIDEVENDOR(def) \
376DRI_CONF_OPT_BEGIN(override_vendorid, int, def) \
377        DRI_CONF_DESC(en,gettext("Define the vendor_id to report. This allows faking another hardware vendor.")) \
378DRI_CONF_OPT_END
379
380#define DRI_CONF_NINE_ALLOWDISCARDDELAYEDRELEASE(def) \
381DRI_CONF_OPT_BEGIN_B(discard_delayed_release, def) \
382        DRI_CONF_DESC(en,gettext("Whether to allow the display server to release buffers with a delay when using d3d's presentation mode DISCARD. Default to true. Set to false if suffering from lag (thread_submit=true can also help in this situation).")) \
383DRI_CONF_OPT_END
384
385#define DRI_CONF_NINE_TEARFREEDISCARD(def) \
386DRI_CONF_OPT_BEGIN_B(tearfree_discard, def) \
387        DRI_CONF_DESC(en,gettext("Whether to make d3d's presentation mode DISCARD (games usually use that mode) Tear Free. If rendering above screen refresh, some frames will get skipped. false by default.")) \
388DRI_CONF_OPT_END
389
390#define DRI_CONF_NINE_CSMT(def) \
391DRI_CONF_OPT_BEGIN(csmt_force, int, def) \
392        DRI_CONF_DESC(en,gettext("If set to 1, force gallium nine CSMT. If set to 0, disable it. By default (-1) CSMT is enabled on known thread-safe drivers.")) \
393DRI_CONF_OPT_END
394