From 6bd0fc86ba228195315d823d822a04174bc8982b Mon Sep 17 00:00:00 2001 From: TellowKrinkle Date: Wed, 13 Jul 2022 02:27:45 -0500 Subject: [PATCH] VideoCommon: Properly mask fbfetch logic op emulation --- Source/Core/VideoCommon/PixelShaderGen.cpp | 2 +- Source/Core/VideoCommon/UberShaderPixel.cpp | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/Source/Core/VideoCommon/PixelShaderGen.cpp b/Source/Core/VideoCommon/PixelShaderGen.cpp index 3304c74658..3220131a71 100644 --- a/Source/Core/VideoCommon/PixelShaderGen.cpp +++ b/Source/Core/VideoCommon/PixelShaderGen.cpp @@ -1843,7 +1843,7 @@ static void WriteLogicOp(ShaderCode& out, const pixel_shader_uid_data* uid_data) }; out.Write("\tint4 fb_value = iround(initial_ocol0 * 255.0);\n"); - out.Write("\tprev = {};\n", logic_op_mode[uid_data->logic_op_mode]); + out.Write("\tprev = ({}) & 0xff;\n", logic_op_mode[uid_data->logic_op_mode]); } static void WriteColor(ShaderCode& out, APIType api_type, const pixel_shader_uid_data* uid_data, diff --git a/Source/Core/VideoCommon/UberShaderPixel.cpp b/Source/Core/VideoCommon/UberShaderPixel.cpp index 024b49ddfa..a5d997eb20 100644 --- a/Source/Core/VideoCommon/UberShaderPixel.cpp +++ b/Source/Core/VideoCommon/UberShaderPixel.cpp @@ -1086,6 +1086,7 @@ ShaderCode GenPixelShader(APIType api_type, const ShaderHostConfig& host_config, } out.Write(" }}\n" + " TevResult &= 0xff;\n" " }}\n"); }