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_DISABLE_UNIFORM_ARRAY_RESIZE(def) \ 168 DRI_CONF_OPT_B(disable_uniform_array_resize, def, \ 169 "Disable the glsl optimisation that resizes uniform arrays") 170 171 #define DRI_CONF_ALIAS_SHADER_EXTENSION() \ 172 DRI_CONF_OPT_S_NODEF(alias_shader_extension, "Allow alias for shader extensions") 173 174 #define DRI_CONF_ALLOW_VERTEX_TEXTURE_BIAS(def) \ 175 DRI_CONF_OPT_B(allow_vertex_texture_bias, def, \ 176 "Allow GL2 vertex shaders to have access to texture2D/textureCube with bias variants") 177 178 #define DRI_CONF_FORCE_GLSL_VERSION(def) \ 179 DRI_CONF_OPT_I(force_glsl_version, def, 0, 999, \ 180 "Force a default GLSL version for shaders that lack an explicit #version line") 181 182 #define DRI_CONF_ALLOW_EXTRA_PP_TOKENS(def) \ 183 DRI_CONF_OPT_B(allow_extra_pp_tokens, def, \ 184 "Allow extra tokens at end of preprocessor directives.") 185 186 #define DRI_CONF_ALLOW_GLSL_EXTENSION_DIRECTIVE_MIDSHADER(def) \ 187 DRI_CONF_OPT_B(allow_glsl_extension_directive_midshader, def, \ 188 "Allow GLSL #extension directives in the middle of shaders") 189 190 #define DRI_CONF_ALLOW_GLSL_120_SUBSET_IN_110(def) \ 191 DRI_CONF_OPT_B(allow_glsl_120_subset_in_110, def, \ 192 "Allow a subset of GLSL 1.20 in GLSL 1.10 as needed by SPECviewperf13") 193 194 #define DRI_CONF_ALLOW_GLSL_BUILTIN_CONST_EXPRESSION(def) \ 195 DRI_CONF_OPT_B(allow_glsl_builtin_const_expression, def, \ 196 "Allow builtins as part of constant expressions") 197 198 #define DRI_CONF_ALLOW_GLSL_RELAXED_ES(def) \ 199 DRI_CONF_OPT_B(allow_glsl_relaxed_es, def, \ 200 "Allow some relaxation of GLSL ES shader restrictions") 201 202 #define DRI_CONF_ALLOW_GLSL_BUILTIN_VARIABLE_REDECLARATION(def) \ 203 DRI_CONF_OPT_B(allow_glsl_builtin_variable_redeclaration, def, \ 204 "Allow GLSL built-in variables to be redeclared verbatim") 205 206 #define DRI_CONF_ALLOW_HIGHER_COMPAT_VERSION(def) \ 207 DRI_CONF_OPT_B(allow_higher_compat_version, def, \ 208 "Allow a higher compat profile (version 3.1+) for apps that request it") 209 210 #define DRI_CONF_ALLOW_GLSL_COMPAT_SHADERS(def) \ 211 DRI_CONF_OPT_B(allow_glsl_compat_shaders, def, \ 212 "Allow in GLSL: #version xxx compatibility") 213 214 #define DRI_CONF_FORCE_GLSL_ABS_SQRT(def) \ 215 DRI_CONF_OPT_B(force_glsl_abs_sqrt, def, \ 216 "Force computing the absolute value for sqrt() and inversesqrt()") 217 218 #define DRI_CONF_GLSL_CORRECT_DERIVATIVES_AFTER_DISCARD(def) \ 219 DRI_CONF_OPT_B(glsl_correct_derivatives_after_discard, def, \ 220 "Implicit and explicit derivatives after a discard behave as if the discard didn't happen") 221 222 #define DRI_CONF_GLSL_IGNORE_WRITE_TO_READONLY_VAR(def) \ 223 DRI_CONF_OPT_B(glsl_ignore_write_to_readonly_var, def, \ 224 "Forces the GLSL compiler to ignore writes to readonly vars rather than throwing an error") 225 226 #define DRI_CONF_ALLOW_GLSL_CROSS_STAGE_INTERPOLATION_MISMATCH(def) \ 227 DRI_CONF_OPT_B(allow_glsl_cross_stage_interpolation_mismatch, def, \ 228 "Allow interpolation qualifier mismatch across shader stages") 229 230 #define DRI_CONF_DO_DCE_BEFORE_CLIP_CULL_ANALYSIS(def) \ 231 DRI_CONF_OPT_B(do_dce_before_clip_cull_analysis, def, \ 232 "Use dead code elimitation before checking for invalid Clip*/CullDistance variables usage.") 233 234 #define DRI_CONF_ALLOW_DRAW_OUT_OF_ORDER(def) \ 235 DRI_CONF_OPT_B(allow_draw_out_of_order, def, \ 236 "Allow out-of-order draw optimizations. Set when Z fighting doesn't have to be accurate.") 237 238 #define DRI_CONF_GLTHREAD_NOP_CHECK_FRAMEBUFFER_STATUS(def) \ 239 DRI_CONF_OPT_B(glthread_nop_check_framebuffer_status, def, \ 240 "glthread always returns GL_FRAMEBUFFER_COMPLETE to prevent synchronization.") 241 242 #define DRI_CONF_FORCE_GL_VENDOR() \ 243 DRI_CONF_OPT_S_NODEF(force_gl_vendor, "Override GPU vendor string.") 244 245 #define DRI_CONF_FORCE_GL_RENDERER() \ 246 DRI_CONF_OPT_S_NODEF(force_gl_renderer, "Override GPU renderer string.") 247 248 #define DRI_CONF_FORCE_COMPAT_PROFILE(def) \ 249 DRI_CONF_OPT_B(force_compat_profile, def, \ 250 "Force an OpenGL compatibility context") 251 252 #define DRI_CONF_FORCE_COMPAT_SHADERS(def) \ 253 DRI_CONF_OPT_B(force_compat_shaders, def, \ 254 "Force OpenGL compatibility shaders") 255 256 #define DRI_CONF_FORCE_DIRECT_GLX_CONTEXT(def) \ 257 DRI_CONF_OPT_B(force_direct_glx_context, def, \ 258 "Force direct GLX context (even if indirect is requested)") 259 260 #define DRI_CONF_ALLOW_INVALID_GLX_DESTROY_WINDOW(def) \ 261 DRI_CONF_OPT_B(allow_invalid_glx_destroy_window, def, \ 262 "Allow passing an invalid window into glXDestroyWindow") 263 264 #define DRI_CONF_KEEP_NATIVE_WINDOW_GLX_DRAWABLE(def) \ 265 DRI_CONF_OPT_B(keep_native_window_glx_drawable, def, \ 266 "Keep GLX drawable created from native window when switch context") 267 268 #define DRI_CONF_OVERRIDE_VRAM_SIZE() \ 269 DRI_CONF_OPT_I(override_vram_size, -1, -1, 2147483647, \ 270 "Override the VRAM size advertised to the application in MiB (-1 = default)") 271 272 #define DRI_CONF_FORCE_GL_NAMES_REUSE(def) \ 273 DRI_CONF_OPT_B(force_gl_names_reuse, def, "Force GL names reuse") 274 275 #define DRI_CONF_FORCE_GL_MAP_BUFFER_SYNCHRONIZED(def) \ 276 DRI_CONF_OPT_B(force_gl_map_buffer_synchronized, def, "Override GL_MAP_UNSYNCHRONIZED_BIT.") 277 278 #define DRI_CONF_TRANSCODE_ETC(def) \ 279 DRI_CONF_OPT_B(transcode_etc, def, "Transcode ETC formats to DXTC if unsupported") 280 281 #define DRI_CONF_TRANSCODE_ASTC(def) \ 282 DRI_CONF_OPT_B(transcode_astc, def, "Transcode ASTC formats to DXTC if unsupported") 283 284 #define DRI_CONF_MESA_EXTENSION_OVERRIDE() \ 285 DRI_CONF_OPT_S_NODEF(mesa_extension_override, \ 286 "Allow enabling/disabling a list of extensions") 287 288 #define DRI_CONF_GLX_EXTENSION_OVERRIDE() \ 289 DRI_CONF_OPT_S_NODEF(glx_extension_override, \ 290 "Allow enabling/disabling a list of GLX extensions") 291 292 #define DRI_CONF_INDIRECT_GL_EXTENSION_OVERRIDE() \ 293 DRI_CONF_OPT_S_NODEF(indirect_gl_extension_override, \ 294 "Allow enabling/disabling a list of indirect-GL extensions") 295 296 #define DRI_CONF_FORCE_PROTECTED_CONTENT_CHECK(def) \ 297 DRI_CONF_OPT_B(force_protected_content_check, def, \ 298 "Reject image import if protected_content attribute doesn't match") 299 300 #define DRI_CONF_IGNORE_MAP_UNSYNCHRONIZED(def) \ 301 DRI_CONF_OPT_B(ignore_map_unsynchronized, def, \ 302 "Ignore GL_MAP_UNSYNCHRONIZED_BIT, workaround for games that use it incorrectly") 303 304 #define DRI_CONF_VK_DONT_CARE_AS_LOAD(def) \ 305 DRI_CONF_OPT_B(vk_dont_care_as_load, def, \ 306 "Treat VK_ATTACHMENT_LOAD_OP_DONT_CARE as LOAD_OP_LOAD, workaround on tiler GPUs for games that confuse these two load ops") 307 308 #define DRI_CONF_LIMIT_TRIG_INPUT_RANGE(def) \ 309 DRI_CONF_OPT_B(limit_trig_input_range, def, \ 310 "Limit trig input range to [-2p : 2p] to improve sin/cos calculation precision on Intel") 311 312 #define DRI_CONF_NO_16BIT(def) \ 313 DRI_CONF_OPT_B(no_16bit, def, \ 314 "Disable 16-bit instructions") 315 316 #define DRI_CONF_IGNORE_DISCARD_FRAMEBUFFER(def) \ 317 DRI_CONF_OPT_B(ignore_discard_framebuffer, def, \ 318 "Ignore glDiscardFramebuffer/glInvalidateFramebuffer, workaround for games that use it incorrectly") 319 320 #define DRI_CONF_FORCE_VK_VENDOR(def) \ 321 DRI_CONF_OPT_I(force_vk_vendor, 0, -1, 2147483647, "Override GPU vendor id") 322 323 #define DRI_CONF_FAKE_SPARSE(def) \ 324 DRI_CONF_OPT_B(fake_sparse, def, \ 325 "Advertise support for sparse binding of textures regardless of real support") 326 327 #define DRI_CONF_INTEL_ENABLE_WA_14018912822(def) \ 328 DRI_CONF_OPT_B(intel_enable_wa_14018912822, def, \ 329 "Intel workaround for using zero blend constants") 330 331 #define DRI_CONF_VK_REQUIRE_ETC2(def) \ 332 DRI_CONF_OPT_B(vk_require_etc2, def, \ 333 "Implement emulated ETC2 on HW that does not support it") 334 335 #define DRI_CONF_VK_REQUIRE_ASTC(def) \ 336 DRI_CONF_OPT_B(vk_require_astc, def, \ 337 "Implement emulated ASTC on HW that does not support it") 338 339 /** 340 * \brief Image quality-related options 341 */ 342 #define DRI_CONF_SECTION_QUALITY DRI_CONF_SECTION("Image Quality") 343 344 #define DRI_CONF_PRECISE_TRIG(def) \ 345 DRI_CONF_OPT_B(precise_trig, def, \ 346 "Prefer accuracy over performance in trig functions") 347 348 #define DRI_CONF_PP_CELSHADE(def) \ 349 DRI_CONF_OPT_E(pp_celshade, def, 0, 1, \ 350 "A post-processing filter to cel-shade the output", \ 351 { 0 } ) 352 353 #define DRI_CONF_PP_NORED(def) \ 354 DRI_CONF_OPT_E(pp_nored, def, 0, 1, \ 355 "A post-processing filter to remove the red channel", \ 356 { 0 } ) 357 358 #define DRI_CONF_PP_NOGREEN(def) \ 359 DRI_CONF_OPT_E(pp_nogreen, def, 0, 1, \ 360 "A post-processing filter to remove the green channel", \ 361 { 0 } ) 362 363 #define DRI_CONF_PP_NOBLUE(def) \ 364 DRI_CONF_OPT_E(pp_noblue, def, 0, 1, \ 365 "A post-processing filter to remove the blue channel", \ 366 { 0 } ) 367 368 #define DRI_CONF_PP_JIMENEZMLAA(def,min,max) \ 369 DRI_CONF_OPT_I(pp_jimenezmlaa, def, min, max, \ 370 "Morphological anti-aliasing based on Jimenez' MLAA. 0 to disable, 8 for default quality") 371 372 #define DRI_CONF_PP_JIMENEZMLAA_COLOR(def,min,max) \ 373 DRI_CONF_OPT_I(pp_jimenezmlaa_color, def, min, max, \ 374 "Morphological anti-aliasing based on Jimenez' MLAA. 0 to disable, 8 for default quality. Color version, usable with 2d GL apps") 375 376 #define DRI_CONF_PP_LOWER_DEPTH_RANGE_RATE() \ 377 DRI_CONF_OPT_F(lower_depth_range_rate, 1.0, 0.0, 1.0, \ 378 "Lower depth range for fixing misrendering issues due to z coordinate float point interpolation accuracy") 379 380 /** 381 * \brief Performance-related options 382 */ 383 #define DRI_CONF_SECTION_PERFORMANCE DRI_CONF_SECTION("Performance") 384 385 #define DRI_CONF_VBLANK_NEVER 0 386 #define DRI_CONF_VBLANK_DEF_INTERVAL_0 1 387 #define DRI_CONF_VBLANK_DEF_INTERVAL_1 2 388 #define DRI_CONF_VBLANK_ALWAYS_SYNC 3 389 #define DRI_CONF_VBLANK_MODE(def) \ 390 DRI_CONF_OPT_E(vblank_mode, def, 0, 3, \ 391 "Synchronization with vertical refresh (swap intervals)", \ 392 DRI_CONF_ENUM(0,"Never synchronize with vertical refresh, ignore application's choice") \ 393 DRI_CONF_ENUM(1,"Initial swap interval 0, obey application's choice") \ 394 DRI_CONF_ENUM(2,"Initial swap interval 1, obey application's choice") \ 395 DRI_CONF_ENUM(3,"Always synchronize with vertical refresh, application chooses the minimum swap interval")) 396 397 #define DRI_CONF_ADAPTIVE_SYNC(def) \ 398 DRI_CONF_OPT_B(adaptive_sync,def, \ 399 "Adapt the monitor sync to the application performance (when possible)") 400 401 #define DRI_CONF_BLOCK_ON_DEPLETED_BUFFERS(def) \ 402 DRI_CONF_OPT_B(block_on_depleted_buffers, def, \ 403 "Block clients using buffer backpressure until new buffer is available to reduce latency") 404 405 #define DRI_CONF_VK_WSI_FORCE_BGRA8_UNORM_FIRST(def) \ 406 DRI_CONF_OPT_B(vk_wsi_force_bgra8_unorm_first, def, \ 407 "Force vkGetPhysicalDeviceSurfaceFormatsKHR to return VK_FORMAT_B8G8R8A8_UNORM as the first format") 408 409 #define DRI_CONF_VK_WSI_FORCE_SWAPCHAIN_TO_CURRENT_EXTENT(def) \ 410 DRI_CONF_OPT_B(vk_wsi_force_swapchain_to_current_extent, def, \ 411 "Force VkSwapchainCreateInfoKHR::imageExtent to be VkSurfaceCapabilities2KHR::currentExtent") 412 413 #define DRI_CONF_VK_X11_OVERRIDE_MIN_IMAGE_COUNT(def) \ 414 DRI_CONF_OPT_I(vk_x11_override_min_image_count, def, 0, 999, \ 415 "Override the VkSurfaceCapabilitiesKHR::minImageCount (0 = no override)") 416 417 #define DRI_CONF_VK_X11_STRICT_IMAGE_COUNT(def) \ 418 DRI_CONF_OPT_B(vk_x11_strict_image_count, def, \ 419 "Force the X11 WSI to create exactly the number of image specified by the application in VkSwapchainCreateInfoKHR::minImageCount") 420 421 #define DRI_CONF_VK_X11_ENSURE_MIN_IMAGE_COUNT(def) \ 422 DRI_CONF_OPT_B(vk_x11_ensure_min_image_count, def, \ 423 "Force the X11 WSI to create at least the number of image specified by the driver in VkSurfaceCapabilitiesKHR::minImageCount") 424 425 #define DRI_CONF_VK_X11_IGNORE_SUBOPTIMAL(def) \ 426 DRI_CONF_OPT_B(vk_x11_ignore_suboptimal, def, \ 427 "Force the X11 WSI to never report VK_SUBOPTIMAL_KHR") 428 429 #define DRI_CONF_VK_KHR_PRESENT_WAIT(def) \ 430 DRI_CONF_OPT_B(vk_khr_present_wait, def, \ 431 "Expose VK_KHR_present_wait and id extensions despite them not being implemented for all supported surface types") 432 433 #define DRI_CONF_VK_XWAYLAND_WAIT_READY(def) \ 434 DRI_CONF_OPT_B(vk_xwayland_wait_ready, def, \ 435 "Wait for fences before submitting buffers to Xwayland") 436 437 #define DRI_CONF_MESA_GLTHREAD_DRIVER(def) \ 438 DRI_CONF_OPT_B(mesa_glthread_driver, def, \ 439 "Enable offloading GL driver work to a separate thread") 440 441 #define DRI_CONF_MESA_NO_ERROR(def) \ 442 DRI_CONF_OPT_B(mesa_no_error, def, \ 443 "Disable GL driver error checking") 444 445 #define DRI_CONF_SHADER_SPILLING_RATE(def) \ 446 DRI_CONF_OPT_I(shader_spilling_rate, def, 0, 100, \ 447 "Speed up shader compilation by increasing number of spilled registers after ra_allocate failure") 448 /** 449 * \brief Miscellaneous configuration options 450 */ 451 #define DRI_CONF_SECTION_MISCELLANEOUS DRI_CONF_SECTION("Miscellaneous") 452 453 #define DRI_CONF_ALWAYS_HAVE_DEPTH_BUFFER(def) \ 454 DRI_CONF_OPT_B(always_have_depth_buffer, def, \ 455 "Create all visuals with a depth buffer") 456 457 #define DRI_CONF_GLSL_ZERO_INIT(def) \ 458 DRI_CONF_OPT_B(glsl_zero_init, def, \ 459 "Force uninitialized variables to default to zero") 460 461 #define DRI_CONF_VS_POSITION_ALWAYS_INVARIANT(def) \ 462 DRI_CONF_OPT_B(vs_position_always_invariant, def, \ 463 "Force the vertex shader's gl_Position output to be considered 'invariant'") 464 465 #define DRI_CONF_VS_POSITION_ALWAYS_PRECISE(def) \ 466 DRI_CONF_OPT_B(vs_position_always_precise, def, \ 467 "Force the vertex shader's gl_Position output to be considered 'precise'") 468 469 #define DRI_CONF_ALLOW_RGB10_CONFIGS(def) \ 470 DRI_CONF_OPT_B(allow_rgb10_configs, def, \ 471 "Allow exposure of visuals and fbconfigs with rgb10a2 formats") 472 473 #define DRI_CONF_ALLOW_RGB565_CONFIGS(def) \ 474 DRI_CONF_OPT_B(allow_rgb565_configs, def, \ 475 "Allow exposure of visuals and fbconfigs with rgb565 formats") 476 477 #define DRI_CONF_FORCE_INTEGER_TEX_NEAREST(def) \ 478 DRI_CONF_OPT_B(force_integer_tex_nearest, def, \ 479 "Force integer textures to use nearest filtering") 480 481 /* The GL spec does not allow this but wine has translation bug: 482 https://bugs.winehq.org/show_bug.cgi?id=54787 483 */ 484 #define DRI_CONF_ALLOW_MULTISAMPLED_COPYTEXIMAGE(def) \ 485 DRI_CONF_OPT_B(allow_multisampled_copyteximage, def, \ 486 "Allow CopyTexSubImage and other to copy sampled framebuffer") 487 488 #define DRI_CONF_NO_FP16(def) \ 489 DRI_CONF_OPT_B(no_fp16, def, \ 490 "Disable 16-bit float support") 491 492 /** 493 * \brief Initialization configuration options 494 */ 495 #define DRI_CONF_SECTION_INITIALIZATION DRI_CONF_SECTION("Initialization") 496 497 #define DRI_CONF_DEVICE_ID_PATH_TAG() \ 498 DRI_CONF_OPT_S_NODEF(device_id, "Define the graphic device to use if possible") 499 500 #define DRI_CONF_DRI_DRIVER() \ 501 DRI_CONF_OPT_S_NODEF(dri_driver, "Override the DRI driver to load") 502 503 /** 504 * \brief Gallium-Nine specific configuration options 505 */ 506 507 #define DRI_CONF_SECTION_NINE DRI_CONF_SECTION("Gallium Nine") 508 509 #define DRI_CONF_NINE_THROTTLE(def) \ 510 DRI_CONF_OPT_I(throttle_value, def, 0, 0, \ 511 "Define the throttling value. -1 for no throttling, -2 for default (usually 2), 0 for glfinish behaviour") 512 513 #define DRI_CONF_NINE_THREADSUBMIT(def) \ 514 DRI_CONF_OPT_B(thread_submit, def, \ 515 "Use an additional thread to submit buffers.") 516 517 #define DRI_CONF_NINE_OVERRIDEVENDOR(def) \ 518 DRI_CONF_OPT_I(override_vendorid, def, 0, 0, \ 519 "Define the vendor_id to report. This allows faking another hardware vendor.") 520 521 #define DRI_CONF_NINE_ALLOWDISCARDDELAYEDRELEASE(def) \ 522 DRI_CONF_OPT_B(discard_delayed_release, def, \ 523 "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).") 524 525 #define DRI_CONF_NINE_TEARFREEDISCARD(def) \ 526 DRI_CONF_OPT_B(tearfree_discard, def, \ 527 "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.") 528 529 #define DRI_CONF_NINE_CSMT(def) \ 530 DRI_CONF_OPT_I(csmt_force, def, 0, 0, \ 531 "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.") 532 533 #define DRI_CONF_NINE_DYNAMICTEXTUREWORKAROUND(def) \ 534 DRI_CONF_OPT_B(dynamic_texture_workaround, def, \ 535 "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.") 536 537 #define DRI_CONF_NINE_SHADERINLINECONSTANTS(def) \ 538 DRI_CONF_OPT_B(shader_inline_constants, def, \ 539 "If set to true, recompile shaders with integer or boolean constants when the values are known. Can cause stutter, but can increase slightly performance.") 540 541 #define DRI_CONF_NINE_SHMEM_LIMIT() \ 542 DRI_CONF_OPT_I(texture_memory_limit, 128, 0, 0, \ 543 "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.") 544 545 #define DRI_CONF_NINE_FORCESWRENDERINGONCPU(def) \ 546 DRI_CONF_OPT_B(force_sw_rendering_on_cpu, def, \ 547 "If set to false, emulates software rendering on the requested device, else uses a software renderer.") 548 549 #define DRI_CONF_NINE_FORCEFEATURESEMULATION(def) \ 550 DRI_CONF_OPT_B(force_features_emulation, def, \ 551 "If set to true, force emulation of d3d9 features when possible instead of using native hw support.") 552 553 #define DRI_CONF_V3D_NONMSAA_TEXTURE_SIZE_LIMIT(def) \ 554 DRI_CONF_OPT_B(v3d_nonmsaa_texture_size_limit, def, \ 555 "Report the non-MSAA-only texture size limit") 556 557 /** 558 * \brief virgl specific configuration options 559 */ 560 561 #define DRI_CONF_GLES_EMULATE_BGRA(def) \ 562 DRI_CONF_OPT_B(gles_emulate_bgra, def, \ 563 "On GLES emulate BGRA formats by using a swizzled RGBA format") 564 565 #define DRI_CONF_GLES_APPLY_BGRA_DEST_SWIZZLE(def) \ 566 DRI_CONF_OPT_B(gles_apply_bgra_dest_swizzle, def, \ 567 "When the BGRA formats are emulated by using swizzled RGBA formats on GLES apply the swizzle when writing") 568 569 #define DRI_CONF_GLES_SAMPLES_PASSED_VALUE(def, minimum, maximum) \ 570 DRI_CONF_OPT_I(gles_samples_passed_value, def, minimum, maximum, \ 571 "GL_SAMPLES_PASSED value when emulated by GL_ANY_SAMPLES_PASSED") 572 573 #define DRI_CONF_FORMAT_L8_SRGB_ENABLE_READBACK(def) \ 574 DRI_CONF_OPT_B(format_l8_srgb_enable_readback, def, \ 575 "Force-enable reading back L8_SRGB textures") 576 577 #define DRI_CONF_VIRGL_SHADER_SYNC(def) \ 578 DRI_CONF_OPT_B(virgl_shader_sync, def, \ 579 "Make shader compilation synchronous") 580 581 /** 582 * \brief freedreno specific configuration options 583 */ 584 585 #define DRI_CONF_DISABLE_CONSERVATIVE_LRZ(def) \ 586 DRI_CONF_OPT_B(disable_conservative_lrz, def, \ 587 "Disable conservative LRZ") 588 589 /** 590 * \brief Turnip specific configuration options 591 */ 592 593 #define DRI_CONF_TU_DONT_RESERVE_DESCRIPTOR_SET(def) \ 594 DRI_CONF_OPT_B(tu_dont_reserve_descriptor_set, def, \ 595 "Don't internally reserve one of the HW descriptor sets for descriptor set dynamic offset support, this frees up an extra descriptor set at the cost of that feature") 596 597 #define DRI_CONF_TU_ALLOW_OOB_INDIRECT_UBO_LOADS(def) \ 598 DRI_CONF_OPT_B(tu_allow_oob_indirect_ubo_loads, def, \ 599 "Some D3D11 games rely on out-of-bounds indirect UBO loads to return real values from underlying bound descriptor, this prevents us from lowering indirectly accessed UBOs to consts") 600 601 /** 602 * \brief venus specific configuration options 603 */ 604 #define DRI_CONF_VENUS_IMPLICIT_FENCING(def) \ 605 DRI_CONF_OPT_B(venus_implicit_fencing, def, \ 606 "Assume the virtio-gpu kernel driver supports implicit fencing") 607 608 #define DRI_CONF_VENUS_WSI_MULTI_PLANE_MODIFIERS(def) \ 609 DRI_CONF_OPT_B(venus_wsi_multi_plane_modifiers, def, \ 610 "Enable support of multi-plane format modifiers for wsi images") 611 612 /** 613 * \brief RADV specific configuration options 614 */ 615 616 #define DRI_CONF_RADV_REPORT_LLVM9_VERSION_STRING(def) \ 617 DRI_CONF_OPT_B(radv_report_llvm9_version_string, def, \ 618 "Report LLVM 9.0.1 for games that apply shader workarounds if missing (for ACO only)") 619 620 #define DRI_CONF_RADV_ENABLE_MRT_OUTPUT_NAN_FIXUP(def) \ 621 DRI_CONF_OPT_B(radv_enable_mrt_output_nan_fixup, def, \ 622 "Replace NaN outputs from fragment shaders with zeroes for floating point render target") 623 624 #define DRI_CONF_RADV_NO_DYNAMIC_BOUNDS(def) \ 625 DRI_CONF_OPT_B(radv_no_dynamic_bounds, def, \ 626 "Disabling bounds checking for dynamic buffer descriptors") 627 628 #define DRI_CONF_RADV_DISABLE_SHRINK_IMAGE_STORE(def) \ 629 DRI_CONF_OPT_B(radv_disable_shrink_image_store, def, \ 630 "Disabling shrinking of image stores based on the format") 631 632 #define DRI_CONF_RADV_OVERRIDE_UNIFORM_OFFSET_ALIGNMENT(def) \ 633 DRI_CONF_OPT_I(radv_override_uniform_offset_alignment, def, 0, 128, \ 634 "Override the minUniformBufferOffsetAlignment exposed to the application. (0 = default)") 635 636 #define DRI_CONF_RADV_ZERO_VRAM(def) \ 637 DRI_CONF_OPT_B(radv_zero_vram, def, \ 638 "Initialize to zero all VRAM allocations") 639 640 #define DRI_CONF_RADV_LOWER_DISCARD_TO_DEMOTE(def) \ 641 DRI_CONF_OPT_B(radv_lower_discard_to_demote, def, \ 642 "Lower discard instructions to demote") 643 644 #define DRI_CONF_RADV_INVARIANT_GEOM(def) \ 645 DRI_CONF_OPT_B(radv_invariant_geom, def, \ 646 "Mark geometry-affecting outputs as invariant") 647 648 #define DRI_CONF_RADV_SPLIT_FMA(def) \ 649 DRI_CONF_OPT_B(radv_split_fma, def, \ 650 "Split application-provided fused multiply-add in geometry stages") 651 652 #define DRI_CONF_RADV_DISABLE_TC_COMPAT_HTILE_GENERAL(def) \ 653 DRI_CONF_OPT_B(radv_disable_tc_compat_htile_general, def, \ 654 "Disable TC-compat HTILE in GENERAL layout") 655 656 #define DRI_CONF_RADV_DISABLE_DCC(def) \ 657 DRI_CONF_OPT_B(radv_disable_dcc, def, \ 658 "Disable DCC for color images") 659 660 #define DRI_CONF_RADV_DISABLE_ANISO_SINGLE_LEVEL(def) \ 661 DRI_CONF_OPT_B(radv_disable_aniso_single_level, def, \ 662 "Disable anisotropic filtering for single level images") 663 664 #define DRI_CONF_RADV_DISABLE_TRUNC_COORD(def) \ 665 DRI_CONF_OPT_B(radv_disable_trunc_coord, def, \ 666 "Disable TRUNC_COORD to use D3D10/11/12 point sampling behaviour. This has special behaviour for DXVK.") 667 668 #define DRI_CONF_RADV_DISABLE_SINKING_LOAD_INPUT_FS(def) \ 669 DRI_CONF_OPT_B(radv_disable_sinking_load_input_fs, def, \ 670 "Disable sinking load inputs for fragment shaders") 671 672 #define DRI_CONF_RADV_DGC(def) \ 673 DRI_CONF_OPT_B(radv_dgc, def, \ 674 "Expose an experimental implementation of VK_NV_device_generated_commands") 675 676 #define DRI_CONF_RADV_FLUSH_BEFORE_QUERY_COPY(def) \ 677 DRI_CONF_OPT_B( \ 678 radv_flush_before_query_copy, def, \ 679 "Wait for timestamps to be written before a query copy command") 680 681 #define DRI_CONF_RADV_ENABLE_UNIFIED_HEAP_ON_APU(def) \ 682 DRI_CONF_OPT_B(radv_enable_unified_heap_on_apu, def, \ 683 "Enable an unified heap with DEVICE_LOCAL on integrated GPUs") 684 685 #define DRI_CONF_RADV_TEX_NON_UNIFORM(def) \ 686 DRI_CONF_OPT_B(radv_tex_non_uniform, def, \ 687 "Always mark texture sample operations as non-uniform.") 688 689 #define DRI_CONF_RADV_SSBO_NON_UNIFORM(def) \ 690 DRI_CONF_OPT_B(radv_ssbo_non_uniform, def, \ 691 "Always mark SSBO operations as non-uniform.") 692 693 #define DRI_CONF_RADV_FLUSH_BEFORE_TIMESTAMP_WRITE(def) \ 694 DRI_CONF_OPT_B(radv_flush_before_timestamp_write, def, \ 695 "Wait for previous commands to finish before writing timestamps") 696 697 #define DRI_CONF_RADV_RT_WAVE64(def) \ 698 DRI_CONF_OPT_B(radv_rt_wave64, def, \ 699 "Force wave64 in RT shaders") 700 701 #define DRI_CONF_RADV_LEGACY_SPARSE_BINDING(def) \ 702 DRI_CONF_OPT_B(radv_legacy_sparse_binding, def, \ 703 "Enable legacy sparse binding (with implicit synchronization) on the graphics and compute queue") 704 705 /** 706 * Overrides for forcing re-compilation of pipelines when RADV_BUILD_ID_OVERRIDE is enabled. 707 * These need to be bumped every time a compiler bugfix is backported (up to 8 shader 708 * versions are supported). 709 */ 710 #define DRI_CONF_RADV_OVERRIDE_GRAPHICS_SHADER_VERSION(def) \ 711 DRI_CONF_OPT_I(radv_override_graphics_shader_version, def, 0, 7, \ 712 "Override the shader version of graphics pipelines to force re-compilation. (0 = default)") 713 714 #define DRI_CONF_RADV_OVERRIDE_COMPUTE_SHADER_VERSION(def) \ 715 DRI_CONF_OPT_I(radv_override_compute_shader_version, def, 0, 7, \ 716 "Override the shader version of compute pipelines to force re-compilation. (0 = default)") 717 718 #define DRI_CONF_RADV_OVERRIDE_RAY_TRACING_SHADER_VERSION(def) \ 719 DRI_CONF_OPT_I(radv_override_ray_tracing_shader_version, def, 0, 7, \ 720 "Override the shader version of ray tracing pipelines to force re-compilation. (0 = default)") 721 722 #define DRI_CONF_RADV_APP_LAYER() DRI_CONF_OPT_S_NODEF(radv_app_layer, "Select an application layer.") 723 724 #define DRI_CONF_RADV_CLEAR_LDS(def) \ 725 DRI_CONF_OPT_B(radv_clear_lds, def, "Clear LDS at the end of shaders. Might decrease performance.") 726 727 #define DRI_CONF_RADV_FORCE_ACTIVE_ACCEL_STRUCT_LEAVES(def) \ 728 DRI_CONF_OPT_B(radv_force_active_accel_struct_leaves, def, \ 729 "Force leaf nodes of acceleration structures to be marked active.") 730 731 #define DRI_CONF_RADV_DISABLE_NGG_GS(def) \ 732 DRI_CONF_OPT_B(radv_disable_ngg_gs, def, "Disable NGG GS on GFX10/GFX10.3.") 733 734 /** 735 * \brief ANV specific configuration options 736 */ 737 738 #define DRI_CONF_ANV_ASSUME_FULL_SUBGROUPS(def) \ 739 DRI_CONF_OPT_I(anv_assume_full_subgroups, def, 0, 32, \ 740 "Allow assuming full subgroups requirement even when it's not specified explicitly and set the given size") 741 742 #define DRI_CONF_ANV_SAMPLE_MASK_OUT_OPENGL_BEHAVIOUR(def) \ 743 DRI_CONF_OPT_B(anv_sample_mask_out_opengl_behaviour, def, \ 744 "Ignore sample mask out when having single sampled target") 745 746 #define DRI_CONF_ANV_FORCE_FILTER_ADDR_ROUNDING(def) \ 747 DRI_CONF_OPT_B(anv_force_filter_addr_rounding, def, \ 748 "Force min/mag filter address rounding to be enabled even for NEAREST sampling") 749 750 #define DRI_CONF_ANV_MESH_CONV_PRIM_ATTRS_TO_VERT_ATTRS(def) \ 751 DRI_CONF_OPT_E(anv_mesh_conv_prim_attrs_to_vert_attrs, def, -2, 2, \ 752 "Apply workaround for gfx12.5 per-prim attribute corruption HW bug", \ 753 DRI_CONF_ENUM(-2, "enable attribute conversion and vertex duplication ONLY if needed") \ 754 DRI_CONF_ENUM(-1, "enable attribute conversion ONLY if needed") \ 755 DRI_CONF_ENUM(0, "disable workaround") \ 756 DRI_CONF_ENUM(1, "enable attribute conversion ALWAYS") \ 757 DRI_CONF_ENUM(2, "enable attribute conversion and vertex duplication ALWAYS") ) 758 759 #define DRI_CONF_ANV_FP64_WORKAROUND_ENABLED(def) \ 760 DRI_CONF_OPT_B(fp64_workaround_enabled, def, \ 761 "Use softpf64 when the shader uses float64, but the device doesn't support that type") 762 763 #define DRI_CONF_ANV_GENERATED_INDIRECT_THRESHOLD(def) \ 764 DRI_CONF_OPT_I(generated_indirect_threshold, def, 0, INT32_MAX, \ 765 "Indirect threshold count above which we start generating commands") 766 767 #define DRI_CONF_ANV_GENERATED_INDIRECT_RING_THRESHOLD(def) \ 768 DRI_CONF_OPT_I(generated_indirect_ring_threshold, def, 0, INT32_MAX, \ 769 "Indirect threshold count above which we start generating commands in a ring buffer") 770 771 #define DRI_CONF_ANV_QUERY_CLEAR_WITH_BLORP_THRESHOLD(def) \ 772 DRI_CONF_OPT_I(query_clear_with_blorp_threshold, def, 0, INT32_MAX, \ 773 "Query threshold count above which query buffers are cleared with blorp") 774 775 #define DRI_CONF_ANV_QUERY_COPY_WITH_SHADER_THRESHOLD(def) \ 776 DRI_CONF_OPT_I(query_copy_with_shader_threshold, def, 0, INT32_MAX, \ 777 "Query threshold count above which query copies are executed with a shader") 778 779 #define DRI_CONF_ANV_FORCE_INDIRECT_DESCRIPTORS(def) \ 780 DRI_CONF_OPT_B(force_indirect_descriptors, def, \ 781 "Use an indirection to access buffer/image/texture/sampler handles") 782 783 #define DRI_CONF_ANV_DISABLE_FCV(def) \ 784 DRI_CONF_OPT_B(anv_disable_fcv, def, \ 785 "Disable FCV optimization") 786 787 #define DRI_CONF_ANV_EXTERNAL_MEMORY_IMPLICIT_SYNC(def) \ 788 DRI_CONF_OPT_B(anv_external_memory_implicit_sync, def, "Implicit sync on external BOs") 789 790 #define DRI_CONF_ANV_HASVK_OVERRIDE_API_VERSION(def) \ 791 DRI_CONF_OPT_B(hasvk_report_vk_1_3_version, def, \ 792 "Override intel_hasvk API version") 793 794 /** 795 * \brief DZN specific configuration options 796 */ 797 798 #define DRI_CONF_DZN_CLAIM_WIDE_LINES(def) \ 799 DRI_CONF_OPT_B(dzn_claim_wide_lines, def, "Claim wide line support") 800 801 #define DRI_CONF_DZN_ENABLE_8BIT_LOADS_STORES(def) \ 802 DRI_CONF_OPT_B(dzn_enable_8bit_loads_stores, def, "Enable VK_KHR_8bit_loads_stores") 803 804 #define DRI_CONF_DZN_DISABLE(def) \ 805 DRI_CONF_OPT_B(dzn_disable, def, "Fail instance creation") 806 807 #endif 808