a2xx: set constant blend color
authorIlia Mirkin <imirkin@alum.mit.edu>
Fri, 25 Aug 2017 04:03:46 +0000 (00:03 -0400)
committerIlia Mirkin <imirkin@alum.mit.edu>
Fri, 25 Aug 2017 04:18:33 +0000 (00:18 -0400)
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
src/gallium/drivers/freedreno/a2xx/fd2_emit.c

index 50eee63636c74b9ba30ee2de1d6657394a2f5f8a..44f9b55f1fee3c2726c3f53a45fe7ed7aafa0ae2 100644 (file)
@@ -309,6 +309,15 @@ fd2_emit_state(struct fd_context *ctx, const enum fd_dirty_3d_state dirty)
                OUT_RING(ring, blend->rb_colormask);
        }
 
+       if (dirty & FD_DIRTY_BLEND_COLOR) {
+               OUT_PKT3(ring, CP_SET_CONSTANT, 5);
+               OUT_RING(ring, CP_REG(REG_A2XX_RB_BLEND_RED));
+               OUT_RING(ring, float_to_ubyte(ctx->blend_color.color[0]));
+               OUT_RING(ring, float_to_ubyte(ctx->blend_color.color[1]));
+               OUT_RING(ring, float_to_ubyte(ctx->blend_color.color[2]));
+               OUT_RING(ring, float_to_ubyte(ctx->blend_color.color[3]));
+       }
+
        if (dirty & (FD_DIRTY_TEX | FD_DIRTY_PROG))
                emit_textures(ring, ctx);
 }