mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-08-06 08:09:19 +00:00
VideoCommon: Better logic op invert approximation
This commit is contained in:
parent
d380d43209
commit
600ad5f498
6 changed files with 139 additions and 33 deletions
|
@ -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.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue