freedreno/a3xx: add independent blend function support
authorIlia Mirkin <imirkin@alum.mit.edu>
Mon, 30 Mar 2015 00:04:38 +0000 (20:04 -0400)
committerIlia Mirkin <imirkin@alum.mit.edu>
Thu, 2 Apr 2015 04:09:14 +0000 (00:09 -0400)
This is needed for MRT support

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

index 922955661472635990ce9da5d535dd09570b549c..6f5de9d47f71d617f5709ed060edb92b9c78d7eb 100644 (file)
@@ -86,11 +86,6 @@ fd3_blend_state_create(struct pipe_context *pctx,
                }
        }
 
-       if (cso->independent_blend_enable) {
-               DBG("Unsupported! independent blend state");
-               return NULL;
-       }
-
        so = CALLOC_STRUCT(fd3_blend_stateobj);
        if (!so)
                return NULL;
@@ -98,7 +93,11 @@ fd3_blend_state_create(struct pipe_context *pctx,
        so->base = *cso;
 
        for (i = 0; i < ARRAY_SIZE(so->rb_mrt); i++) {
-               const struct pipe_rt_blend_state *rt = &cso->rt[i];
+               const struct pipe_rt_blend_state *rt;
+               if (cso->independent_blend_enable)
+                       rt = &cso->rt[i];
+               else
+                       rt = &cso->rt[0];
 
                so->rb_mrt[i].blend_control_rgb =
                                A3XX_RB_MRT_BLEND_CONTROL_RGB_SRC_FACTOR(fd_blend_factor(rt->rgb_src_factor)) |
index 68c81055f3da186ea4a81030b598e5002770cfc7..bb488025eced0aff2c396cf5952d74579e30a362 100644 (file)
@@ -179,6 +179,10 @@ fd_screen_get_param(struct pipe_screen *pscreen, enum pipe_cap param)
        case PIPE_CAP_VERTEX_ELEMENT_INSTANCE_DIVISOR:
                return is_a3xx(screen) || is_a4xx(screen);
 
+       case PIPE_CAP_INDEP_BLEND_ENABLE:
+       case PIPE_CAP_INDEP_BLEND_FUNC:
+               return is_a3xx(screen);
+
        case PIPE_CAP_CONSTANT_BUFFER_OFFSET_ALIGNMENT:
                return 256;
 
@@ -188,8 +192,6 @@ fd_screen_get_param(struct pipe_screen *pscreen, enum pipe_cap param)
                return (is_a3xx(screen) || is_a4xx(screen)) ? 130 : 120;
 
        /* Unsupported features. */
-       case PIPE_CAP_INDEP_BLEND_ENABLE:
-       case PIPE_CAP_INDEP_BLEND_FUNC:
        case PIPE_CAP_DEPTH_CLIP_DISABLE:
        case PIPE_CAP_SEAMLESS_CUBE_MAP_PER_TEXTURE:
        case PIPE_CAP_TGSI_FS_COORD_ORIGIN_LOWER_LEFT: