[Mesa-dev] [PATCH 11/16] driconf: start sharing DisableBlendFuncExtended

Martin Peres martin.peres at linux.intel.com
Fri Jun 5 06:04:05 PDT 2015


This has the side effect of enabling this option for the intel i830,
nouveau_vieux, classic swrast, and the classic radeon drivers.

Signed-off-by: Martin Peres <martin.peres at linux.intel.com>
---
 src/gallium/include/state_tracker/st_api.h  | 1 -
 src/gallium/state_trackers/dri/dri_screen.c | 3 ---
 src/gallium/state_trackers/osmesa/osmesa.c  | 1 -
 src/mesa/drivers/dri/common/xmlpool.h       | 3 ++-
 src/mesa/drivers/dri/i915/intel_screen.c    | 1 -
 src/mesa/drivers/dri/i965/intel_screen.c    | 1 -
 src/mesa/main/extensions.c                  | 6 ++++++
 src/mesa/main/shared_options.c              | 3 +++
 src/mesa/main/shared_options.h              | 6 ++++++
 src/mesa/state_tracker/st_extensions.c      | 3 +--
 10 files changed, 18 insertions(+), 10 deletions(-)

diff --git a/src/gallium/include/state_tracker/st_api.h b/src/gallium/include/state_tracker/st_api.h
index f6aade2..bf4d2c9 100644
--- a/src/gallium/include/state_tracker/st_api.h
+++ b/src/gallium/include/state_tracker/st_api.h
@@ -244,7 +244,6 @@ struct st_config_options
    /** The screen's effective configuration options */
    struct shared_options shared_options;
 
-   boolean disable_blend_func_extended;
    boolean disable_shader_bit_encoding;
    boolean force_s3tc_enable;
 };
