radeonsi: disallow MIN/MAX blend equations for dual source blending
authorMarek Olšák <marek.olsak@amd.com>
Tue, 9 Aug 2016 11:26:23 +0000 (13:26 +0200)
committerMarek Olšák <marek.olsak@amd.com>
Wed, 10 Aug 2016 13:43:36 +0000 (15:43 +0200)
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
Reviewed-by: Edward O'Callaghan <funfunctor@folklore1984.net>
src/gallium/drivers/radeonsi/si_state.c

index f5b2330d623aef6b1a8d59d6931b9961030705f4..8f7203ea9ba0a26ca12fb09bbbe784cdc23f78fc 100644 (file)
@@ -464,6 +464,16 @@ static void *si_create_blend_state_mode(struct pipe_context *ctx,
                if (i >= 1 && blend->dual_src_blend)
                        continue;
 
+               /* Only addition and subtraction equations are supported with
+                * dual source blending.
+                */
+               if (blend->dual_src_blend &&
+                   (eqRGB == PIPE_BLEND_MIN || eqRGB == PIPE_BLEND_MAX ||
+                    eqA == PIPE_BLEND_MIN || eqA == PIPE_BLEND_MAX)) {
+                       assert(!"Unsupported equation for dual source blending");
+                       continue;
+               }
+
                if (!state->rt[j].colormask)
                        continue;