mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-25 21:40:08 +01:00
freedreno/a3xx: add blend state
Signed-off-by: Rob Clark <robclark@freedesktop.org>
This commit is contained in:
parent
0a1e4361e8
commit
bfd30935c9
2 changed files with 23 additions and 5 deletions
|
|
@ -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));
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue