st/dri: support the driconf option disable_blend_func_extended
authorMarek Olšák <marek.olsak@amd.com>
Tue, 30 Jul 2013 20:29:16 +0000 (22:29 +0200)
committerMarek Olšák <marek.olsak@amd.com>
Tue, 30 Jul 2013 21:31:23 +0000 (23:31 +0200)
This is needed for Unigine.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
src/gallium/include/state_tracker/st_api.h
src/gallium/state_trackers/dri/common/dri_context.c
src/gallium/state_trackers/dri/common/dri_screen.c
src/gallium/state_trackers/osmesa/osmesa.c
src/mesa/state_tracker/st_extensions.c

index 52c9dc0c3a4dc5baf9c181570d3ac677d59fd77c..fd6d04c4a3d2f658ba346bd688e2a8a5adbb4ae0 100644 (file)
@@ -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;
 };
 
 /**
index 58a710d0d14f896eb1c8c2b183e68a3e3ade451b..5794e487158ed8514ea50161e786b56c0197f01f 100644 (file)
@@ -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
index 6a037c4d881f0c05b8d1f3800bde1dc1840b91e9..20a3caf601a3e855359dfcbdbfbf6214c81921c7 100644 (file)
@@ -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)
index 548e3ad12e50c0d9ea538a0564499d61870e3128..5908316dc815ae96e9f96e23f10fac8cf8b88dab 100644 (file)
@@ -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,
index bc0de494b8100ab8feaeb3dcbda8fec383652ae8..b201012f9d2edc05474cfc2e50644fc5a68fae59 100644 (file)
@@ -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 =