mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-23 06:09:50 -06:00
VideoCommon: Better logic op invert approximation
This commit is contained in:
@ -1092,6 +1092,26 @@ ShaderCode GenPixelShader(APIType api_type, const ShaderHostConfig& host_config,
|
||||
" TevResult &= 0xff;\n"
|
||||
" }}\n");
|
||||
}
|
||||
else if (!host_config.backend_logic_op)
|
||||
{
|
||||
out.Write(" // Helpers for logic op blending approximations\n"
|
||||
" if (logic_op_enable) {{\n"
|
||||
" switch (logic_op_mode) {{\n");
|
||||
out.Write(" case {}: // Clear\n", static_cast<u32>(LogicOp::Clear));
|
||||
out.Write(" TevResult = int4(0, 0, 0, 0);\n"
|
||||
" break;\n");
|
||||
out.Write(" case {}: // Copy Inverted\n", static_cast<u32>(LogicOp::CopyInverted));
|
||||
out.Write(" TevResult ^= 0xff;\n"
|
||||
" break;\n");
|
||||
out.Write(" case {}: // Set\n", static_cast<u32>(LogicOp::Set));
|
||||
out.Write(" case {}: // Invert\n", static_cast<u32>(LogicOp::Invert));
|
||||
out.Write(" TevResult = int4(255, 255, 255, 255);\n"
|
||||
" break;\n");
|
||||
out.Write(" default:\n"
|
||||
" break;\n"
|
||||
" }}\n"
|
||||
" }}\n");
|
||||
}
|
||||
|
||||
// Some backends require that the shader outputs be uint when writing to a uint render target for
|
||||
// logic op.
|
||||
|
Reference in New Issue
Block a user