diff options
author | Eric Anholt <[email protected]> | 2017-10-27 15:52:22 -0700 |
---|---|---|
committer | Eric Anholt <[email protected]> | 2017-10-30 13:31:32 -0700 |
commit | 2a77c763fe769b37d154585114b403b7755b9e17 (patch) | |
tree | 9a0fc52fe3d4bf061dfa938218508d00bd97bf08 /src/gallium/drivers/vc5/vc5_state.c | |
parent | 61bb0df60e08d0b5707879c49beed899d46eaf9a (diff) |
broadcom/vc5: Force blending to treat alpha as 1 for formats without alpha.
Fixes fbo-blending-formats on RGB8 and 565. We will still need to demote
blending to shader code in the MRT case to fix it in general, but that can
be added when we start doing 32F blending (which also needs to be done in
the shader).
Diffstat (limited to 'src/gallium/drivers/vc5/vc5_state.c')
-rw-r--r-- | src/gallium/drivers/vc5/vc5_state.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/gallium/drivers/vc5/vc5_state.c b/src/gallium/drivers/vc5/vc5_state.c index a7717b30dfb..db921d63f36 100644 --- a/src/gallium/drivers/vc5/vc5_state.c +++ b/src/gallium/drivers/vc5/vc5_state.c @@ -389,6 +389,7 @@ vc5_set_framebuffer_state(struct pipe_context *pctx, cso->height = framebuffer->height; vc5->swap_color_rb = 0; + vc5->blend_dst_alpha_one = 0; for (int i = 0; i < vc5->framebuffer.nr_cbufs; i++) { struct pipe_surface *cbuf = vc5->framebuffer.cbufs[i]; const struct util_format_description *desc = @@ -401,6 +402,9 @@ vc5_set_framebuffer_state(struct pipe_context *pctx, cbuf->format != PIPE_FORMAT_B5G6R5_UNORM) { vc5->swap_color_rb |= 1 << i; } + + if (desc->swizzle[3] == PIPE_SWIZZLE_1) + vc5->blend_dst_alpha_one |= 1 << i; } vc5->dirty |= VC5_DIRTY_FRAMEBUFFER; |