dri: Optionally turn off a couple of GLX extensions based on driconf options
[mesa.git] / src / mesa / drivers / dri / common / xmlpool / t_options.h
index 7b441c68f2dad8c84e7fc3119952be1ae5e19574..8a7d04f00ff2e3add3aa7dfb82be2962498a9634 100644 (file)
@@ -56,45 +56,80 @@ DRI_CONF_SECTION_BEGIN \
        DRI_CONF_DESC(en,gettext("Debugging"))
 
 #define DRI_CONF_NO_RAST(def) \
-DRI_CONF_OPT_BEGIN(no_rast,bool,def) \
+DRI_CONF_OPT_BEGIN_B(no_rast, def) \
         DRI_CONF_DESC(en,gettext("Disable 3D acceleration")) \
 DRI_CONF_OPT_END
 
 #define DRI_CONF_PERFORMANCE_BOXES(def) \
-DRI_CONF_OPT_BEGIN(performance_boxes,bool,def) \
+DRI_CONF_OPT_BEGIN_B(performance_boxes, def) \
         DRI_CONF_DESC(en,gettext("Show performance boxes")) \
 DRI_CONF_OPT_END
 
 #define DRI_CONF_ALWAYS_FLUSH_BATCH(def) \
-DRI_CONF_OPT_BEGIN(always_flush_batch,bool,def) \
+DRI_CONF_OPT_BEGIN_B(always_flush_batch, def) \
         DRI_CONF_DESC(en,gettext("Enable flushing batchbuffer after each draw call")) \
 DRI_CONF_OPT_END
 
 #define DRI_CONF_ALWAYS_FLUSH_CACHE(def) \
-DRI_CONF_OPT_BEGIN(always_flush_cache,bool,def) \
+DRI_CONF_OPT_BEGIN_B(always_flush_cache, def) \
         DRI_CONF_DESC(en,gettext("Enable flushing GPU caches with each draw call")) \
 DRI_CONF_OPT_END
 
 #define DRI_CONF_DISABLE_THROTTLING(def) \
-DRI_CONF_OPT_BEGIN(disable_throttling,bool,def) \
+DRI_CONF_OPT_BEGIN_B(disable_throttling, def) \
        DRI_CONF_DESC(en,gettext("Disable throttling on first batch after flush")) \
 DRI_CONF_OPT_END
 
 #define DRI_CONF_FORCE_GLSL_EXTENSIONS_WARN(def) \
-DRI_CONF_OPT_BEGIN(force_glsl_extensions_warn,bool,def) \
+DRI_CONF_OPT_BEGIN_B(force_glsl_extensions_warn, def) \
         DRI_CONF_DESC(en,gettext("Force GLSL extension default behavior to 'warn'")) \
 DRI_CONF_OPT_END
 
 #define DRI_CONF_DISABLE_BLEND_FUNC_EXTENDED(def) \
-DRI_CONF_OPT_BEGIN(disable_blend_func_extended,bool,def) \
+DRI_CONF_OPT_BEGIN_B(disable_blend_func_extended, def) \
         DRI_CONF_DESC(en,gettext("Disable dual source blending")) \
 DRI_CONF_OPT_END
 
+#define DRI_CONF_DUAL_COLOR_BLEND_BY_LOCATION(def) \
+DRI_CONF_OPT_BEGIN_B(dual_color_blend_by_location, def) \
+        DRI_CONF_DESC(en,gettext("Identify dual color blending sources by location rather than index")) \
+DRI_CONF_OPT_END
+
 #define DRI_CONF_DISABLE_GLSL_LINE_CONTINUATIONS(def) \
-DRI_CONF_OPT_BEGIN(disable_glsl_line_continuations,bool,def) \
+DRI_CONF_OPT_BEGIN_B(disable_glsl_line_continuations, def) \
         DRI_CONF_DESC(en,gettext("Disable backslash-based line continuations in GLSL source")) \
 DRI_CONF_OPT_END
 
+#define DRI_CONF_DISABLE_SHADER_BIT_ENCODING(def) \
+DRI_CONF_OPT_BEGIN_B(disable_shader_bit_encoding, def) \
+        DRI_CONF_DESC(en,gettext("Disable GL_ARB_shader_bit_encoding")) \
+DRI_CONF_OPT_END
+
+#define DRI_CONF_FORCE_GLSL_VERSION(def) \
+DRI_CONF_OPT_BEGIN_V(force_glsl_version, int, def, "0:999") \
+        DRI_CONF_DESC(en,gettext("Force a default GLSL version for shaders that lack an explicit #version line")) \
+DRI_CONF_OPT_END
+
+#define DRI_CONF_ALLOW_GLSL_EXTENSION_DIRECTIVE_MIDSHADER(def) \
+DRI_CONF_OPT_BEGIN_B(allow_glsl_extension_directive_midshader, def) \
+        DRI_CONF_DESC(en,gettext("Allow GLSL #extension directives in the middle of shaders")) \
+DRI_CONF_OPT_END
+
+#define DRI_CONF_ALLOW_GLSL_BUILTIN_VARIABLE_REDECLARATION(def) \
+DRI_CONF_OPT_BEGIN_B(allow_glsl_builtin_variable_redeclaration, def) \
+        DRI_CONF_DESC(en,gettext("Allow GLSL built-in variables to be redeclared verbatim")) \
+DRI_CONF_OPT_END
+
+#define DRI_CONF_ALLOW_HIGHER_COMPAT_VERSION(def) \
+DRI_CONF_OPT_BEGIN_B(allow_higher_compat_version, def) \
+        DRI_CONF_DESC(en,gettext("Allow a higher compat profile (version 3.1+) for apps that request it")) \
+DRI_CONF_OPT_END
+
+#define DRI_CONF_FORCE_GLSL_ABS_SQRT(def) \
+DRI_CONF_OPT_BEGIN_B(force_glsl_abs_sqrt, def) \
+        DRI_CONF_DESC(en,gettext("Force computing the absolute value for sqrt() and inversesqrt()")) \
+DRI_CONF_OPT_END
+
 
 
 /**
@@ -105,7 +140,7 @@ DRI_CONF_SECTION_BEGIN \
        DRI_CONF_DESC(en,gettext("Image Quality"))
 
 #define DRI_CONF_EXCESS_MIPMAP(def) \
-DRI_CONF_OPT_BEGIN(excess_mipmap,bool,def) \
+DRI_CONF_OPT_BEGIN_B(excess_mipmap, def) \
        DRI_CONF_DESC(en,"Enable extra mipmap level") \
 DRI_CONF_OPT_END
 
@@ -129,15 +164,20 @@ DRI_CONF_OPT_BEGIN_V(def_max_anisotropy,float,def,range) \
 DRI_CONF_OPT_END
 
 #define DRI_CONF_NO_NEG_LOD_BIAS(def) \
-DRI_CONF_OPT_BEGIN(no_neg_lod_bias,bool,def) \
+DRI_CONF_OPT_BEGIN_B(no_neg_lod_bias, def) \
         DRI_CONF_DESC(en,gettext("Forbid negative texture LOD bias")) \
 DRI_CONF_OPT_END
 
 #define DRI_CONF_FORCE_S3TC_ENABLE(def) \
-DRI_CONF_OPT_BEGIN(force_s3tc_enable,bool,def) \
+DRI_CONF_OPT_BEGIN_B(force_s3tc_enable, def) \
         DRI_CONF_DESC(en,gettext("Enable S3TC texture compression even if software support is not available")) \
 DRI_CONF_OPT_END
 
+#define DRI_CONF_PRECISE_TRIG(def) \
+DRI_CONF_OPT_BEGIN_B(precise_trig, def) \
+        DRI_CONF_DESC(en,gettext("Prefer accuracy over performance in trig functions")) \
+DRI_CONF_OPT_END
+
 #define DRI_CONF_COLOR_REDUCTION_ROUND 0
 #define DRI_CONF_COLOR_REDUCTION_DITHER 1
 #define DRI_CONF_COLOR_REDUCTION(def) \
@@ -171,7 +211,7 @@ DRI_CONF_OPT_BEGIN_V(dither_mode,enum,def,"0:2") \
 DRI_CONF_OPT_END
 
 #define DRI_CONF_FLOAT_DEPTH(def) \
-DRI_CONF_OPT_BEGIN(float_depth,bool,def) \
+DRI_CONF_OPT_BEGIN_B(float_depth, def) \
         DRI_CONF_DESC(en,gettext("Floating point depth buffer")) \
 DRI_CONF_OPT_END
 
@@ -257,7 +297,7 @@ DRI_CONF_OPT_END
 #define DRI_CONF_HYPERZ_DISABLED 0
 #define DRI_CONF_HYPERZ_ENABLED 1
 #define DRI_CONF_HYPERZ(def) \
-DRI_CONF_OPT_BEGIN(hyperz,bool,def) \
+DRI_CONF_OPT_BEGIN_B(hyperz, def) \
         DRI_CONF_DESC(en,gettext("Use HyperZ to boost performance")) \
 DRI_CONF_OPT_END
 
@@ -266,15 +306,6 @@ DRI_CONF_OPT_BEGIN_V(texture_units,int,def, # min ":" # max ) \
         DRI_CONF_DESC(en,gettext("Number of texture units used")) \
 DRI_CONF_OPT_END
 
-#define DRI_CONF_ALLOW_LARGE_TEXTURES(def) \
-DRI_CONF_OPT_BEGIN_V(allow_large_textures,enum,def,"0:2") \
-       DRI_CONF_DESC_BEGIN(en,gettext("Support larger textures not guaranteed to fit into graphics memory")) \
-               DRI_CONF_ENUM(0,gettext("No")) \
-               DRI_CONF_ENUM(1,gettext("At least 1 texture must fit under worst-case assumptions")) \
-               DRI_CONF_ENUM(2,gettext("Announce hardware limits")) \
-       DRI_CONF_DESC_END \
-DRI_CONF_OPT_END
-
 #define DRI_CONF_TEXTURE_BLEND_QUALITY(def,range) \
 DRI_CONF_OPT_BEGIN_V(texture_blend_quality,float,def,range) \
        DRI_CONF_DESC(en,gettext("Texture filtering quality vs. speed, AKA “brilinear” texture filtering")) \
@@ -292,6 +323,20 @@ DRI_CONF_OPT_BEGIN_V(texture_heaps,enum,def,"0:2") \
        DRI_CONF_DESC_END \
 DRI_CONF_OPT_END
 
+#define DRI_CONF_MESA_GLTHREAD(def) \
+DRI_CONF_OPT_BEGIN_B(mesa_glthread, def) \
+        DRI_CONF_DESC(en,gettext("Enable offloading GL driver work to a separate thread")) \
+DRI_CONF_OPT_END
+
+#define DRI_CONF_DISABLE_EXT_BUFFER_AGE(def) \
+DRI_CONF_OPT_BEGIN_B(glx_disable_ext_buffer_age, def) \
+   DRI_CONF_DESC(en, gettext("Disable the GLX_EXT_buffer_age extension")) \
+DRI_CONF_OPT_END
+
+#define DRI_CONF_DISABLE_OML_SYNC_CONTROL(def) \
+DRI_CONF_OPT_BEGIN_B(glx_disable_oml_sync_control, def) \
+   DRI_CONF_DESC(en, gettext("Disable the GLX_OML_sync_control extension")) \
+DRI_CONF_OPT_END
 
 
 /**
@@ -303,7 +348,7 @@ DRI_CONF_SECTION_BEGIN \
         DRI_CONF_DESC(en,gettext("Features that are not hardware-accelerated"))
 
 #define DRI_CONF_ARB_VERTEX_PROGRAM(def) \
-DRI_CONF_OPT_BEGIN(arb_vertex_program,bool,def) \
+DRI_CONF_OPT_BEGIN_B(arb_vertex_program, def) \
         DRI_CONF_DESC(en,gettext("Enable extension GL_ARB_vertex_program")) \
 DRI_CONF_OPT_END
 
@@ -317,6 +362,61 @@ DRI_CONF_SECTION_BEGIN \
         DRI_CONF_DESC(en,gettext("Miscellaneous"))
 
 #define DRI_CONF_ALWAYS_HAVE_DEPTH_BUFFER(def) \
-DRI_CONF_OPT_BEGIN(always_have_depth_buffer, bool, def) \
+DRI_CONF_OPT_BEGIN_B(always_have_depth_buffer, def) \
         DRI_CONF_DESC(en,gettext("Create all visuals with a depth buffer")) \
 DRI_CONF_OPT_END
+
+#define DRI_CONF_GLSL_ZERO_INIT(def) \
+DRI_CONF_OPT_BEGIN_B(glsl_zero_init, def) \
+        DRI_CONF_DESC(en,gettext("Force uninitialized variables to default to zero")) \
+DRI_CONF_OPT_END
+
+/**
+ * \brief Initialization configuration options
+ */
+#define DRI_CONF_SECTION_INITIALIZATION \
+DRI_CONF_SECTION_BEGIN \
+        DRI_CONF_DESC(en,gettext("Initialization"))
+
+#define DRI_CONF_DEVICE_ID_PATH_TAG(def) \
+DRI_CONF_OPT_BEGIN(device_id, string, def) \
+        DRI_CONF_DESC(en,gettext("Define the graphic device to use if possible")) \
+DRI_CONF_OPT_END
+
+/**
+ * \brief Gallium-Nine specific configuration options
+ */
+
+#define DRI_CONF_SECTION_NINE \
+DRI_CONF_SECTION_BEGIN \
+        DRI_CONF_DESC(en,gettext("Gallium Nine"))
+
+#define DRI_CONF_NINE_THROTTLE(def) \
+DRI_CONF_OPT_BEGIN(throttle_value, int, def) \
+        DRI_CONF_DESC(en,gettext("Define the throttling value. -1 for no throttling, -2 for default (usually 2), 0 for glfinish behaviour")) \
+DRI_CONF_OPT_END
+
+#define DRI_CONF_NINE_THREADSUBMIT(def) \
+DRI_CONF_OPT_BEGIN_B(thread_submit, def) \
+        DRI_CONF_DESC(en,gettext("Use an additional thread to submit buffers.")) \
+DRI_CONF_OPT_END
+
+#define DRI_CONF_NINE_OVERRIDEVENDOR(def) \
+DRI_CONF_OPT_BEGIN(override_vendorid, int, def) \
+        DRI_CONF_DESC(en,gettext("Define the vendor_id to report. This allows faking another hardware vendor.")) \
+DRI_CONF_OPT_END
+
+#define DRI_CONF_NINE_ALLOWDISCARDDELAYEDRELEASE(def) \
+DRI_CONF_OPT_BEGIN_B(discard_delayed_release, def) \
+        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).")) \
+DRI_CONF_OPT_END
+
+#define DRI_CONF_NINE_TEARFREEDISCARD(def) \
+DRI_CONF_OPT_BEGIN_B(tearfree_discard, def) \
+        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.")) \
+DRI_CONF_OPT_END
+
+#define DRI_CONF_NINE_CSMT(def) \
+DRI_CONF_OPT_BEGIN(csmt_force, int, def) \
+        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.")) \
+DRI_CONF_OPT_END