CPU/Recompiler: Use PGXP interpreter for fallback

Fixes holes in geometry with PGXP enabled in Threads of Fate.
This commit is contained in:
Connor McLaughlin 2021-01-01 17:16:54 +10:00
parent 4e87b30b40
commit c9240eea72
3 changed files with 12 additions and 3 deletions

View file

@ -193,7 +193,7 @@ static void ExecuteImpl()
CodeBlock* block = LookupBlock(next_block_key); CodeBlock* block = LookupBlock(next_block_key);
if (!block) if (!block)
{ {
InterpretUncachedBlock(); InterpretUncachedBlock<pgxp_mode>();
continue; continue;
} }
@ -629,8 +629,10 @@ void FastCompileBlockFunction()
CodeBlock* block = LookupBlock(GetNextBlockKey()); CodeBlock* block = LookupBlock(GetNextBlockKey());
if (block) if (block)
s_single_block_asm_dispatcher(block->host_code); s_single_block_asm_dispatcher(block->host_code);
else if (g_settings.gpu_pgxp_enable)
InterpretUncachedBlock<PGXPMode::Memory>();
else else
InterpretUncachedBlock(); InterpretUncachedBlock<PGXPMode::Disabled>();
} }
#endif #endif

View file

@ -126,6 +126,8 @@ void InvalidateBlocksWithPageIndex(u32 page_index);
template<PGXPMode pgxp_mode> template<PGXPMode pgxp_mode>
void InterpretCachedBlock(const CodeBlock& block); void InterpretCachedBlock(const CodeBlock& block);
template<PGXPMode pgxp_mode>
void InterpretUncachedBlock(); void InterpretUncachedBlock();
/// Invalidates any code pages which overlap the specified range. /// Invalidates any code pages which overlap the specified range.

View file

@ -1856,6 +1856,7 @@ template void InterpretCachedBlock<PGXPMode::Disabled>(const CodeBlock& block);
template void InterpretCachedBlock<PGXPMode::Memory>(const CodeBlock& block); template void InterpretCachedBlock<PGXPMode::Memory>(const CodeBlock& block);
template void InterpretCachedBlock<PGXPMode::CPU>(const CodeBlock& block); template void InterpretCachedBlock<PGXPMode::CPU>(const CodeBlock& block);
template<PGXPMode pgxp_mode>
void InterpretUncachedBlock() void InterpretUncachedBlock()
{ {
g_state.regs.npc = g_state.regs.pc; g_state.regs.npc = g_state.regs.pc;
@ -1890,7 +1891,7 @@ void InterpretUncachedBlock()
} }
// execute the instruction we previously fetched // execute the instruction we previously fetched
ExecuteInstruction<PGXPMode::Disabled>(); ExecuteInstruction<pgxp_mode>();
// next load delay // next load delay
UpdateLoadDelay(); UpdateLoadDelay();
@ -1905,6 +1906,10 @@ void InterpretUncachedBlock()
} }
} }
template void InterpretUncachedBlock<PGXPMode::Disabled>();
template void InterpretUncachedBlock<PGXPMode::Memory>();
template void InterpretUncachedBlock<PGXPMode::CPU>();
} // namespace CodeCache } // namespace CodeCache
namespace Recompiler::Thunks { namespace Recompiler::Thunks {