mirror of
https://github.com/RPCS3/rpcs3.git
synced 2025-07-09 16:31:28 +12:00
GL/Vulkan: not discard fragment when hits NEVER comparsion (#2156)
GL/Vulkan: return no operation when comparison is never
This commit is contained in:
parent
7884356e90
commit
528b2d6c7b
2 changed files with 5 additions and 9 deletions
|
@ -349,10 +349,6 @@ void GLFragmentDecompilerThread::insertMainEnd(std::stringstream & OS)
|
|||
{
|
||||
auto make_comparison_test = [](rsx::comparison_function compare_func, const std::string &test, const std::string &a, const std::string &b) -> std::string
|
||||
{
|
||||
if (compare_func == rsx::comparison_function::always) return{};
|
||||
|
||||
if (compare_func == rsx::comparison_function::never) return " discard;\n";
|
||||
|
||||
std::string compare;
|
||||
switch (compare_func)
|
||||
{
|
||||
|
@ -362,6 +358,8 @@ void GLFragmentDecompilerThread::insertMainEnd(std::stringstream & OS)
|
|||
case rsx::comparison_function::less: compare = " < "; break;
|
||||
case rsx::comparison_function::greater: compare = " > "; break;
|
||||
case rsx::comparison_function::greater_or_equal: compare = " >= "; break;
|
||||
default:
|
||||
return "";
|
||||
}
|
||||
|
||||
return " if (" + test + "!(" + a + compare + b + ")) discard;\n";
|
||||
|
|
|
@ -356,10 +356,6 @@ void VKFragmentDecompilerThread::insertMainEnd(std::stringstream & OS)
|
|||
{
|
||||
auto make_comparison_test = [](rsx::comparison_function compare_func, const std::string &test, const std::string &a, const std::string &b) -> std::string
|
||||
{
|
||||
if (compare_func == rsx::comparison_function::always) return{};
|
||||
|
||||
if (compare_func == rsx::comparison_function::never) return " discard;\n";
|
||||
|
||||
std::string compare;
|
||||
switch (compare_func)
|
||||
{
|
||||
|
@ -369,6 +365,8 @@ void VKFragmentDecompilerThread::insertMainEnd(std::stringstream & OS)
|
|||
case rsx::comparison_function::less: compare = " < "; break;
|
||||
case rsx::comparison_function::greater: compare = " > "; break;
|
||||
case rsx::comparison_function::greater_or_equal: compare = " >= "; break;
|
||||
default:
|
||||
return "";
|
||||
}
|
||||
|
||||
return " if (" + test + "!(" + a + compare + b + ")) discard;\n";
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue