From 040894391a2cf85035c6ad85f3f85c6efb23324b Mon Sep 17 00:00:00 2001 From: Kenneth Graunke Date: Wed, 18 Jul 2012 00:07:17 -0700 Subject: i965: Add a driconf option to disable GL_ARB_blend_func_extended. Unigine Heaven (at least) has a bug where it incorrectly uses the GL_ARB_blend_func_extended extension. Dual source blending allows two color outputs per render target; individual shader outputs can be assigned to be either the first or second blending input by setting the 'index' via one of two methods: - An API call: glBindFragDataLocationIndexed() - The GLSL 'layout' qualifier provided by GL_ARB_explicit_attrib_location Both of these only work on user defined fragment shader outputs; it's an error to use either on built-in outputs like gl_FragData. Unigine uses gl_FragData and gl_FragColor exclusively, and doesn't even attempt to use either method to set index == 1. However, it does set the blending function to SRC1 enums, which requires a fragment shader output with index == 1 or else rendering is undefined. In other words, enabling ARB_blend_func_extended causes Unigine to render incorrectly, resulting in an apparent regression, even though our driver code (as far as I can tell) is perfectly fine. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=50291 Signed-off-by: Kenneth Graunke Reviewed-by: Chad Versace Reviewed-by: Eric Anholt --- src/mesa/drivers/dri/common/drirc | 4 ++++ src/mesa/drivers/dri/common/xmlpool/options.h | 10 ++++++++++ 2 files changed, 14 insertions(+) (limited to 'src/mesa/drivers/dri/common') diff --git a/src/mesa/drivers/dri/common/drirc b/src/mesa/drivers/dri/common/drirc index 2d92878520a..52d8dd7247c 100644 --- a/src/mesa/drivers/dri/common/drirc +++ b/src/mesa/drivers/dri/common/drirc @@ -2,15 +2,19 @@ diff --git a/src/mesa/drivers/dri/common/xmlpool/options.h b/src/mesa/drivers/dri/common/xmlpool/options.h index 75c887e5d06..a20e3d12dcf 100644 --- a/src/mesa/drivers/dri/common/xmlpool/options.h +++ b/src/mesa/drivers/dri/common/xmlpool/options.h @@ -636,3 +636,13 @@ DRI_CONF_OPT_BEGIN(force_glsl_extensions_warn,bool,def) \ DRI_CONF_DESC(fr,"Force GLSL extension default behavior to 'warn'") \ DRI_CONF_DESC(sv,"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_DESC(en,"Disable dual source blending") \ + DRI_CONF_DESC(de,"Disable dual source blending") \ + DRI_CONF_DESC(es,"Disable dual source blending") \ + DRI_CONF_DESC(nl,"Disable dual source blending") \ + DRI_CONF_DESC(fr,"Disable dual source blending") \ + DRI_CONF_DESC(sv,"Disable dual source blending") \ +DRI_CONF_OPT_END -- cgit v1.2.3