summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/v3d/v3dx_state.c
diff options
context:
space:
mode:
authorEric Anholt <[email protected]>2018-07-11 11:02:11 -0700
committerEric Anholt <[email protected]>2018-07-12 11:31:08 -0700
commit97ddeed949c608742c096dadb64b7c28a56cf920 (patch)
tree5c63b30b009ae182080d9878441a9a918ca2065f /src/gallium/drivers/v3d/v3dx_state.c
parente0dbbf9987c6f75b8aeb38ac70fb906a3e0d9493 (diff)
v3d: Fix MRT blending with independent blending disabled.
We were only emitting the RT blend state for RT 0 and only enabling it for RT 0, when the gallium API for !independent_blend is for rt0's state to apply to all of them. Fixes piglit fbo-drawbuffers-blend-add.
Diffstat (limited to 'src/gallium/drivers/v3d/v3dx_state.c')
-rw-r--r--src/gallium/drivers/v3d/v3dx_state.c15
1 files changed, 10 insertions, 5 deletions
diff --git a/src/gallium/drivers/v3d/v3dx_state.c b/src/gallium/drivers/v3d/v3dx_state.c
index f775c531e5f..a092b1fb9e1 100644
--- a/src/gallium/drivers/v3d/v3dx_state.c
+++ b/src/gallium/drivers/v3d/v3dx_state.c
@@ -126,12 +126,17 @@ v3d_create_blend_state(struct pipe_context *pctx,
so->base = *cso;
- for (int i = 0; i < VC5_MAX_DRAW_BUFFERS; i++) {
- so->blend_enables |= cso->rt[i].blend_enable << i;
+ if (cso->independent_blend_enable) {
+ for (int i = 0; i < VC5_MAX_DRAW_BUFFERS; i++) {
+ so->blend_enables |= cso->rt[i].blend_enable << i;
- /* V3D 4.x is when we got independent blend enables. */
- assert(V3D_VERSION >= 40 ||
- cso->rt[i].blend_enable == cso->rt[0].blend_enable);
+ /* V3D 4.x is when we got independent blend enables. */
+ assert(V3D_VERSION >= 40 ||
+ cso->rt[i].blend_enable == cso->rt[0].blend_enable);
+ }
+ } else {
+ if (cso->rt[0].blend_enable)
+ so->blend_enables = (1 << VC5_MAX_DRAW_BUFFERS) - 1;
}
return so;