aboutsummaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/v3d/v3dx_emit.c
diff options
context:
space:
mode:
authorEric Anholt <[email protected]>2018-07-03 16:24:35 -0700
committerEric Anholt <[email protected]>2018-07-05 12:39:36 -0700
commit572f6ab489db2d2311d89ab5910764ebb83cb49d (patch)
treee1262aaddc51fb1af74b4476aff645829483531c /src/gallium/drivers/v3d/v3dx_emit.c
parent5601ab3981c8ab5872230a6a9afc236d76fa1405 (diff)
v3d: Add proper support for GL_EXT_draw_buffers2's blending enables.
I had flagged it as enabled on V3D 4.x, but not actually implemented the per-RT enables. Fixes piglit fbo_drawbuffers2-blend.
Diffstat (limited to 'src/gallium/drivers/v3d/v3dx_emit.c')
-rw-r--r--src/gallium/drivers/v3d/v3dx_emit.c26
1 files changed, 17 insertions, 9 deletions
diff --git a/src/gallium/drivers/v3d/v3dx_emit.c b/src/gallium/drivers/v3d/v3dx_emit.c
index 03e47d66156..78edf02d79a 100644
--- a/src/gallium/drivers/v3d/v3dx_emit.c
+++ b/src/gallium/drivers/v3d/v3dx_emit.c
@@ -400,7 +400,7 @@ v3dX(emit_state)(struct pipe_context *pctx)
config.direct3d_provoking_vertex =
v3d->rasterizer->base.flatshade_first;
- config.blend_enable = v3d->blend->rt[0].blend_enable;
+ config.blend_enable = v3d->blend->blend_enables;
/* Note: EZ state may update based on the compiled FS,
* along with ZSA
@@ -481,19 +481,27 @@ v3dX(emit_state)(struct pipe_context *pctx)
}
}
- if (v3d->dirty & VC5_DIRTY_BLEND && v3d->blend->rt[0].blend_enable) {
- struct pipe_blend_state *blend = v3d->blend;
+ if (v3d->dirty & VC5_DIRTY_BLEND) {
+ struct v3d_blend_state *blend = v3d->blend;
- if (blend->independent_blend_enable) {
- for (int i = 0; i < VC5_MAX_DRAW_BUFFERS; i++)
- emit_rt_blend(v3d, job, blend, i);
- } else {
- emit_rt_blend(v3d, job, blend, 0);
+ if (blend->blend_enables) {
+#if V3D_VERSION >= 40
+ cl_emit(&job->bcl, BLEND_ENABLES, enables) {
+ enables.mask = blend->blend_enables;
+ }
+#endif
+
+ if (blend->base.independent_blend_enable) {
+ for (int i = 0; i < VC5_MAX_DRAW_BUFFERS; i++)
+ emit_rt_blend(v3d, job, &blend->base, i);
+ } else {
+ emit_rt_blend(v3d, job, &blend->base, 0);
+ }
}
}
if (v3d->dirty & VC5_DIRTY_BLEND) {
- struct pipe_blend_state *blend = v3d->blend;
+ struct pipe_blend_state *blend = &v3d->blend->base;
cl_emit(&job->bcl, COLOUR_WRITE_MASKS, mask) {
for (int i = 0; i < 4; i++) {