swr: disable logic op when the rt format is float or srgb
authorIlia Mirkin <imirkin@alum.mit.edu>
Tue, 8 Nov 2016 22:30:03 +0000 (17:30 -0500)
committerIlia Mirkin <imirkin@alum.mit.edu>
Wed, 9 Nov 2016 00:28:35 +0000 (19:28 -0500)
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 451ab5af114a026561d36f1fd3f60b0349b6cf4b..ede475a8e345a935950dc9192e94de6315a36b68 100644 (file)
@@ -1305,6 +1305,12 @@ swr_update_derived(struct pipe_context *pipe,
                    &ctx->blend->compileState[target],
                    sizeof(compileState.blendState));
 
+            const SWR_FORMAT_INFO& info = GetFormatInfo(compileState.format);
+            if (compileState.blendState.logicOpEnable &&
+                ((info.type[0] == SWR_TYPE_FLOAT) || info.isSRGB)) {
+               compileState.blendState.logicOpEnable = false;
+            }
+
             if (compileState.blendState.blendEnable == false &&
                 compileState.blendState.logicOpEnable == false &&
                 ctx->depth_stencil->alpha.enabled == 0) {