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

Marek Olšák maraeo at gmail.com
Sat Nov 10 04:30:50 PST 2012


BTW, I don't see any issue with ARB_blend_func_extended in Heaven, but
the presence of ARB_shader_bit_encoding breaks shadows. This script
for starting Heaven makes it render everything correctly on r600g:

export MESA_EXTENSION_OVERRIDE=-GL_ARB_shader_bit_encoding
export force_glsl_extensions_warn=true
./heaven

Marek

On Sat, Nov 10, 2012 at 12:35 AM, Dave Airlie <airlied at gmail.com> wrote:
> 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
>
> _______________________________________________
> mesa-dev mailing list
> mesa-dev at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/mesa-dev


More information about the mesa-dev mailing list