aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorRob Clark <[email protected]>2013-09-19 10:17:09 -0400
committerRob Clark <[email protected]>2013-10-24 20:21:08 -0400
commitbfd30935c996f453fff7345c79dcef4e83d89cfb (patch)
treea9e52890ff5628d49eaf1002d584d0e30180dded /src
parent0a1e4361e8edd0d0bb5d22be9527ab40080c66e7 (diff)
freedreno/a3xx: add blend state
Signed-off-by: Rob Clark <[email protected]>
Diffstat (limited to 'src')
-rw-r--r--src/gallium/drivers/freedreno/a3xx/fd3_draw.c3
-rw-r--r--src/gallium/drivers/freedreno/a3xx/fd3_emit.c25
2 files changed, 23 insertions, 5 deletions
diff --git a/src/gallium/drivers/freedreno/a3xx/fd3_draw.c b/src/gallium/drivers/freedreno/a3xx/fd3_draw.c
index 85c7441a84d..d808777a1fb 100644
--- a/src/gallium/drivers/freedreno/a3xx/fd3_draw.c
+++ b/src/gallium/drivers/freedreno/a3xx/fd3_draw.c
@@ -108,7 +108,8 @@ fd3_clear(struct fd_context *ctx, unsigned buffers,
FD_DIRTY_FRAMEBUFFER | FD_DIRTY_SCISSOR));
OUT_PKT0(ring, REG_A3XX_RB_BLEND_ALPHA, 1);
- OUT_RING(ring, 0X3c0000ff);
+ OUT_RING(ring, A3XX_RB_BLEND_ALPHA_UINT(0xff) |
+ A3XX_RB_BLEND_ALPHA_FLOAT(1.0));
fd3_emit_rbrc_draw_state(ring,
A3XX_RB_RENDER_CONTROL_ALPHA_TEST_FUNC(FUNC_NEVER));
diff --git a/src/gallium/drivers/freedreno/a3xx/fd3_emit.c b/src/gallium/drivers/freedreno/a3xx/fd3_emit.c
index 3cff18c7e64..076d7de72b7 100644
--- a/src/gallium/drivers/freedreno/a3xx/fd3_emit.c
+++ b/src/gallium/drivers/freedreno/a3xx/fd3_emit.c
@@ -460,6 +460,19 @@ fd3_emit_state(struct fd_context *ctx, uint32_t dirty)
}
}
+ if (dirty & FD_DIRTY_BLEND_COLOR) {
+ struct pipe_blend_color *bcolor = &ctx->blend_color;
+ OUT_PKT0(ring, REG_A3XX_RB_BLEND_RED, 4);
+ OUT_RING(ring, A3XX_RB_BLEND_RED_UINT(bcolor->color[0] * 255.0) |
+ A3XX_RB_BLEND_RED_FLOAT(bcolor->color[0]));
+ OUT_RING(ring, A3XX_RB_BLEND_GREEN_UINT(bcolor->color[1] * 255.0) |
+ A3XX_RB_BLEND_GREEN_FLOAT(bcolor->color[1]));
+ OUT_RING(ring, A3XX_RB_BLEND_BLUE_UINT(bcolor->color[2] * 255.0) |
+ A3XX_RB_BLEND_BLUE_FLOAT(bcolor->color[2]));
+ OUT_RING(ring, A3XX_RB_BLEND_ALPHA_UINT(bcolor->color[3] * 255.0) |
+ A3XX_RB_BLEND_ALPHA_FLOAT(bcolor->color[3]));
+ }
+
if (dirty & FD_DIRTY_VERTTEX)
emit_textures(ring, SB_VERT_TEX, &ctx->verttex);
@@ -574,10 +587,14 @@ fd3_emit_restore(struct fd_context *ctx)
A3XX_PA_SC_WINDOW_OFFSET_Y(0));
OUT_PKT0(ring, REG_A3XX_RB_BLEND_RED, 4);
- OUT_RING(ring, 0x00000000); /* RB_BLEND_RED */
- OUT_RING(ring, 0x00000000); /* RB_BLEND_GREEN */
- OUT_RING(ring, 0x00000000); /* RB_BLEND_BLUE */
- OUT_RING(ring, 0x3c0000ff); /* RB_BLEND_ALPHA */
+ OUT_RING(ring, A3XX_RB_BLEND_RED_UINT(0) |
+ A3XX_RB_BLEND_RED_FLOAT(0.0));
+ OUT_RING(ring, A3XX_RB_BLEND_GREEN_UINT(0) |
+ A3XX_RB_BLEND_GREEN_FLOAT(0.0));
+ OUT_RING(ring, A3XX_RB_BLEND_BLUE_UINT(0) |
+ A3XX_RB_BLEND_BLUE_FLOAT(0.0));
+ OUT_RING(ring, A3XX_RB_BLEND_ALPHA_UINT(0xff) |
+ A3XX_RB_BLEND_ALPHA_FLOAT(1.0));
for (i = 0; i < 6; i++) {
OUT_PKT0(ring, REG_A3XX_GRAS_CL_USER_PLANE(i), 4);