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:
kd-11 2017-09-05 16:25:02 +03:00
parent 2d0f1f27a8
commit 9359b8c170
1 changed files with 9 additions and 2 deletions

View File

@ -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();