Commit 6f3352b6 authored by Eric Anholt's avatar Eric Anholt Committed by Marge Bot

driconf: Stop quoting true/false in boolean option definitions.

Now that we're not trying to evade preprocessor macro expansion in
preprocessor string concatenation, we can use plain old bools in option
setup.
Reviewed-by: Eric Engestrom's avatarEric Engestrom <eric@engestrom.ch>
Part-of: <!6916>
parent 8a05d6ff
......@@ -608,19 +608,19 @@ radv_handle_per_app_options(struct radv_instance *instance,
static const driOptionDescription radv_dri_options[] = {
DRI_CONF_SECTION_PERFORMANCE
DRI_CONF_ADAPTIVE_SYNC("true")
DRI_CONF_ADAPTIVE_SYNC(true)
DRI_CONF_VK_X11_OVERRIDE_MIN_IMAGE_COUNT(0)
DRI_CONF_VK_X11_STRICT_IMAGE_COUNT("false")
DRI_CONF_VK_X11_ENSURE_MIN_IMAGE_COUNT("false")
DRI_CONF_RADV_REPORT_LLVM9_VERSION_STRING("false")
DRI_CONF_RADV_ENABLE_MRT_OUTPUT_NAN_FIXUP("false")
DRI_CONF_RADV_NO_DYNAMIC_BOUNDS("false")
DRI_CONF_VK_X11_STRICT_IMAGE_COUNT(false)
DRI_CONF_VK_X11_ENSURE_MIN_IMAGE_COUNT(false)
DRI_CONF_RADV_REPORT_LLVM9_VERSION_STRING(false)
DRI_CONF_RADV_ENABLE_MRT_OUTPUT_NAN_FIXUP(false)
DRI_CONF_RADV_NO_DYNAMIC_BOUNDS(false)
DRI_CONF_RADV_OVERRIDE_UNIFORM_OFFSET_ALIGNMENT(0)
DRI_CONF_SECTION_END
DRI_CONF_SECTION_DEBUG
DRI_CONF_OVERRIDE_VRAM_SIZE()
DRI_CONF_VK_WSI_FORCE_BGRA8_UNORM_FIRST("false")
DRI_CONF_VK_WSI_FORCE_BGRA8_UNORM_FIRST(false)
DRI_CONF_SECTION_END
};
......
// DriConf options supported by all Gallium DRI drivers.
DRI_CONF_SECTION_PERFORMANCE
DRI_CONF_MESA_GLTHREAD("false")
DRI_CONF_MESA_NO_ERROR("false")
DRI_CONF_DISABLE_EXT_BUFFER_AGE("false")
DRI_CONF_DISABLE_OML_SYNC_CONTROL("false")
DRI_CONF_DISABLE_SGI_VIDEO_SYNC("false")
DRI_CONF_MESA_GLTHREAD(false)
DRI_CONF_MESA_NO_ERROR(false)
DRI_CONF_DISABLE_EXT_BUFFER_AGE(false)
DRI_CONF_DISABLE_OML_SYNC_CONTROL(false)
DRI_CONF_DISABLE_SGI_VIDEO_SYNC(false)
DRI_CONF_SECTION_END
DRI_CONF_SECTION_QUALITY
......@@ -17,33 +17,33 @@ DRI_CONF_SECTION_QUALITY
DRI_CONF_SECTION_END
DRI_CONF_SECTION_DEBUG
DRI_CONF_FORCE_GLSL_EXTENSIONS_WARN("false")
DRI_CONF_DISABLE_GLSL_LINE_CONTINUATIONS("false")
DRI_CONF_DISABLE_BLEND_FUNC_EXTENDED("false")
DRI_CONF_DISABLE_ARB_GPU_SHADER5("false")
DRI_CONF_FORCE_GLSL_EXTENSIONS_WARN(false)
DRI_CONF_DISABLE_GLSL_LINE_CONTINUATIONS(false)
DRI_CONF_DISABLE_BLEND_FUNC_EXTENDED(false)
DRI_CONF_DISABLE_ARB_GPU_SHADER5(false)
DRI_CONF_FORCE_GLSL_VERSION(0)
DRI_CONF_ALLOW_GLSL_EXTENSION_DIRECTIVE_MIDSHADER("false")
DRI_CONF_ALLOW_GLSL_120_SUBSET_IN_110("false")
DRI_CONF_ALLOW_GLSL_BUILTIN_CONST_EXPRESSION("false")
DRI_CONF_ALLOW_GLSL_RELAXED_ES("false")
DRI_CONF_ALLOW_GLSL_BUILTIN_VARIABLE_REDECLARATION("false")
DRI_CONF_ALLOW_GLSL_CROSS_STAGE_INTERPOLATION_MISMATCH("false")
DRI_CONF_ALLOW_HIGHER_COMPAT_VERSION("false")
DRI_CONF_FORCE_GLSL_ABS_SQRT("false")
DRI_CONF_GLSL_CORRECT_DERIVATIVES_AFTER_DISCARD("false")
DRI_CONF_ALLOW_GLSL_LAYOUT_QUALIFIER_ON_FUNCTION_PARAMETERS("false")
DRI_CONF_ALLOW_DRAW_OUT_OF_ORDER("false")
DRI_CONF_FORCE_COMPAT_PROFILE("false")
DRI_CONF_FORCE_GL_NAMES_REUSE("false")
DRI_CONF_ALLOW_GLSL_EXTENSION_DIRECTIVE_MIDSHADER(false)
DRI_CONF_ALLOW_GLSL_120_SUBSET_IN_110(false)
DRI_CONF_ALLOW_GLSL_BUILTIN_CONST_EXPRESSION(false)
DRI_CONF_ALLOW_GLSL_RELAXED_ES(false)
DRI_CONF_ALLOW_GLSL_BUILTIN_VARIABLE_REDECLARATION(false)
DRI_CONF_ALLOW_GLSL_CROSS_STAGE_INTERPOLATION_MISMATCH(false)
DRI_CONF_ALLOW_HIGHER_COMPAT_VERSION(false)
DRI_CONF_FORCE_GLSL_ABS_SQRT(false)
DRI_CONF_GLSL_CORRECT_DERIVATIVES_AFTER_DISCARD(false)
DRI_CONF_ALLOW_GLSL_LAYOUT_QUALIFIER_ON_FUNCTION_PARAMETERS(false)
DRI_CONF_ALLOW_DRAW_OUT_OF_ORDER(false)
DRI_CONF_FORCE_COMPAT_PROFILE(false)
DRI_CONF_FORCE_GL_NAMES_REUSE(false)
DRI_CONF_FORCE_GL_VENDOR()
DRI_CONF_OVERRIDE_VRAM_SIZE()
DRI_CONF_SECTION_END
DRI_CONF_SECTION_MISCELLANEOUS
DRI_CONF_ALWAYS_HAVE_DEPTH_BUFFER("false")
DRI_CONF_GLSL_ZERO_INIT("false")
DRI_CONF_VS_POSITION_ALWAYS_INVARIANT("false")
DRI_CONF_ALLOW_RGB10_CONFIGS("true")
DRI_CONF_ALLOW_FP16_CONFIGS("false")
DRI_CONF_FORCE_INTEGER_TEX_NEAREST("false")
DRI_CONF_ALWAYS_HAVE_DEPTH_BUFFER(false)
DRI_CONF_GLSL_ZERO_INIT(false)
DRI_CONF_VS_POSITION_ALWAYS_INVARIANT(false)
DRI_CONF_ALLOW_RGB10_CONFIGS(true)
DRI_CONF_ALLOW_FP16_CONFIGS(false)
DRI_CONF_FORCE_INTEGER_TEX_NEAREST(false)
DRI_CONF_SECTION_END
// iris specific driconf options
DRI_CONF_SECTION_DEBUG
DRI_CONF_DUAL_COLOR_BLEND_BY_LOCATION("false")
DRI_CONF_DISABLE_THROTTLING("false")
DRI_CONF_ALWAYS_FLUSH_CACHE("false")
DRI_CONF_DUAL_COLOR_BLEND_BY_LOCATION(false)
DRI_CONF_DISABLE_THROTTLING(false)
DRI_CONF_ALWAYS_FLUSH_CACHE(false)
DRI_CONF_SECTION_END
DRI_CONF_SECTION_PERFORMANCE
......
// DriConf options specific to radeonsi
DRI_CONF_SECTION_PERFORMANCE
DRI_CONF_ADAPTIVE_SYNC("true")
DRI_CONF_RADEONSI_ASSUME_NO_Z_FIGHTS("false")
DRI_CONF_RADEONSI_COMMUTATIVE_BLEND_ADD("false")
DRI_CONF_RADEONSI_ZERO_ALL_VRAM_ALLOCS("false")
DRI_CONF_ADAPTIVE_SYNC(true)
DRI_CONF_RADEONSI_ASSUME_NO_Z_FIGHTS(false)
DRI_CONF_RADEONSI_COMMUTATIVE_BLEND_ADD(false)
DRI_CONF_RADEONSI_ZERO_ALL_VRAM_ALLOCS(false)
DRI_CONF_SECTION_END
DRI_CONF_SECTION_DEBUG
#define OPT_BOOL(name, dflt, description) DRI_CONF_OPT_B(radeonsi_##name, #dflt, description)
#define OPT_BOOL(name, dflt, description) DRI_CONF_OPT_B(radeonsi_##name, dflt, description)
#include "radeonsi/si_debug_options.h"
DRI_CONF_SECTION_END
// v3d-specific driconf options
DRI_CONF_SECTION_MISCELLANEOUS
DRI_CONF_V3D_NONMSAA_TEXTURE_SIZE_LIMIT("false")
DRI_CONF_V3D_NONMSAA_TEXTURE_SIZE_LIMIT(false)
DRI_CONF_SECTION_END
......@@ -7,7 +7,7 @@
// 4. Add the code to send the tweek to the host in virgl_send_tweaks
// 5. Implement the tweak in virglrenderer
DRI_CONF_SECTION_MISCELLANEOUS
DRI_CONF_GLES_EMULATE_BGRA("false")
DRI_CONF_GLES_APPLY_BGRA_DEST_SWIZZLE("false")
DRI_CONF_GLES_EMULATE_BGRA(false)
DRI_CONF_GLES_APPLY_BGRA_DEST_SWIZZLE(false)
DRI_CONF_GLES_SAMPLES_PASSED_VALUE(1024, 1, 400000000)
DRI_CONF_SECTION_END
......@@ -54,12 +54,12 @@ const driOptionDescription __driConfigOptionsNine[] = {
DRI_CONF_SECTION_NINE
DRI_CONF_NINE_OVERRIDEVENDOR(-1)
DRI_CONF_NINE_THROTTLE(-2)
DRI_CONF_NINE_THREADSUBMIT("false")
DRI_CONF_NINE_ALLOWDISCARDDELAYEDRELEASE("true")
DRI_CONF_NINE_TEARFREEDISCARD("false")
DRI_CONF_NINE_THREADSUBMIT(false)
DRI_CONF_NINE_ALLOWDISCARDDELAYEDRELEASE(true)
DRI_CONF_NINE_TEARFREEDISCARD(false)
DRI_CONF_NINE_CSMT(-1)
DRI_CONF_NINE_DYNAMICTEXTUREWORKAROUND("false")
DRI_CONF_NINE_SHADERINLINECONSTANTS("false")
DRI_CONF_NINE_DYNAMICTEXTUREWORKAROUND(false)
DRI_CONF_NINE_SHADERINLINECONSTANTS(false)
DRI_CONF_SECTION_END
};
......
......@@ -52,12 +52,12 @@
static const driOptionDescription anv_dri_options[] = {
DRI_CONF_SECTION_PERFORMANCE
DRI_CONF_VK_X11_OVERRIDE_MIN_IMAGE_COUNT(0)
DRI_CONF_VK_X11_STRICT_IMAGE_COUNT("false")
DRI_CONF_VK_X11_STRICT_IMAGE_COUNT(false)
DRI_CONF_SECTION_END
DRI_CONF_SECTION_DEBUG
DRI_CONF_ALWAYS_FLUSH_CACHE("false")
DRI_CONF_VK_WSI_FORCE_BGRA8_UNORM_FIRST("false")
DRI_CONF_ALWAYS_FLUSH_CACHE(false)
DRI_CONF_VK_WSI_FORCE_BGRA8_UNORM_FIRST(false)
DRI_CONF_SECTION_END
};
......
......@@ -53,23 +53,23 @@ static const driOptionDescription i915_driconf[] = {
DRI_CONF_ENUM(0, "Disable buffer object reuse")
DRI_CONF_ENUM(1, "Enable reuse of all sizes of buffer objects"))
DRI_CONF_OPT_B(fragment_shader, "true",
DRI_CONF_OPT_B(fragment_shader, true,
"Enable limited ARB_fragment_shader support on 915/945.")
DRI_CONF_SECTION_END
DRI_CONF_SECTION_QUALITY
DRI_CONF_SECTION_END
DRI_CONF_SECTION_DEBUG
DRI_CONF_ALWAYS_FLUSH_BATCH("false")
DRI_CONF_ALWAYS_FLUSH_CACHE("false")
DRI_CONF_DISABLE_THROTTLING("false")
DRI_CONF_FORCE_GLSL_EXTENSIONS_WARN("false")
DRI_CONF_DISABLE_GLSL_LINE_CONTINUATIONS("false")
DRI_CONF_DISABLE_BLEND_FUNC_EXTENDED("false")
DRI_CONF_ALWAYS_FLUSH_BATCH(false)
DRI_CONF_ALWAYS_FLUSH_CACHE(false)
DRI_CONF_DISABLE_THROTTLING(false)
DRI_CONF_FORCE_GLSL_EXTENSIONS_WARN(false)
DRI_CONF_DISABLE_GLSL_LINE_CONTINUATIONS(false)
DRI_CONF_DISABLE_BLEND_FUNC_EXTENDED(false)
DRI_CONF_OPT_B(stub_occlusion_query, "false", "Enable stub ARB_occlusion_query support on 915/945.")
DRI_CONF_OPT_B(stub_occlusion_query, false, "Enable stub ARB_occlusion_query support on 915/945.")
DRI_CONF_OPT_B(shader_precompile, "true", "Perform code generation at shader link time.")
DRI_CONF_OPT_B(shader_precompile, true, "Perform code generation at shader link time.")
DRI_CONF_SECTION_END
};
......
......@@ -58,12 +58,12 @@ static const driOptionDescription brw_driconf[] = {
"Buffer object reuse",
DRI_CONF_ENUM(0, "Disable buffer object reuse")
DRI_CONF_ENUM(1, "Enable reuse of all sizes of buffer objects"))
DRI_CONF_MESA_NO_ERROR("false")
DRI_CONF_MESA_GLTHREAD("false")
DRI_CONF_MESA_NO_ERROR(false)
DRI_CONF_MESA_GLTHREAD(false)
DRI_CONF_SECTION_END
DRI_CONF_SECTION_QUALITY
DRI_CONF_PRECISE_TRIG("false")
DRI_CONF_PRECISE_TRIG(false)
DRI_CONF_OPT_I(clamp_max_samples, -1, 0, 0,
"Clamp the value of GL_MAX_SAMPLES to the "
......@@ -71,31 +71,31 @@ static const driOptionDescription brw_driconf[] = {
DRI_CONF_SECTION_END
DRI_CONF_SECTION_DEBUG
DRI_CONF_ALWAYS_FLUSH_BATCH("false")
DRI_CONF_ALWAYS_FLUSH_CACHE("false")
DRI_CONF_DISABLE_THROTTLING("false")
DRI_CONF_FORCE_GLSL_EXTENSIONS_WARN("false")
DRI_CONF_ALWAYS_FLUSH_BATCH(false)
DRI_CONF_ALWAYS_FLUSH_CACHE(false)
DRI_CONF_DISABLE_THROTTLING(false)
DRI_CONF_FORCE_GLSL_EXTENSIONS_WARN(false)
DRI_CONF_FORCE_GLSL_VERSION(0)
DRI_CONF_DISABLE_GLSL_LINE_CONTINUATIONS("false")
DRI_CONF_DISABLE_BLEND_FUNC_EXTENDED("false")
DRI_CONF_DUAL_COLOR_BLEND_BY_LOCATION("false")
DRI_CONF_ALLOW_GLSL_EXTENSION_DIRECTIVE_MIDSHADER("false")
DRI_CONF_ALLOW_GLSL_BUILTIN_VARIABLE_REDECLARATION("false")
DRI_CONF_ALLOW_GLSL_CROSS_STAGE_INTERPOLATION_MISMATCH("false")
DRI_CONF_ALLOW_HIGHER_COMPAT_VERSION("false")
DRI_CONF_FORCE_COMPAT_PROFILE("false")
DRI_CONF_FORCE_GLSL_ABS_SQRT("false")
DRI_CONF_DISABLE_GLSL_LINE_CONTINUATIONS(false)
DRI_CONF_DISABLE_BLEND_FUNC_EXTENDED(false)
DRI_CONF_DUAL_COLOR_BLEND_BY_LOCATION(false)
DRI_CONF_ALLOW_GLSL_EXTENSION_DIRECTIVE_MIDSHADER(false)
DRI_CONF_ALLOW_GLSL_BUILTIN_VARIABLE_REDECLARATION(false)
DRI_CONF_ALLOW_GLSL_CROSS_STAGE_INTERPOLATION_MISMATCH(false)
DRI_CONF_ALLOW_HIGHER_COMPAT_VERSION(false)
DRI_CONF_FORCE_COMPAT_PROFILE(false)
DRI_CONF_FORCE_GLSL_ABS_SQRT(false)
DRI_CONF_FORCE_GL_VENDOR()
DRI_CONF_OPT_B(shader_precompile, "true", "Perform code generation at shader link time.")
DRI_CONF_OPT_B(shader_precompile, true, "Perform code generation at shader link time.")
DRI_CONF_SECTION_END
DRI_CONF_SECTION_MISCELLANEOUS
DRI_CONF_GLSL_ZERO_INIT("false")
DRI_CONF_VS_POSITION_ALWAYS_INVARIANT("false")
DRI_CONF_ALLOW_RGB10_CONFIGS("false")
DRI_CONF_ALLOW_RGB565_CONFIGS("true")
DRI_CONF_ALLOW_FP16_CONFIGS("false")
DRI_CONF_GLSL_ZERO_INIT(false)
DRI_CONF_VS_POSITION_ALWAYS_INVARIANT(false)
DRI_CONF_ALLOW_RGB10_CONFIGS(false)
DRI_CONF_ALLOW_RGB565_CONFIGS(true)
DRI_CONF_ALLOW_FP16_CONFIGS(false)
DRI_CONF_SECTION_END
};
......
......@@ -96,13 +96,13 @@ static const driOptionDescription radeon_driconf[] = {
DRI_CONF_TCL_MODE(DRI_CONF_TCL_CODEGEN)
DRI_CONF_FTHROTTLE_MODE(DRI_CONF_FTHROTTLE_IRQS)
DRI_CONF_MAX_TEXTURE_UNITS(3,2,3)
DRI_CONF_HYPERZ("false")
DRI_CONF_HYPERZ(false)
DRI_CONF_COMMAND_BUFFER_SIZE(8, 8, 32)
DRI_CONF_SECTION_END
DRI_CONF_SECTION_QUALITY
DRI_CONF_TEXTURE_DEPTH(DRI_CONF_TEXTURE_DEPTH_FB)
DRI_CONF_DEF_MAX_ANISOTROPY(1.0, 1.0, 16.0)
DRI_CONF_NO_NEG_LOD_BIAS("false")
DRI_CONF_NO_NEG_LOD_BIAS(false)
DRI_CONF_COLOR_REDUCTION(DRI_CONF_COLOR_REDUCTION_DITHER)
DRI_CONF_ROUND_MODE(DRI_CONF_ROUND_TRUNC)
DRI_CONF_DITHER_MODE(DRI_CONF_DITHER_XERRORDIFF)
......@@ -115,13 +115,13 @@ static const driOptionDescription radeon_driconf[] = {
DRI_CONF_TCL_MODE(DRI_CONF_TCL_CODEGEN)
DRI_CONF_FTHROTTLE_MODE(DRI_CONF_FTHROTTLE_IRQS)
DRI_CONF_MAX_TEXTURE_UNITS(6,2,6)
DRI_CONF_HYPERZ("false")
DRI_CONF_HYPERZ(false)
DRI_CONF_COMMAND_BUFFER_SIZE(8, 8, 32)
DRI_CONF_SECTION_END
DRI_CONF_SECTION_QUALITY
DRI_CONF_TEXTURE_DEPTH(DRI_CONF_TEXTURE_DEPTH_FB)
DRI_CONF_DEF_MAX_ANISOTROPY(1.0, 1.0, 16.0)
DRI_CONF_NO_NEG_LOD_BIAS("false")
DRI_CONF_NO_NEG_LOD_BIAS(false)
DRI_CONF_COLOR_REDUCTION(DRI_CONF_COLOR_REDUCTION_DITHER)
DRI_CONF_ROUND_MODE(DRI_CONF_ROUND_TRUNC)
DRI_CONF_DITHER_MODE(DRI_CONF_DITHER_XERRORDIFF)
......
......@@ -75,7 +75,7 @@
.name = #_name, \
.type = DRI_BOOL, \
}, \
.value = { ._string = (char *)def }, \
.value = { ._bool = def }, \
},
#define DRI_CONF_OPT_I(_name, def, min, max, _desc) { \
......
......@@ -49,8 +49,8 @@ TEST_F(xmlconfig_test, bools)
{
driOptionDescription driconf[] = {
DRI_CONF_SECTION_MISCELLANEOUS
DRI_CONF_GLSL_ZERO_INIT("false")
DRI_CONF_ALWAYS_HAVE_DEPTH_BUFFER("true")
DRI_CONF_GLSL_ZERO_INIT(false)
DRI_CONF_ALWAYS_HAVE_DEPTH_BUFFER(true)
};
driParseOptionInfo(&options, driconf, ARRAY_SIZE(driconf));
......@@ -106,8 +106,8 @@ TEST_F(xmlconfig_test, check_option)
{
driOptionDescription driconf[] = {
DRI_CONF_SECTION_MISCELLANEOUS
DRI_CONF_GLSL_ZERO_INIT("true")
DRI_CONF_ALWAYS_HAVE_DEPTH_BUFFER("true")
DRI_CONF_GLSL_ZERO_INIT(true)
DRI_CONF_ALWAYS_HAVE_DEPTH_BUFFER(true)
};
driParseOptionInfo(&options, driconf, ARRAY_SIZE(driconf));
......@@ -125,7 +125,7 @@ TEST_F(xmlconfig_test, copy_cache)
{
driOptionDescription driconf[] = {
DRI_CONF_SECTION_MISCELLANEOUS
DRI_CONF_OPT_B(mesa_b_option, "true", "description")
DRI_CONF_OPT_B(mesa_b_option, true, "description")
DRI_CONF_OPT_S(mesa_s_option, value, "description")
};
driParseOptionInfo(&options, driconf, ARRAY_SIZE(driconf));
......
......@@ -436,12 +436,7 @@ driParseOptionInfo(driOptionCache *info,
switch (opt->info.type) {
case DRI_BOOL:
if (strcmp(opt->value._string, "true") == 0)
optval->_bool = true;
else {
assert(strcmp(opt->value._string, "false") == 0);
optval->_bool = false;
}
optval->_bool = opt->value._bool;
break;
case DRI_INT:
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment