aboutsummaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/v3d/v3dx_emit.c
diff options
context:
space:
mode:
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++) {