[Mesa-dev] [PATCH 13/16] i965: Disable hardware blending if advanced blending is in use.

Jason Ekstrand jason at jlekstrand.net
Sat Aug 13 04:46:59 UTC 2016


On Aug 12, 2016 8:13 PM, "Kenneth Graunke" <kenneth at whitecape.org> wrote:
>
> We'll do blending in the shader in this case, so just disable the
> hardware blending.
>
> Signed-off-by: Kenneth Graunke <kenneth at whitecape.org>
> ---
>  src/mesa/drivers/dri/i965/gen8_blend_state.c | 5 ++++-

Drive-by comment: why are you only doing this for gen8 when we're
supporting the extension all the way back to gen4?

As a side-note, wouldn't it be nice if it were all in one file?...

>  1 file changed, 4 insertions(+), 1 deletion(-)
>
> diff --git a/src/mesa/drivers/dri/i965/gen8_blend_state.c
b/src/mesa/drivers/dri/i965/gen8_blend_state.c
> index 99b5e34..f81e8ca 100644
> --- a/src/mesa/drivers/dri/i965/gen8_blend_state.c
> +++ b/src/mesa/drivers/dri/i965/gen8_blend_state.c
> @@ -101,13 +101,16 @@ gen8_upload_blend_state(struct brw_context *brw)
>        */
>        bool integer = rb_type == GL_INT || rb_type == GL_UNSIGNED_INT;
>
> +      const bool blend_enable = (1 << i) &
> +         ctx->Color.BlendEnabled & ~ctx->Color._AdvancedBlendEnabled;
> +
>        /* _NEW_COLOR */
>        if (ctx->Color.ColorLogicOpEnabled) {
>           blend[1 + 2*i+1] |=
>              GEN8_BLEND_LOGIC_OP_ENABLE |
>              SET_FIELD(intel_translate_logic_op(ctx->Color.LogicOp),
>                        GEN8_BLEND_LOGIC_OP_FUNCTION);
> -      } else if (ctx->Color.BlendEnabled & (1 << i) && !integer) {
> +      } else if (blend_enable && !integer) {
>           GLenum eqRGB = ctx->Color.Blend[i].EquationRGB;
>           GLenum eqA = ctx->Color.Blend[i].EquationA;
>           GLenum srcRGB = ctx->Color.Blend[i].SrcRGB;
> --
> 2.9.0
>
> _______________________________________________
> mesa-dev mailing list
> mesa-dev at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/mesa-dev
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/mesa-dev/attachments/20160812/bb9f8c08/attachment.html>


More information about the mesa-dev mailing list