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 driconf.h
26  * \brief Pool of common options
27  * \author Felix Kuehling
28  *
29  * This file defines macros that can be used to construct
30  * driConfigOptions in the drivers.
31  */
32 
33 #ifndef __DRICONF_H
34 #define __DRICONF_H
35 
36 #include "xmlconfig.h"
37 
38 /*
39  * generic macros
40  */
41 
42 /** \brief Names a section of related options to follow */
43 #define DRI_CONF_SECTION(text) { .desc = text, .info = { .type = DRI_SECTION } },
44 #define DRI_CONF_SECTION_END
45 
46 /** \brief End an option description */
47 #define DRI_CONF_OPT_END },
48 
49 /** \brief A verbal description (empty version) */
50 #define DRI_CONF_DESC(text) .desc = text,
51 
52 /** \brief A verbal description of an enum value */
53 #define DRI_CONF_ENUM(_value,text) { .value = _value, .desc = text },
54 
55 #define DRI_CONF_RANGE_I(min, max)              \
56       .range = {                                \
57          .start = { ._int = min },              \
58          .end = { ._int = max },                \
59       }                                         \
60 
61 #define DRI_CONF_RANGE_F(min, max)              \
62       .range = {                                \
63          .start = { ._float = min },            \
64          .end = { ._float = max },              \
65       }                                         \
66 
67 /**
68  * \brief A boolean option definition, with the default value passed in as a
69  * string
70  */
71 
72 #define DRI_CONF_OPT_B(_name, def, _desc) {                     \
73       .desc = _desc,                                            \
74       .info = {                                                 \
75          .name = #_name,                                        \
76          .type = DRI_BOOL,                                      \
77       },                                                        \
78       .value = { ._bool = def },                                \
79    },
80 
81 #define DRI_CONF_OPT_I(_name, def, min, max, _desc) {           \
82       .desc = _desc,                                            \
83       .info = {                                                 \
84          .name = #_name,                                        \
85          .type = DRI_INT,                                       \
86          DRI_CONF_RANGE_I(min, max),                            \
87       },                                                        \
88       .value = { ._int = def },                                 \
89    },
90 
91 #define DRI_CONF_OPT_F(_name, def, min, max, _desc) {           \
92       .desc = _desc,                                            \
93       .info = {                                                 \
94          .name = #_name,                                        \
95          .type = DRI_FLOAT,                                     \
96          DRI_CONF_RANGE_F(min, max),                            \
97       },                                                        \
98       .value = { ._float = def },                               \
99    },
100 
101 #define DRI_CONF_OPT_E(_name, def, min, max, _desc, values) {   \
102       .desc = _desc,                                            \
103       .info = {                                                 \
104          .name = #_name,                                        \
105          .type = DRI_ENUM,                                      \
106          DRI_CONF_RANGE_I(min, max),                            \
107       },                                                        \
108       .value = { ._int = def },                                 \
109       .enums = { values },                                      \
110    },
111 
112 #define DRI_CONF_OPT_S(_name, def, _desc) {                     \
113       .desc = _desc,                                            \
114       .info = {                                                 \
115          .name = #_name,                                        \
116          .type = DRI_STRING,                                    \
117       },                                                        \
118       .value = { ._string = #def },                             \
119    },
120 
121 #define DRI_CONF_OPT_S_NODEF(_name, _desc) {                    \
122       .desc = _desc,                                            \
123       .info = {                                                 \
124          .name = #_name,                                        \
125          .type = DRI_STRING,                                    \
126       },                                                        \
127       .value = { ._string = "" },                               \
128    },
129 
130 /**
131  * \brief Debugging options
132  */
133 #define DRI_CONF_SECTION_DEBUG DRI_CONF_SECTION("Debugging")
134 
135 #define DRI_CONF_ALWAYS_FLUSH_BATCH(def) \
136    DRI_CONF_OPT_B(always_flush_batch, def,                              \
137                   "Enable flushing batchbuffer after each draw call")
138 
139 #define DRI_CONF_ALWAYS_FLUSH_CACHE(def) \
140    DRI_CONF_OPT_B(always_flush_cache, def, \
141                   "Enable flushing GPU caches with each draw call")
142 
143 #define DRI_CONF_DISABLE_THROTTLING(def) \
144    DRI_CONF_OPT_B(disable_throttling, def, \
145                   "Disable throttling on first batch after flush")
146 
147 #define DRI_CONF_FORCE_GLSL_EXTENSIONS_WARN(def) \
148    DRI_CONF_OPT_B(force_glsl_extensions_warn, def, \
149                   "Force GLSL extension default behavior to 'warn'")
150 
151 #define DRI_CONF_DISABLE_BLEND_FUNC_EXTENDED(def) \
152    DRI_CONF_OPT_B(disable_blend_func_extended, def, \
153                   "Disable dual source blending")
154 
155 #define DRI_CONF_DISABLE_ARB_GPU_SHADER5(def) \
156    DRI_CONF_OPT_B(disable_arb_gpu_shader5, def, \
157                   "Disable GL_ARB_gpu_shader5")
158 
159 #define DRI_CONF_DUAL_COLOR_BLEND_BY_LOCATION(def) \
160    DRI_CONF_OPT_B(dual_color_blend_by_location, def, \
161                   "Identify dual color blending sources by location rather than index")
162 
163 #define DRI_CONF_DISABLE_GLSL_LINE_CONTINUATIONS(def) \
164    DRI_CONF_OPT_B(disable_glsl_line_continuations, def, \
165                   "Disable backslash-based line continuations in GLSL source")
166 
167 #define DRI_CONF_FORCE_GLSL_VERSION(def) \
168    DRI_CONF_OPT_I(force_glsl_version, def, 0, 999, \
169                   "Force a default GLSL version for shaders that lack an explicit #version line")
170 
171 #define DRI_CONF_ALLOW_EXTRA_PP_TOKENS(def) \
172    DRI_CONF_OPT_B(allow_extra_pp_tokens, def, \
173                   "Allow extra tokens at end of preprocessor directives.")
174 
175 #define DRI_CONF_ALLOW_GLSL_EXTENSION_DIRECTIVE_MIDSHADER(def) \
176    DRI_CONF_OPT_B(allow_glsl_extension_directive_midshader, def, \
177                   "Allow GLSL #extension directives in the middle of shaders")
178 
179 #define DRI_CONF_ALLOW_GLSL_120_SUBSET_IN_110(def) \
180    DRI_CONF_OPT_B(allow_glsl_120_subset_in_110, def, \
181                   "Allow a subset of GLSL 1.20 in GLSL 1.10 as needed by SPECviewperf13")
182 
183 #define DRI_CONF_ALLOW_GLSL_BUILTIN_CONST_EXPRESSION(def) \
184    DRI_CONF_OPT_B(allow_glsl_builtin_const_expression, def, \
185                   "Allow builtins as part of constant expressions")
186 
187 #define DRI_CONF_ALLOW_GLSL_RELAXED_ES(def) \
188    DRI_CONF_OPT_B(allow_glsl_relaxed_es, def, \
189                   "Allow some relaxation of GLSL ES shader restrictions")
190 
191 #define DRI_CONF_ALLOW_GLSL_BUILTIN_VARIABLE_REDECLARATION(def) \
192    DRI_CONF_OPT_B(allow_glsl_builtin_variable_redeclaration, def, \
193                   "Allow GLSL built-in variables to be redeclared verbatim")
194 
195 #define DRI_CONF_ALLOW_HIGHER_COMPAT_VERSION(def) \
196    DRI_CONF_OPT_B(allow_higher_compat_version, def, \
197                   "Allow a higher compat profile (version 3.1+) for apps that request it")
198 
199 #define DRI_CONF_ALLOW_GLSL_COMPAT_SHADERS(def) \
200    DRI_CONF_OPT_B(allow_glsl_compat_shaders, def, \
201                   "Allow in GLSL: #version xxx compatibility")
202 
203 #define DRI_CONF_FORCE_GLSL_ABS_SQRT(def) \
204    DRI_CONF_OPT_B(force_glsl_abs_sqrt, def,                             \
205                   "Force computing the absolute value for sqrt() and inversesqrt()")
206 
207 #define DRI_CONF_GLSL_CORRECT_DERIVATIVES_AFTER_DISCARD(def) \
208    DRI_CONF_OPT_B(glsl_correct_derivatives_after_discard, def, \
209                   "Implicit and explicit derivatives after a discard behave as if the discard didn't happen")
210 
211 #define DRI_CONF_GLSL_IGNORE_WRITE_TO_READONLY_VAR(def) \
212    DRI_CONF_OPT_B(glsl_ignore_write_to_readonly_var, def, \
213                   "Forces the GLSL compiler to ignore writes to readonly vars rather than throwing an error")
214 
215 #define DRI_CONF_ALLOW_GLSL_CROSS_STAGE_INTERPOLATION_MISMATCH(def) \
216    DRI_CONF_OPT_B(allow_glsl_cross_stage_interpolation_mismatch, def,   \
217                   "Allow interpolation qualifier mismatch across shader stages")
218 
219 #define DRI_CONF_DO_DCE_BEFORE_CLIP_CULL_ANALYSIS(def) \
220    DRI_CONF_OPT_B(do_dce_before_clip_cull_analysis, def,   \
221                   "Use dead code elimitation before checking for invalid Clip*/CullDistance variables usage.")
222 
223 #define DRI_CONF_ALLOW_DRAW_OUT_OF_ORDER(def) \
224    DRI_CONF_OPT_B(allow_draw_out_of_order, def, \
225                   "Allow out-of-order draw optimizations. Set when Z fighting doesn't have to be accurate.")
226 
227 #define DRI_CONF_GLTHREAD_NOP_CHECK_FRAMEBUFFER_STATUS(def) \
228    DRI_CONF_OPT_B(glthread_nop_check_framebuffer_status, def, \
229                   "glthread always returns GL_FRAMEBUFFER_COMPLETE to prevent synchronization.")
230 
231 #define DRI_CONF_FORCE_GL_VENDOR() \
232    DRI_CONF_OPT_S_NODEF(force_gl_vendor, "Override GPU vendor string.")
233 
234 #define DRI_CONF_FORCE_GL_RENDERER() \
235    DRI_CONF_OPT_S_NODEF(force_gl_renderer, "Override GPU renderer string.")
236 
237 #define DRI_CONF_FORCE_COMPAT_PROFILE(def) \
238    DRI_CONF_OPT_B(force_compat_profile, def, \
239                   "Force an OpenGL compatibility context")
240 
241 #define DRI_CONF_FORCE_COMPAT_SHADERS(def) \
242    DRI_CONF_OPT_B(force_compat_shaders, def, \
243                   "Force OpenGL compatibility shaders")
244 
245 #define DRI_CONF_FORCE_DIRECT_GLX_CONTEXT(def) \
246    DRI_CONF_OPT_B(force_direct_glx_context, def, \
247                   "Force direct GLX context (even if indirect is requested)")
248 
249 #define DRI_CONF_ALLOW_INVALID_GLX_DESTROY_WINDOW(def) \
250    DRI_CONF_OPT_B(allow_invalid_glx_destroy_window, def, \
251                   "Allow passing an invalid window into glXDestroyWindow")
252 
253 #define DRI_CONF_KEEP_NATIVE_WINDOW_GLX_DRAWABLE(def) \
254    DRI_CONF_OPT_B(keep_native_window_glx_drawable, def, \
255                   "Keep GLX drawable created from native window when switch context")
256 
257 #define DRI_CONF_OVERRIDE_VRAM_SIZE() \
258    DRI_CONF_OPT_I(override_vram_size, -1, -1, 2147483647, \
259                   "Override the VRAM size advertised to the application in MiB (-1 = default)")
260 
261 #define DRI_CONF_FORCE_GL_NAMES_REUSE(def) \
262    DRI_CONF_OPT_B(force_gl_names_reuse, def, "Force GL names reuse")
263 
264 #define DRI_CONF_TRANSCODE_ETC(def) \
265    DRI_CONF_OPT_B(transcode_etc, def, "Transcode ETC formats to DXTC if unsupported")
266 
267 #define DRI_CONF_TRANSCODE_ASTC(def) \
268    DRI_CONF_OPT_B(transcode_astc, def, "Transcode ASTC formats to DXTC if unsupported")
269 
270 #define DRI_CONF_MESA_EXTENSION_OVERRIDE() \
271    DRI_CONF_OPT_S_NODEF(mesa_extension_override, \
272                   "Allow enabling/disabling a list of extensions")
273 
274 #define DRI_CONF_GLX_EXTENSION_OVERRIDE() \
275    DRI_CONF_OPT_S_NODEF(glx_extension_override, \
276                   "Allow enabling/disabling a list of GLX extensions")
277 
278 #define DRI_CONF_INDIRECT_GL_EXTENSION_OVERRIDE() \
279    DRI_CONF_OPT_S_NODEF(indirect_gl_extension_override, \
280                   "Allow enabling/disabling a list of indirect-GL extensions")
281 
282 #define DRI_CONF_DISABLE_PROTECTED_CONTENT_CHECK(def) \
283    DRI_CONF_OPT_B(disable_protected_content_check, def, \
284                   "Don't reject image import if protected_content attribute doesn't match")
285 
286 #define DRI_CONF_IGNORE_MAP_UNSYNCHRONIZED(def) \
287    DRI_CONF_OPT_B(ignore_map_unsynchronized, def, \
288                   "Ignore GL_MAP_UNSYNCHRONIZED_BIT, workaround for games that use it incorrectly")
289 
290 #define DRI_CONF_VK_DONT_CARE_AS_LOAD(def) \
291    DRI_CONF_OPT_B(vk_dont_care_as_load, def, \
292                   "Treat VK_ATTACHMENT_LOAD_OP_DONT_CARE as LOAD_OP_LOAD, workaround on tiler GPUs for games that confuse these two load ops")
293 
294 /**
295  * \brief Image quality-related options
296  */
297 #define DRI_CONF_SECTION_QUALITY DRI_CONF_SECTION("Image Quality")
298 
299 #define DRI_CONF_PRECISE_TRIG(def) \
300    DRI_CONF_OPT_B(precise_trig, def, \
301                   "Prefer accuracy over performance in trig functions")
302 
303 #define DRI_CONF_PP_CELSHADE(def) \
304    DRI_CONF_OPT_E(pp_celshade, def, 0, 1, \
305                   "A post-processing filter to cel-shade the output", \
306                   { 0 } )
307 
308 #define DRI_CONF_PP_NORED(def) \
309    DRI_CONF_OPT_E(pp_nored, def, 0, 1, \
310                   "A post-processing filter to remove the red channel", \
311                   { 0 } )
312 
313 #define DRI_CONF_PP_NOGREEN(def) \
314    DRI_CONF_OPT_E(pp_nogreen, def, 0, 1, \
315                   "A post-processing filter to remove the green channel", \
316                   { 0 } )
317 
318 #define DRI_CONF_PP_NOBLUE(def) \
319    DRI_CONF_OPT_E(pp_noblue, def, 0, 1, \
320                   "A post-processing filter to remove the blue channel", \
321                   { 0 } )
322 
323 #define DRI_CONF_PP_JIMENEZMLAA(def,min,max) \
324    DRI_CONF_OPT_I(pp_jimenezmlaa, def, min, max, \
325                   "Morphological anti-aliasing based on Jimenez' MLAA. 0 to disable, 8 for default quality")
326 
327 #define DRI_CONF_PP_JIMENEZMLAA_COLOR(def,min,max) \
328    DRI_CONF_OPT_I(pp_jimenezmlaa_color, def, min, max, \
329                   "Morphological anti-aliasing based on Jimenez' MLAA. 0 to disable, 8 for default quality. Color version, usable with 2d GL apps")
330 
331 /**
332  * \brief Performance-related options
333  */
334 #define DRI_CONF_SECTION_PERFORMANCE DRI_CONF_SECTION("Performance")
335 
336 #define DRI_CONF_VBLANK_NEVER 0
337 #define DRI_CONF_VBLANK_DEF_INTERVAL_0 1
338 #define DRI_CONF_VBLANK_DEF_INTERVAL_1 2
339 #define DRI_CONF_VBLANK_ALWAYS_SYNC 3
340 #define DRI_CONF_VBLANK_MODE(def) \
341    DRI_CONF_OPT_E(vblank_mode, def, 0, 3, \
342                   "Synchronization with vertical refresh (swap intervals)", \
343                   DRI_CONF_ENUM(0,"Never synchronize with vertical refresh, ignore application's choice") \
344                   DRI_CONF_ENUM(1,"Initial swap interval 0, obey application's choice") \
345                   DRI_CONF_ENUM(2,"Initial swap interval 1, obey application's choice") \
346                   DRI_CONF_ENUM(3,"Always synchronize with vertical refresh, application chooses the minimum swap interval"))
347 
348 #define DRI_CONF_ADAPTIVE_SYNC(def) \
349    DRI_CONF_OPT_B(adaptive_sync,def, \
350                   "Adapt the monitor sync to the application performance (when possible)")
351 
352 #define DRI_CONF_VK_WSI_FORCE_BGRA8_UNORM_FIRST(def) \
353    DRI_CONF_OPT_B(vk_wsi_force_bgra8_unorm_first, def, \
354                   "Force vkGetPhysicalDeviceSurfaceFormatsKHR to return VK_FORMAT_B8G8R8A8_UNORM as the first format")
355 
356 #define DRI_CONF_VK_X11_OVERRIDE_MIN_IMAGE_COUNT(def) \
357    DRI_CONF_OPT_I(vk_x11_override_min_image_count, def, 0, 999, \
358                   "Override the VkSurfaceCapabilitiesKHR::minImageCount (0 = no override)")
359 
360 #define DRI_CONF_VK_X11_STRICT_IMAGE_COUNT(def) \
361    DRI_CONF_OPT_B(vk_x11_strict_image_count, def, \
362                   "Force the X11 WSI to create exactly the number of image specified by the application in VkSwapchainCreateInfoKHR::minImageCount")
363 
364 #define DRI_CONF_VK_X11_ENSURE_MIN_IMAGE_COUNT(def) \
365    DRI_CONF_OPT_B(vk_x11_ensure_min_image_count, def, \
366                   "Force the X11 WSI to create at least the number of image specified by the driver in VkSurfaceCapabilitiesKHR::minImageCount")
367 
368 #define DRI_CONF_VK_XWAYLAND_WAIT_READY(def) \
369    DRI_CONF_OPT_B(vk_xwayland_wait_ready, def, \
370                   "Wait for fences before submitting buffers to Xwayland")
371 
372 #define DRI_CONF_MESA_GLTHREAD(def) \
373    DRI_CONF_OPT_B(mesa_glthread, def, \
374                   "Enable offloading GL driver work to a separate thread")
375 
376 #define DRI_CONF_MESA_NO_ERROR(def) \
377    DRI_CONF_OPT_B(mesa_no_error, def, \
378                   "Disable GL driver error checking")
379 
380 
381 /**
382  * \brief Miscellaneous configuration options
383  */
384 #define DRI_CONF_SECTION_MISCELLANEOUS DRI_CONF_SECTION("Miscellaneous")
385 
386 #define DRI_CONF_ALWAYS_HAVE_DEPTH_BUFFER(def) \
387    DRI_CONF_OPT_B(always_have_depth_buffer, def, \
388                   "Create all visuals with a depth buffer")
389 
390 #define DRI_CONF_GLSL_ZERO_INIT(def) \
391    DRI_CONF_OPT_B(glsl_zero_init, def, \
392                   "Force uninitialized variables to default to zero")
393 
394 #define DRI_CONF_VS_POSITION_ALWAYS_INVARIANT(def) \
395    DRI_CONF_OPT_B(vs_position_always_invariant, def, \
396                   "Force the vertex shader's gl_Position output to be considered 'invariant'")
397 
398 #define DRI_CONF_VS_POSITION_ALWAYS_PRECISE(def) \
399    DRI_CONF_OPT_B(vs_position_always_precise, def, \
400                   "Force the vertex shader's gl_Position output to be considered 'precise'")
401 
402 #define DRI_CONF_ALLOW_RGB10_CONFIGS(def) \
403    DRI_CONF_OPT_B(allow_rgb10_configs, def, \
404                   "Allow exposure of visuals and fbconfigs with rgb10a2 formats")
405 
406 #define DRI_CONF_ALLOW_RGB565_CONFIGS(def) \
407    DRI_CONF_OPT_B(allow_rgb565_configs, def, \
408                   "Allow exposure of visuals and fbconfigs with rgb565 formats")
409 
410 #define DRI_CONF_FORCE_INTEGER_TEX_NEAREST(def) \
411    DRI_CONF_OPT_B(force_integer_tex_nearest, def, \
412                   "Force integer textures to use nearest filtering")
413 
414 /**
415  * \brief Initialization configuration options
416  */
417 #define DRI_CONF_SECTION_INITIALIZATION DRI_CONF_SECTION("Initialization")
418 
419 #define DRI_CONF_DEVICE_ID_PATH_TAG() \
420    DRI_CONF_OPT_S_NODEF(device_id, "Define the graphic device to use if possible")
421 
422 #define DRI_CONF_DRI_DRIVER() \
423    DRI_CONF_OPT_S_NODEF(dri_driver, "Override the DRI driver to load")
424 
425 /**
426  * \brief Gallium-Nine specific configuration options
427  */
428 
429 #define DRI_CONF_SECTION_NINE DRI_CONF_SECTION("Gallium Nine")
430 
431 #define DRI_CONF_NINE_THROTTLE(def) \
432    DRI_CONF_OPT_I(throttle_value, def, 0, 0, \
433                   "Define the throttling value. -1 for no throttling, -2 for default (usually 2), 0 for glfinish behaviour")
434 
435 #define DRI_CONF_NINE_THREADSUBMIT(def) \
436    DRI_CONF_OPT_B(thread_submit, def, \
437                   "Use an additional thread to submit buffers.")
438 
439 #define DRI_CONF_NINE_OVERRIDEVENDOR(def) \
440    DRI_CONF_OPT_I(override_vendorid, def, 0, 0, \
441                   "Define the vendor_id to report. This allows faking another hardware vendor.")
442 
443 #define DRI_CONF_NINE_ALLOWDISCARDDELAYEDRELEASE(def) \
444    DRI_CONF_OPT_B(discard_delayed_release, def, \
445                   "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).")
446 
447 #define DRI_CONF_NINE_TEARFREEDISCARD(def) \
448    DRI_CONF_OPT_B(tearfree_discard, def, \
449                   "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. true by default.")
450 
451 #define DRI_CONF_NINE_CSMT(def) \
452    DRI_CONF_OPT_I(csmt_force, def, 0, 0, \
453                   "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.")
454 
455 #define DRI_CONF_NINE_DYNAMICTEXTUREWORKAROUND(def) \
456    DRI_CONF_OPT_B(dynamic_texture_workaround, def, \
457                   "If set to true, use a ram intermediate buffer for dynamic textures. Increases ram usage, which can cause out of memory issues, but can fix glitches for some games.")
458 
459 #define DRI_CONF_NINE_SHADERINLINECONSTANTS(def) \
460    DRI_CONF_OPT_B(shader_inline_constants, def, \
461                   "If set to true, recompile shaders with integer or boolean constants when the values are known. Can cause stutter, but can increase slightly performance.")
462 
463 #define DRI_CONF_NINE_SHMEM_LIMIT() \
464    DRI_CONF_OPT_I(texture_memory_limit, 128, 0, 0, \
465                   "In MB the limit of virtual memory used for textures until shmem files are unmapped (default 128MB, 32bits only). If negative disables shmem. Set to a low amount to reduce virtual memory usage, but can incur a small perf hit if too low.")
466 
467 #define DRI_CONF_NINE_FORCESWRENDERINGONCPU(def) \
468    DRI_CONF_OPT_B(force_sw_rendering_on_cpu, def, \
469                   "If set to false, emulates software rendering on the requested device, else uses a software renderer.")
470 
471 /**
472  * \brief radeonsi specific configuration options
473  */
474 
475 #define DRI_CONF_RADEONSI_ASSUME_NO_Z_FIGHTS(def) \
476    DRI_CONF_OPT_B(radeonsi_assume_no_z_fights, def, \
477                   "Assume no Z fights (enables aggressive out-of-order rasterization to improve performance; may cause rendering errors)")
478 
479 #define DRI_CONF_RADEONSI_COMMUTATIVE_BLEND_ADD(def) \
480    DRI_CONF_OPT_B(radeonsi_commutative_blend_add, def, \
481                   "Commutative additive blending optimizations (may cause rendering errors)")
482 
483 #define DRI_CONF_RADEONSI_ZERO_ALL_VRAM_ALLOCS(def) \
484    DRI_CONF_OPT_B(radeonsi_zerovram, def, \
485                   "Zero all vram allocations")
486 
487 #define DRI_CONF_V3D_NONMSAA_TEXTURE_SIZE_LIMIT(def) \
488    DRI_CONF_OPT_B(v3d_nonmsaa_texture_size_limit, def, \
489                   "Report the non-MSAA-only texture size limit")
490 
491 /**
492  * \brief virgl specific configuration options
493  */
494 
495 #define DRI_CONF_GLES_EMULATE_BGRA(def) \
496    DRI_CONF_OPT_B(gles_emulate_bgra, def, \
497                   "On GLES emulate BGRA formats by using a swizzled RGBA format")
498 
499 #define DRI_CONF_GLES_APPLY_BGRA_DEST_SWIZZLE(def) \
500    DRI_CONF_OPT_B(gles_apply_bgra_dest_swizzle, def, \
501                   "When the BGRA formats are emulated by using swizzled RGBA formats on GLES apply the swizzle when writing")
502 
503 #define DRI_CONF_GLES_SAMPLES_PASSED_VALUE(def, minimum, maximum) \
504    DRI_CONF_OPT_I(gles_samples_passed_value, def, minimum, maximum, \
505                   "GL_SAMPLES_PASSED value when emulated by GL_ANY_SAMPLES_PASSED")
506 
507 #define DRI_CONF_FORMAT_L8_SRGB_ENABLE_READBACK(def) \
508    DRI_CONF_OPT_B(format_l8_srgb_enable_readback, def, \
509                   "Force-enable reading back L8_SRGB textures")
510 
511 /**
512  * \brief RADV specific configuration options
513  */
514 
515 #define DRI_CONF_RADV_REPORT_LLVM9_VERSION_STRING(def) \
516    DRI_CONF_OPT_B(radv_report_llvm9_version_string, def, \
517                   "Report LLVM 9.0.1 for games that apply shader workarounds if missing (for ACO only)")
518 
519 #define DRI_CONF_RADV_ENABLE_MRT_OUTPUT_NAN_FIXUP(def) \
520    DRI_CONF_OPT_B(radv_enable_mrt_output_nan_fixup, def, \
521                   "Replace NaN outputs from fragment shaders with zeroes for floating point render target")
522 
523 #define DRI_CONF_RADV_NO_DYNAMIC_BOUNDS(def) \
524    DRI_CONF_OPT_B(radv_no_dynamic_bounds, def, \
525                   "Disabling bounds checking for dynamic buffer descriptors")
526 
527 #define DRI_CONF_RADV_DISABLE_SHRINK_IMAGE_STORE(def) \
528    DRI_CONF_OPT_B(radv_disable_shrink_image_store, def, \
529                   "Disabling shrinking of image stores based on the format")
530 
531 #define DRI_CONF_RADV_ABSOLUTE_DEPTH_BIAS(def) \
532    DRI_CONF_OPT_B(radv_absolute_depth_bias, def, \
533                   "Consider depthBiasConstantFactor an absolute depth bias (like D3D9)")
534 
535 #define DRI_CONF_RADV_OVERRIDE_UNIFORM_OFFSET_ALIGNMENT(def) \
536    DRI_CONF_OPT_I(radv_override_uniform_offset_alignment, def, 0, 128, \
537                   "Override the minUniformBufferOffsetAlignment exposed to the application. (0 = default)")
538 
539 #define DRI_CONF_RADV_ZERO_VRAM(def) \
540    DRI_CONF_OPT_B(radv_zero_vram, def, \
541                   "Initialize to zero all VRAM allocations")
542 
543 #define DRI_CONF_RADV_LOWER_DISCARD_TO_DEMOTE(def) \
544    DRI_CONF_OPT_B(radv_lower_discard_to_demote, def, \
545                   "Lower discard instructions to demote")
546 
547 #define DRI_CONF_RADV_INVARIANT_GEOM(def) \
548    DRI_CONF_OPT_B(radv_invariant_geom, def, \
549                   "Mark geometry-affecting outputs as invariant")
550 
551 #define DRI_CONF_RADV_SPLIT_FMA(def) \
552    DRI_CONF_OPT_B(radv_split_fma, def, \
553                   "Split application-provided fused multiply-add in geometry stages")
554 
555 #define DRI_CONF_RADV_DISABLE_TC_COMPAT_HTILE_GENERAL(def) \
556    DRI_CONF_OPT_B(radv_disable_tc_compat_htile_general, def, \
557                   "Disable TC-compat HTILE in GENERAL layout")
558 
559 #define DRI_CONF_RADV_DISABLE_DCC(def) \
560    DRI_CONF_OPT_B(radv_disable_dcc, def, \
561                   "Disable DCC for color images")
562 
563 #define DRI_CONF_RADV_REPORT_APU_AS_DGPU(def) \
564    DRI_CONF_OPT_B(radv_report_apu_as_dgpu, def, \
565                   "Report APUs as discrete GPUs instead of integrated GPUs")
566 
567 #define DRI_CONF_RADV_REQUIRE_ETC2(def)                                        \
568   DRI_CONF_OPT_B(radv_require_etc2, def,                                       \
569                  "Implement emulated ETC2 on HW that does not support it")
570 
571 #define DRI_CONF_RADV_DISABLE_HTILE_LAYERS(def) \
572    DRI_CONF_OPT_B(radv_disable_htile_layers, def, \
573                   "Disable HTILE for layered depth/stencil formats")
574 
575 #define DRI_CONF_RADV_DISABLE_ANISO_SINGLE_LEVEL(def) \
576   DRI_CONF_OPT_B(radv_disable_aniso_single_level, def, \
577                  "Disable anisotropic filtering for single level images")
578 
579 #endif
580