freedreno/a4xx: alpha blend fixes
authorRob Clark <robclark@freedesktop.org>
Mon, 1 Dec 2014 23:20:48 +0000 (18:20 -0500)
committerRob Clark <robclark@freedesktop.org>
Tue, 2 Dec 2014 01:31:23 +0000 (20:31 -0500)
Signed-off-by: Rob Clark <robclark@freedesktop.org>
src/gallium/drivers/freedreno/a4xx/fd4_blend.c
src/gallium/drivers/freedreno/a4xx/fd4_blend.h
src/gallium/drivers/freedreno/a4xx/fd4_emit.c

index f569e9313c385507c43d760c3e6cc6377c8bff4a..bf2254a8ae0102b55af573195e45c8fec1b02e1a 100644 (file)
@@ -110,11 +110,13 @@ fd4_blend_state_create(struct pipe_context *pctx,
                                0xc00 | /* XXX ROP_CODE ?? */
                                A4XX_RB_MRT_CONTROL_COMPONENT_ENABLE(rt->colormask);
 
-               if (rt->blend_enable)
+               if (rt->blend_enable) {
                        so->rb_mrt[i].control |=
                                        A4XX_RB_MRT_CONTROL_READ_DEST_ENABLE |
                                        A4XX_RB_MRT_CONTROL_BLEND |
                                        A4XX_RB_MRT_CONTROL_BLEND2;
+                       so->rb_fs_output |= A4XX_RB_FS_OUTPUT_ENABLE_BLEND;
+               }
 
                if (reads_dest)
                        so->rb_mrt[i].control |= A4XX_RB_MRT_CONTROL_READ_DEST_ENABLE;
index 68fcf23ff5cd42fc23d038c96e65009d87876aa7..33641da5e2c201bc4bc2abe661a5df00bf997401 100644 (file)
@@ -39,6 +39,7 @@ struct fd4_blend_stateobj {
                uint32_t buf_info;
                uint32_t blend_control;
        } rb_mrt[8];
+       uint32_t rb_fs_output;
 };
 
 static INLINE struct fd4_blend_stateobj *
index 44a824ab164a677deb32fe127da55f5cc0dc35e6..56ac0d109c2102753d28b564c69a7656fbcae53e 100644 (file)
@@ -367,6 +367,9 @@ fd4_emit_state(struct fd_context *ctx, struct fd_ringbuffer *ring,
                OUT_PKT0(ring, REG_A4XX_GRAS_ALPHA_CONTROL, 1);
                OUT_RING(ring, zsa->gras_alpha_control);
 
+               OUT_PKT0(ring, REG_A4XX_RB_ALPHA_CONTROL, 1);
+               OUT_RING(ring, zsa->rb_alpha_control);
+
                OUT_PKT0(ring, REG_A4XX_RB_STENCIL_CONTROL, 2);
                OUT_RING(ring, zsa->rb_stencil_control);
                OUT_RING(ring, zsa->rb_stencil_control2);
@@ -486,6 +489,10 @@ fd4_emit_state(struct fd_context *ctx, struct fd_ringbuffer *ring,
                        OUT_PKT0(ring, REG_A4XX_RB_MRT_BLEND_CONTROL(i), 1);
                        OUT_RING(ring, blend->rb_mrt[i].blend_control);
                }
+
+               OUT_PKT0(ring, REG_A4XX_RB_FS_OUTPUT, 1);
+               OUT_RING(ring, blend->rb_fs_output |
+                               A4XX_RB_FS_OUTPUT_SAMPLE_MASK(0xffff));
        }
 
        if (dirty & FD_DIRTY_VERTTEX) {