[Mesa-dev] [PATCH 05/15] st/dri: support the driconf option disable_blend_func_extended

Marek Olšák maraeo at gmail.com
Fri Jul 19 08:18:15 PDT 2013


This is needed for Unigine.
---
 src/gallium/include/state_tracker/st_api.h          | 5 +++--
 src/gallium/state_trackers/dri/common/dri_context.c | 2 ++
 src/gallium/state_trackers/dri/common/dri_screen.c  | 3 ++-
 src/gallium/state_trackers/osmesa/osmesa.c          | 1 +
 src/mesa/state_tracker/st_extensions.c              | 3 ++-
 5 files changed, 10 insertions(+), 4 deletions(-)

diff --git a/src/gallium/include/state_tracker/st_api.h b/src/gallium/include/state_tracker/st_api.h
index 52c9dc0..fd6d04c 100644
--- a/src/gallium/include/state_tracker/st_api.h
+++ b/src/gallium/include/state_tracker/st_api.h
@@ -239,8 +239,9 @@ struct st_visual
  */
 struct st_config_options
 {
-	boolean force_glsl_extensions_warn;
-	boolean disable_glsl_line_continuations;
+   boolean force_glsl_extensions_warn;
+   boolean disable_glsl_line_continuations;
+   boolean disable_blend_func_extended;
 };
 
 /**
diff --git a/src/gallium/state_trackers/dri/common/dri_context.c b/src/gallium/state_trackers/dri/common/dri_context.c
index 58a710d..5794e48 100644
--- a/src/gallium/state_trackers/dri/common/dri_context.c
+++ b/src/gallium/state_trackers/dri/common/dri_context.c
@@ -56,6 +56,8 @@ static void dri_fill_st_options(struct st_config_options *options,
       driQueryOptionb(optionCache, "force_glsl_extensions_warn");
    options->disable_glsl_line_continuations =
       driQueryOptionb(optionCache, "disable_glsl_line_continuations");
+   options->disable_blend_func_extended =
+      driQueryOptionb(optionCache, "disable_blend_func_extended");
 }
 
 GLboolean
diff --git a/src/gallium/state_trackers/dri/common/dri_screen.c b/src/gallium/state_trackers/dri/common/dri_screen.c
index 6a037c4..20a3caf 100644
--- a/src/gallium/state_trackers/dri/common/dri_screen.c
+++ b/src/gallium/state_trackers/dri/common/dri_screen.c
@@ -67,6 +67,7 @@ PUBLIC const char __driConfigOptions[] =
       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_SECTION_END
 
       DRI_CONF_SECTION_MISCELLANEOUS
@@ -76,7 +77,7 @@ PUBLIC const char __driConfigOptions[] =
 
 #define false 0
 
-static const uint __driNConfigOptions = 12;
+static const uint __driNConfigOptions = 13;
 
 static const __DRIconfig **
 dri_fill_in_modes(struct dri_screen *screen)
diff --git a/src/gallium/state_trackers/osmesa/osmesa.c b/src/gallium/state_trackers/osmesa/osmesa.c
index 548e3ad..5908316 100644
--- a/src/gallium/state_trackers/osmesa/osmesa.c
+++ b/src/gallium/state_trackers/osmesa/osmesa.c
@@ -543,6 +543,7 @@ OSMesaCreateContextExt(GLenum format, GLint depthBits, GLint stencilBits,
    attribs.minor = 1;
    attribs.flags = 0;  /* ST_CONTEXT_FLAG_x */
    attribs.options.force_glsl_extensions_warn = FALSE;
+   attribs.options.disable_blend_func_extended = FALSE;
    attribs.options.disable_glsl_line_continuations = FALSE;
 
    osmesa_init_st_visual(&attribs.visual,
diff --git a/src/mesa/state_tracker/st_extensions.c b/src/mesa/state_tracker/st_extensions.c
index bc0de49..b201012 100644
--- a/src/mesa/state_tracker/st_extensions.c
+++ b/src/mesa/state_tracker/st_extensions.c
@@ -713,7 +713,8 @@ void st_init_extensions(struct st_context *st)
       ctx->Extensions.EXT_framebuffer_multisample_blit_scaled = GL_TRUE;
    }
 
-   if (ctx->Const.MaxDualSourceDrawBuffers > 0)
+   if (ctx->Const.MaxDualSourceDrawBuffers > 0 &&
+       !st->options.disable_blend_func_extended)
       ctx->Extensions.ARB_blend_func_extended = GL_TRUE;
 
    st->has_time_elapsed =
-- 
1.8.1.2



More information about the mesa-dev mailing list