[Mesa-dev] [PATCH 1/7] intel: support factors for min/max blending

Ian Romanick idr at freedesktop.org
Mon Jan 6 11:37:28 PST 2014


On 01/02/2014 05:18 PM, Maxence Le Doré wrote:
> ---
>  src/mesa/drivers/dri/i915/i830_state.c | 12 ++++++++++++
>  src/mesa/drivers/dri/i965/brw_util.c   | 24 +++++++++++++-----------
>  2 files changed, 25 insertions(+), 11 deletions(-)
> 
> diff --git a/src/mesa/drivers/dri/i915/i830_state.c b/src/mesa/drivers/dri/i915/i830_state.c
> index bbf0cef..6a5db43 100644
> --- a/src/mesa/drivers/dri/i915/i830_state.c
> +++ b/src/mesa/drivers/dri/i915/i830_state.c

i915_state.c should get the same treatment.

> @@ -303,10 +303,16 @@ i830_set_blend_state(struct gl_context * ctx)
>        eqnRGB = BLENDFUNC_MIN;
>        funcRGB = SRC_BLND_FACT(BLENDFACT_ONE) | DST_BLND_FACT(BLENDFACT_ONE);
>        break;
> +   case GL_FACTOR_MIN_AMD:
> +      eqnRGB = BLENDFUNC_MIN;
> +      break;
>     case GL_MAX:
>        eqnRGB = BLENDFUNC_MAX;
>        funcRGB = SRC_BLND_FACT(BLENDFACT_ONE) | DST_BLND_FACT(BLENDFACT_ONE);
>        break;
> +   case GL_FACTOR_MAX_AMD:
> +      eqnRGB = BLENDFUNC_MAX;
> +      break;
>     case GL_FUNC_SUBTRACT:
>        eqnRGB = BLENDFUNC_SUB;
>        break;
> @@ -331,10 +337,16 @@ i830_set_blend_state(struct gl_context * ctx)
>        eqnA = BLENDFUNC_MIN;
>        funcA = SRC_BLND_FACT(BLENDFACT_ONE) | DST_BLND_FACT(BLENDFACT_ONE);
>        break;
> +   case GL_FACTOR_MIN_AMD:
> +      eqnA = BLENDFUNC_MIN;
> +      break;
>     case GL_MAX:
>        eqnA = BLENDFUNC_MAX;
>        funcA = SRC_BLND_FACT(BLENDFACT_ONE) | DST_BLND_FACT(BLENDFACT_ONE);
>        break;
> +   case GL_FACTOR_MAX_AMD:
> +      eqnA = BLENDFUNC_MAX;
> +      break;
>     case GL_FUNC_SUBTRACT:
>        eqnA = BLENDFUNC_SUB;
>        break;
> diff --git a/src/mesa/drivers/dri/i965/brw_util.c b/src/mesa/drivers/dri/i965/brw_util.c
> index 4a303cd..292b7e5 100644
> --- a/src/mesa/drivers/dri/i965/brw_util.c
> +++ b/src/mesa/drivers/dri/i965/brw_util.c
> @@ -40,17 +40,19 @@
>  GLuint brw_translate_blend_equation( GLenum mode )
>  {
>     switch (mode) {
> -   case GL_FUNC_ADD:
> -      return BRW_BLENDFUNCTION_ADD;
> -   case GL_MIN:
> -      return BRW_BLENDFUNCTION_MIN;
> -   case GL_MAX:
> -      return BRW_BLENDFUNCTION_MAX;
> -   case GL_FUNC_SUBTRACT:
> -      return BRW_BLENDFUNCTION_SUBTRACT;
> -   case GL_FUNC_REVERSE_SUBTRACT:
> -      return BRW_BLENDFUNCTION_REVERSE_SUBTRACT;
> -   default:
> +   case GL_FUNC_ADD: 
> +      return BRW_BLENDFUNCTION_ADD; 
> +   case GL_MIN: 
> +   case GL_FACTOR_MIN_AMD:
> +      return BRW_BLENDFUNCTION_MIN; 
> +   case GL_MAX: 
> +   case GL_FACTOR_MAX_AMD:
> +      return BRW_BLENDFUNCTION_MAX; 
> +   case GL_FUNC_SUBTRACT: 
> +      return BRW_BLENDFUNCTION_SUBTRACT; 
> +   case GL_FUNC_REVERSE_SUBTRACT: 
> +      return BRW_BLENDFUNCTION_REVERSE_SUBTRACT; 
> +   default: 
>        assert(0);
>        return BRW_BLENDFUNCTION_ADD;
>     }
> 



More information about the mesa-dev mailing list