summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/vc5/vc5_emit.c
diff options
context:
space:
mode:
authorEric Anholt <[email protected]>2017-10-27 14:41:35 -0700
committerEric Anholt <[email protected]>2017-10-30 13:31:32 -0700
commit61bb0df60e08d0b5707879c49beed899d46eaf9a (patch)
treed948769aa46c594bf1d17fac3ada1b07321c59e2 /src/gallium/drivers/vc5/vc5_emit.c
parent2e3c7beb1e60a47e1f5dd12d28ac3f328555a543 (diff)
broadcom/vc5: Do BGRA vs RGBA swapping for the BLEND_CONSTANT_COLOR.
Fixes many of the fbo-blending-formats tests.
Diffstat (limited to 'src/gallium/drivers/vc5/vc5_emit.c')
-rw-r--r--src/gallium/drivers/vc5/vc5_emit.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/gallium/drivers/vc5/vc5_emit.c b/src/gallium/drivers/vc5/vc5_emit.c
index 9b5d293079c..1368d34729a 100644
--- a/src/gallium/drivers/vc5/vc5_emit.c
+++ b/src/gallium/drivers/vc5/vc5_emit.c
@@ -360,10 +360,13 @@ vc5_emit_state(struct pipe_context *pctx)
if (vc5->dirty & VC5_DIRTY_BLEND_COLOR) {
cl_emit(&job->bcl, BLEND_CONSTANT_COLOUR, colour) {
- /* XXX: format-dependent swizzling */
- colour.red_f16 = vc5->blend_color.hf[2];
+ colour.red_f16 = (vc5->swap_color_rb ?
+ vc5->blend_color.hf[2] :
+ vc5->blend_color.hf[0]);
colour.green_f16 = vc5->blend_color.hf[1];
- colour.blue_f16 = vc5->blend_color.hf[0];
+ colour.blue_f16 = (vc5->swap_color_rb ?
+ vc5->blend_color.hf[0] :
+ vc5->blend_color.hf[2]);
colour.alpha_f16 = vc5->blend_color.hf[3];
}
}