[Mesa-dev] [PATCH] st/mesa/dri: add blend func extended disable as per i965

Dave Airlie airlied at gmail.com
Fri Nov 9 15:35:47 PST 2012


From: Dave Airlie <airlied at redhat.com>

Intel driver has this for Unigine heaven, so it looks fine to add it for
gallium drivers as well.

Signed-off-by: Dave Airlie <airlied at redhat.com>
---
 src/gallium/include/state_tracker/st_api.h          | 1 +
 src/gallium/state_trackers/dri/common/dri_context.c | 2 ++
 src/gallium/state_trackers/dri/common/dri_screen.c  | 1 +
 src/mesa/state_tracker/st_extensions.c              | 2 +-
 4 files changed, 5 insertions(+), 1 deletion(-)

diff --git a/src/gallium/include/state_tracker/st_api.h b/src/gallium/include/state_tracker/st_api.h
index 3a11cd4..2214e34 100644
--- a/src/gallium/include/state_tracker/st_api.h
+++ b/src/gallium/include/state_tracker/st_api.h
@@ -239,6 +239,7 @@ struct st_visual
 struct st_config_options
 {
 	boolean force_glsl_extensions_warn;
+	boolean blend_func_extended_disable;
 };
 
 /**
diff --git a/src/gallium/state_trackers/dri/common/dri_context.c b/src/gallium/state_trackers/dri/common/dri_context.c
index b91303d..5c3a65a 100644
--- a/src/gallium/state_trackers/dri/common/dri_context.c
+++ b/src/gallium/state_trackers/dri/common/dri_context.c
@@ -54,6 +54,8 @@ static void dri_fill_st_options(struct st_config_options *options,
 {
    options->force_glsl_extensions_warn =
       driQueryOptionb(optionCache, "force_glsl_extensions_warn");
+   options->blend_func_extended_disable =
+      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 70059b9..c1296cd 100644
--- a/src/gallium/state_trackers/dri/common/dri_screen.c
+++ b/src/gallium/state_trackers/dri/common/dri_screen.c
@@ -64,6 +64,7 @@ PUBLIC const char __driConfigOptions[] =
       DRI_CONF_SECTION_END
 
       DRI_CONF_SECTION_DEBUG
+         DRI_CONF_DISABLE_BLEND_FUNC_EXTENDED(false)
          DRI_CONF_FORCE_GLSL_EXTENSIONS_WARN(false)
       DRI_CONF_SECTION_END
 
diff --git a/src/mesa/state_tracker/st_extensions.c b/src/mesa/state_tracker/st_extensions.c
index 8877005..b213f06 100644
--- a/src/mesa/state_tracker/st_extensions.c
+++ b/src/mesa/state_tracker/st_extensions.c
@@ -622,7 +622,7 @@ void st_init_extensions(struct st_context *st)
       }
    }
 
-   if (ctx->Const.MaxDualSourceDrawBuffers > 0)
+   if (ctx->Const.MaxDualSourceDrawBuffers > 0 && !st->options.blend_func_extended_disable)
       ctx->Extensions.ARB_blend_func_extended = GL_TRUE;
 
    if (screen->get_param(screen, PIPE_CAP_TIMER_QUERY) &&
-- 
1.7.11.7



More information about the mesa-dev mailing list