mirror of
https://github.com/RPCS3/rpcs3.git
synced 2025-07-12 09:48:37 +12:00
fix false alphakill flags when texture fetch is optimized away
This commit is contained in:
parent
458e5fa4e1
commit
8fa3f0721e
4 changed files with 29 additions and 6 deletions
|
@ -110,6 +110,17 @@ struct ParamArray
|
||||||
return nullptr;
|
return nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool HasParamTypeless(const ParamFlag flag, const std::string& name)
|
||||||
|
{
|
||||||
|
for (u32 i = 0; i<params[flag].size(); ++i)
|
||||||
|
{
|
||||||
|
if (params[flag][i].SearchName(name))
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
bool HasParam(const ParamFlag flag, std::string type, const std::string& name)
|
bool HasParam(const ParamFlag flag, std::string type, const std::string& name)
|
||||||
{
|
{
|
||||||
ParamType* t = SearchParam(flag, type);
|
ParamType* t = SearchParam(flag, type);
|
||||||
|
|
|
@ -348,8 +348,12 @@ void D3D12FragmentDecompiler::insertMainEnd(std::stringstream & OS)
|
||||||
{
|
{
|
||||||
if (m_prog.textures_alpha_kill[index])
|
if (m_prog.textures_alpha_kill[index])
|
||||||
{
|
{
|
||||||
std::string fetch_texture = insert_texture_fetch(m_prog, index) + ".a";
|
const std::string texture_name = "tex" + std::to_string(index);
|
||||||
OS << make_comparison_test((rsx::comparison_function)m_prog.textures_zfunc[index], "", "0", fetch_texture);
|
if (m_parr.HasParamTypeless(PF_PARAM_UNIFORM, texture_name))
|
||||||
|
{
|
||||||
|
std::string fetch_texture = insert_texture_fetch(m_prog, index) + ".a";
|
||||||
|
OS << make_comparison_test((rsx::comparison_function)m_prog.textures_zfunc[index], "", "0", fetch_texture);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -370,8 +370,12 @@ void GLFragmentDecompilerThread::insertMainEnd(std::stringstream & OS)
|
||||||
{
|
{
|
||||||
if (m_prog.textures_alpha_kill[index])
|
if (m_prog.textures_alpha_kill[index])
|
||||||
{
|
{
|
||||||
std::string fetch_texture = insert_texture_fetch(m_prog, index) + ".a";
|
const std::string texture_name = "tex" + std::to_string(index);
|
||||||
OS << make_comparison_test((rsx::comparison_function)m_prog.textures_zfunc[index], "", "0", fetch_texture);
|
if (m_parr.HasParamTypeless(PF_PARAM_UNIFORM, texture_name))
|
||||||
|
{
|
||||||
|
std::string fetch_texture = insert_texture_fetch(m_prog, index) + ".a";
|
||||||
|
OS << make_comparison_test((rsx::comparison_function)m_prog.textures_zfunc[index], "", "0", fetch_texture);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -373,8 +373,12 @@ void VKFragmentDecompilerThread::insertMainEnd(std::stringstream & OS)
|
||||||
{
|
{
|
||||||
if (m_prog.textures_alpha_kill[index])
|
if (m_prog.textures_alpha_kill[index])
|
||||||
{
|
{
|
||||||
std::string fetch_texture = vk::insert_texture_fetch(m_prog, index) + ".a";
|
const std::string texture_name = "tex" + std::to_string(index);
|
||||||
OS << make_comparison_test((rsx::comparison_function)m_prog.textures_zfunc[index], "", "0", fetch_texture);
|
if (m_parr.HasParamTypeless(PF_PARAM_UNIFORM, texture_name))
|
||||||
|
{
|
||||||
|
std::string fetch_texture = vk::insert_texture_fetch(m_prog, index) + ".a";
|
||||||
|
OS << make_comparison_test((rsx::comparison_function)m_prog.textures_zfunc[index], "", "0", fetch_texture);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue