swr: correct setting of independentAlphaBlendEnable
authorIlia Mirkin <imirkin@alum.mit.edu>
Wed, 9 Nov 2016 19:31:25 +0000 (14:31 -0500)
committerIlia Mirkin <imirkin@alum.mit.edu>
Thu, 10 Nov 2016 01:11:57 +0000 (20:11 -0500)
This setting is for whether color and alpha have different blend
settings, not for whether blending is enabled on a per-RT basis.

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Tim Rowley <timothy.o.rowley@intel.com>
src/gallium/drivers/swr/swr_state.cpp

index d19acfbb347ba4026e92ab6b405b08a8a6c9b0b7..65327f39d026bd59513d80cf92e253af5d5fae85 100644 (file)
@@ -1318,7 +1318,12 @@ swr_update_derived(struct pipe_context *pipe,
             compileState.desc.alphaTestEnable =
                ctx->depth_stencil->alpha.enabled;
             compileState.desc.independentAlphaBlendEnable =
-               ctx->blend->pipe.independent_blend_enable;
+               (compileState.blendState.sourceBlendFactor !=
+                compileState.blendState.sourceAlphaBlendFactor) ||
+               (compileState.blendState.destBlendFactor !=
+                compileState.blendState.destAlphaBlendFactor) ||
+               (compileState.blendState.colorBlendFunc !=
+                compileState.blendState.alphaBlendFunc);
             compileState.desc.alphaToCoverageEnable =
                ctx->blend->pipe.alpha_to_coverage;
             compileState.desc.sampleMaskEnable = 0; // XXX