mirror of
https://github.com/RPCSX/rpcsx.git
synced 2026-04-05 22:47:03 +00:00
rsx/common/d3d12: Support non default alpha function
Fix After burner climax cloud effects.
This commit is contained in:
parent
9e3132c3fc
commit
837e06e85b
7 changed files with 60 additions and 3 deletions
|
|
@ -253,7 +253,30 @@ void D3D12FragmentDecompiler::insertMainEnd(std::stringstream & OS)
|
|||
}
|
||||
// Shaders don't always output colors (for instance if they write to depth only)
|
||||
if (!first_output_name.empty())
|
||||
OS << " if (isAlphaTested && Out." << first_output_name << ".a <= alphaRef) discard;\n";
|
||||
{
|
||||
switch (m_prog.alpha_func)
|
||||
{
|
||||
case rsx::comparaison_function::equal:
|
||||
OS << " if (isAlphaTested && Out." << first_output_name << ".a != alphaRef) discard;\n";
|
||||
break;
|
||||
case rsx::comparaison_function::not_equal:
|
||||
OS << " if (isAlphaTested && Out." << first_output_name << ".a == alphaRef) discard;\n";
|
||||
break;
|
||||
case rsx::comparaison_function::less_or_equal:
|
||||
OS << " if (isAlphaTested && Out." << first_output_name << ".a > alphaRef) discard;\n";
|
||||
break;
|
||||
case rsx::comparaison_function::less:
|
||||
OS << " if (isAlphaTested && Out." << first_output_name << ".a >= alphaRef) discard;\n";
|
||||
break;
|
||||
case rsx::comparaison_function::greater:
|
||||
OS << " if (isAlphaTested && Out." << first_output_name << ".a <= alphaRef) discard;\n";
|
||||
break;
|
||||
case rsx::comparaison_function::greater_or_equal:
|
||||
OS << " if (isAlphaTested && Out." << first_output_name << ".a < alphaRef) discard;\n";
|
||||
break;
|
||||
}
|
||||
|
||||
}
|
||||
OS << " return Out;" << std::endl;
|
||||
OS << "}" << std::endl;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue