mirror of
https://github.com/RPCS3/rpcs3.git
synced 2024-11-17 08:11:51 +00:00
rsx/fp: Shader decompiler fixes
- Requires proper 2-pass impl rsx/fp: Catch hanging code blocks rsx/fp: Don't pause on scaling error
This commit is contained in:
parent
2d0f1f27a8
commit
9359b8c170
@ -33,7 +33,6 @@ void FragmentProgramDecompiler::SetDst(std::string code, bool append_mask)
|
|||||||
|
|
||||||
default:
|
default:
|
||||||
LOG_ERROR(RSX, "Bad scale: %d", u32{ src1.scale });
|
LOG_ERROR(RSX, "Bad scale: %d", u32{ src1.scale });
|
||||||
Emu.Pause();
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -548,7 +547,7 @@ bool FragmentProgramDecompiler::handle_tex_srb(u32 opcode)
|
|||||||
if (DstExpectsSca() && (m_prog.shadow_textures & (1 << dst.tex_num)))
|
if (DstExpectsSca() && (m_prog.shadow_textures & (1 << dst.tex_num)))
|
||||||
{
|
{
|
||||||
m_shadow_sampled_textures |= (1 << dst.tex_num);
|
m_shadow_sampled_textures |= (1 << dst.tex_num);
|
||||||
SetDst(getFunction(FUNCTION::FUNCTION_TEXTURE_SAMPLE2D_PROJ), false); //No swizzle mask on shadow lookup
|
SetDst(getFunction(FUNCTION::FUNCTION_TEXTURE_SAMPLE2D_PROJ) + ".r", false); //No swizzle mask on shadow lookup
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
SetDst(getFunction(FUNCTION::FUNCTION_TEXTURE_SAMPLE2D_PROJ));
|
SetDst(getFunction(FUNCTION::FUNCTION_TEXTURE_SAMPLE2D_PROJ));
|
||||||
@ -758,6 +757,14 @@ std::string FragmentProgramDecompiler::Decompile()
|
|||||||
data += m_offset / sizeof(u32);
|
data += m_offset / sizeof(u32);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
while (m_code_level > 1)
|
||||||
|
{
|
||||||
|
LOG_ERROR(RSX, "Hanging block found at end of shader. Malformed shader?");
|
||||||
|
|
||||||
|
m_code_level--;
|
||||||
|
AddCode("}");
|
||||||
|
}
|
||||||
|
|
||||||
// flush m_code_level
|
// flush m_code_level
|
||||||
m_code_level = 1;
|
m_code_level = 1;
|
||||||
std::string m_shader = BuildCode();
|
std::string m_shader = BuildCode();
|
||||||
|
Loading…
Reference in New Issue
Block a user