[Mesa-dev] [PATCH] swr: correct setting of independentAlphaBlendEnable
Rowley, Timothy O
timothy.o.rowley at intel.com
Thu Nov 10 01:02:02 UTC 2016
Reviewed-by: Tim Rowley <timothy.o.rowley at intel.com<mailto:timothy.o.rowley at intel.com>>
On Nov 9, 2016, at 1:38 PM, Ilia Mirkin <imirkin at alum.mit.edu<mailto:imirkin at alum.mit.edu>> wrote:
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 at alum.mit.edu<mailto:imirkin at alum.mit.edu>>
---
This fixes gl-1.0-blend-func. Not 100% sure why this setting is a thing, as
opposed to just looking at the values directly, but ... wtvr.
src/gallium/drivers/swr/swr_state.cpp | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/src/gallium/drivers/swr/swr_state.cpp b/src/gallium/drivers/swr/swr_state.cpp
index d19acfb..65327f3 100644
--- a/src/gallium/drivers/swr/swr_state.cpp
+++ b/src/gallium/drivers/swr/swr_state.cpp
@@ -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
--
2.7.3
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/mesa-dev/attachments/20161110/a5949f40/attachment-0001.html>
More information about the mesa-dev
mailing list