broadcom/vc5: Fix color masks for non-independent blending.
authorEric Anholt <eric@anholt.net>
Tue, 3 Oct 2017 00:05:24 +0000 (17:05 -0700)
committerEric Anholt <eric@anholt.net>
Tue, 10 Oct 2017 18:42:06 +0000 (11:42 -0700)
This gets fbo-mrt-alphatest working except for the second RT's clear color.

src/gallium/drivers/vc5/vc5_emit.c

index 475db7bc86803f93eba2abc32b100088c32ec837..dd055d49208d5a7a332be9d18e50bc83eb2640d0 100644 (file)
@@ -336,14 +336,22 @@ vc5_emit_state(struct pipe_context *pctx)
                 }
 
                 cl_emit(&job->bcl, COLOUR_WRITE_MASKS, mask) {
-                        mask.render_target_0_per_colour_component_write_masks =
-                                (~blend->rt[0].colormask) & 0xf;
-                        mask.render_target_1_per_colour_component_write_masks =
-                                (~blend->rt[1].colormask) & 0xf;
-                        mask.render_target_2_per_colour_component_write_masks =
-                                (~blend->rt[2].colormask) & 0xf;
-                        mask.render_target_3_per_colour_component_write_masks =
-                                (~blend->rt[3].colormask) & 0xf;
+                        if (blend->independent_blend_enable) {
+                                mask.render_target_0_per_colour_component_write_masks =
+                                        (~blend->rt[0].colormask) & 0xf;
+                                mask.render_target_1_per_colour_component_write_masks =
+                                        (~blend->rt[1].colormask) & 0xf;
+                                mask.render_target_2_per_colour_component_write_masks =
+                                        (~blend->rt[2].colormask) & 0xf;
+                                mask.render_target_3_per_colour_component_write_masks =
+                                        (~blend->rt[3].colormask) & 0xf;
+                        } else {
+                                uint8_t colormask = (~blend->rt[0].colormask) & 0xf;
+                                mask.render_target_0_per_colour_component_write_masks = colormask;
+                                mask.render_target_1_per_colour_component_write_masks = colormask;
+                                mask.render_target_2_per_colour_component_write_masks = colormask;
+                                mask.render_target_3_per_colour_component_write_masks = colormask;
+                        }
                 }
         }