diff --git a/src/gallium/state_trackers/dri/dri_screen.c b/src/gallium/state_trackers/dri/dri_screen.c
index 69c5369..a94fe08 100644
--- a/src/gallium/state_trackers/dri/dri_screen.c
+++ b/src/gallium/state_trackers/dri/dri_screen.c
@@ -70,7 +70,6 @@ const __DRIconfigOptionsExtension gallium_config_options = {
 
       DRI_CONF_SECTION_DEBUG
          DRI_CONF_SECTION_DEBUG_SHARED
-         DRI_CONF_DISABLE_BLEND_FUNC_EXTENDED("false")
          DRI_CONF_DISABLE_SHADER_BIT_ENCODING("false")
       DRI_CONF_SECTION_END
 
@@ -89,8 +88,6 @@ dri_fill_st_options(struct st_config_options *options,
 {
    _mesa_shared_options_fill(optionCache, &options->shared_options);
 
-   options->disable_blend_func_extended =
-      driQueryOptionb(optionCache, "disable_blend_func_extended");
    options->disable_shader_bit_encoding =
       driQueryOptionb(optionCache, "disable_shader_bit_encoding");
    options->force_s3tc_enable =
diff --git a/src/gallium/state_trackers/osmesa/osmesa.c b/src/gallium/state_trackers/osmesa/osmesa.c
index 6478af8..d1a04ed 100644
--- a/src/gallium/state_trackers/osmesa/osmesa.c
+++ b/src/gallium/state_trackers/osmesa/osmesa.c
@@ -585,7 +585,6 @@ OSMesaCreateContextExt(GLenum format, GLint depthBits, GLint stencilBits,
    attribs.major = 2;
    attribs.minor = 1;
    attribs.flags = 0;  /* ST_CONTEXT_FLAG_x */
-   attribs.options.disable_blend_func_extended = FALSE;
    attribs.options.disable_shader_bit_encoding = FALSE;
    attribs.options.force_s3tc_enable = FALSE;
    _mesa_shared_options_fill_defaults(&attribs.options.shared_options);
diff --git a/src/mesa/drivers/dri/common/xmlpool.h b/src/mesa/drivers/dri/common/xmlpool.h
index f14377f..b6ddaa6 100644
--- a/src/mesa/drivers/dri/common/xmlpool.h
+++ b/src/mesa/drivers/dri/common/xmlpool.h
@@ -113,7 +113,8 @@
    DRI_CONF_FORCE_GLSL_VERSION(0) \
    DRI_CONF_ALLOW_GLSL_EXTENSION_DIRECTIVE_MIDSHADER("false") \
    DRI_CONF_DISABLE_GLSL_LINE_CONTINUATIONS("false") \
-   DRI_CONF_EXTENSION_OVERRIDE()
+   DRI_CONF_EXTENSION_OVERRIDE() \
+   DRI_CONF_DISABLE_BLEND_FUNC_EXTENDED("false")
 
 #define DRI_CONF_SECTION_MISC_SHARED \
    "<!-- No shared msic options yet -->\n"
diff --git a/src/mesa/drivers/dri/i915/intel_screen.c b/src/mesa/drivers/dri/i915/intel_screen.c
index 91ec6c3..b97756b 100644
--- a/src/mesa/drivers/dri/i915/intel_screen.c
+++ b/src/mesa/drivers/dri/i915/intel_screen.c
@@ -74,7 +74,6 @@ DRI_CONF_BEGIN
       DRI_CONF_ALWAYS_FLUSH_BATCH("false")
       DRI_CONF_ALWAYS_FLUSH_CACHE("false")
       DRI_CONF_DISABLE_THROTTLING("false")
-      DRI_CONF_DISABLE_BLEND_FUNC_EXTENDED("false")
 
       DRI_CONF_OPT_BEGIN_B(shader_precompile, "true")
 	 DRI_CONF_DESC(en, "Perform code generation at shader link time.")
diff --git a/src/mesa/drivers/dri/i965/intel_screen.c b/src/mesa/drivers/dri/i965/intel_screen.c
index 017d638..ed5d998 100644
--- a/src/mesa/drivers/dri/i965/intel_screen.c
+++ b/src/mesa/drivers/dri/i965/intel_screen.c
@@ -81,7 +81,6 @@ DRI_CONF_BEGIN
       DRI_CONF_ALWAYS_FLUSH_BATCH("false")
       DRI_CONF_ALWAYS_FLUSH_CACHE("false")
       DRI_CONF_DISABLE_THROTTLING("false")
-      DRI_CONF_DISABLE_BLEND_FUNC_EXTENDED("false")
 
       DRI_CONF_OPT_BEGIN_B(shader_precompile, "true")
 	 DRI_CONF_DESC(en, "Perform code generation at shader link time.")
diff --git a/src/mesa/main/extensions.c b/src/mesa/main/extensions.c
index 1d86fd7..ef4bbbf 100644
--- a/src/mesa/main/extensions.c
+++ b/src/mesa/main/extensions.c
@@ -624,6 +624,12 @@ _mesa_one_time_init_extension_overrides( struct gl_context *ctx )
       return;
    }
 
+   /* force disable some extensions */
+   if (ctx->Const.options.DisableBlendFuncExtended) {
+      set_extension(&_mesa_extension_override_disables,
+                    "ARB_blend_func_extended", 0);
+   }
+
    /* extra_exts: List of unrecognized extensions. */
    extra_extensions = calloc(ALIGN(strlen(env_const) + 2, 4), sizeof(char));
    cant_disable_extensions = calloc(ALIGN(strlen(env_const) + 2, 4), sizeof(char));
diff --git a/src/mesa/main/shared_options.c b/src/mesa/main/shared_options.c
index 6d6a1c1..322a971 100644
--- a/src/mesa/main/shared_options.c
+++ b/src/mesa/main/shared_options.c
@@ -32,6 +32,9 @@ _mesa_shared_options_fill(struct driOptionCache *optionCache,
    sharedOptions->AllowGLSLExtensionDirectiveMidShader =
       driQueryOptionb(optionCache, "allow_glsl_extension_directive_midshader");
 
+   sharedOptions->DisableBlendFuncExtended =
+      driQueryOptionb(optionCache, "disable_blend_func_extended");
+
    sharedOptions->DisableGLSLLineContinuations =
       driQueryOptionb(optionCache, "disable_glsl_line_continuations");
 
diff --git a/src/mesa/main/shared_options.h b/src/mesa/main/shared_options.h
index a132fef..1a28a68 100644
--- a/src/mesa/main/shared_options.h
+++ b/src/mesa/main/shared_options.h
@@ -54,6 +54,11 @@ struct shared_options
    GLboolean AllowGLSLExtensionDirectiveMidShader;
 
    /**
+    * Force disable ARB_blend_func_extended (superseeded by ExtensionOverride).
+    */
+   GLboolean DisableBlendFuncExtended;
+
+   /**
     * Disable interpretation of line continuations (lines ending with a
     * backslash character ('\') in GLSL source.
     */
@@ -89,6 +94,7 @@ static inline void
 _mesa_shared_options_fill_defaults(struct shared_options *sharedOptions)
 {
    sharedOptions->AllowGLSLExtensionDirectiveMidShader = GL_FALSE;
+   sharedOptions->DisableBlendFuncExtended = GL_FALSE;
    sharedOptions->DisableGLSLLineContinuations = GL_FALSE;
    sharedOptions->ExtensionOverride = NULL;
    sharedOptions->ForceGLSLExtensionsWarn = GL_FALSE;
diff --git a/src/mesa/state_tracker/st_extensions.c b/src/mesa/state_tracker/st_extensions.c
index f91eb2e..758d6fe 100644
--- a/src/mesa/state_tracker/st_extensions.c
+++ b/src/mesa/state_tracker/st_extensions.c
@@ -794,8 +794,7 @@ void st_init_extensions(struct pipe_screen *screen,
         extensions->ARB_texture_multisample = GL_TRUE;
    }
 
-   if (consts->MaxDualSourceDrawBuffers > 0 &&
-       !options->disable_blend_func_extended)
+   if (consts->MaxDualSourceDrawBuffers > 0)
       extensions->ARB_blend_func_extended = GL_TRUE;
 
    if (screen->get_param(screen, PIPE_CAP_QUERY_TIME_ELAPSED) ||
-- 
2.4.2



More information about the mesa-dev mailing list