a2xx: add logicop support
authorIlia Mirkin <imirkin@alum.mit.edu>
Tue, 15 Aug 2017 03:38:52 +0000 (23:38 -0400)
committerIlia Mirkin <imirkin@alum.mit.edu>
Wed, 16 Aug 2017 02:54:40 +0000 (22:54 -0400)
This passes both gl-1.0-logicop and gl-1.1-xor piglits.

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
src/gallium/drivers/freedreno/a2xx/fd2_blend.c

index f063ebed66aac98df21db1624b77200f639f59ab..eae47ad061f3da6cd2699eb8bf8e09c012583646 100644 (file)
@@ -61,11 +61,10 @@ fd2_blend_state_create(struct pipe_context *pctx,
 {
        const struct pipe_rt_blend_state *rt = &cso->rt[0];
        struct fd2_blend_stateobj *so;
+       unsigned rop = PIPE_LOGICOP_COPY;
 
-       if (cso->logicop_enable) {
-               DBG("Unsupported! logicop");
-               return NULL;
-       }
+       if (cso->logicop_enable)
+               rop = cso->logicop_func; /* 1:1 mapping with hw */
 
        if (cso->independent_blend_enable) {
                DBG("Unsupported! independent blend state");
@@ -78,7 +77,7 @@ fd2_blend_state_create(struct pipe_context *pctx,
 
        so->base = *cso;
 
-       so->rb_colorcontrol = A2XX_RB_COLORCONTROL_ROP_CODE(12);
+       so->rb_colorcontrol = A2XX_RB_COLORCONTROL_ROP_CODE(rop);
 
        so->rb_blendcontrol =
                A2XX_RB_BLEND_CONTROL_COLOR_SRCBLEND(fd_blend_factor(rt->rgb_src_factor)) |