rsx: Use multithreaded shader compiler backend

This commit is contained in:
kd-11 2020-10-27 23:41:20 +03:00 committed by kd-11
parent e89a568765
commit 3ddfa288cf
30 changed files with 1065 additions and 580 deletions

View file

@ -561,41 +561,6 @@ namespace rsx
}
});
g_fxo->init<named_thread>("RSX Decompiler Thread", [this]
{
const auto shadermode = g_cfg.video.shadermode.get();
if (shadermode != shader_mode::async_recompiler && shadermode != shader_mode::async_with_interpreter)
{
// Die
return;
}
on_decompiler_init();
if (g_cfg.core.thread_scheduler_enabled)
{
thread_ctrl::set_thread_affinity_mask(thread_ctrl::get_affinity_mask(thread_class::rsx));
}
while (!Emu.IsStopped() && !m_rsx_thread_exiting)
{
if (!on_decompiler_task())
{
if (Emu.IsPaused())
{
std::this_thread::sleep_for(1ms);
}
else
{
std::this_thread::sleep_for(500us);
}
}
}
on_decompiler_exit();
});
// Raise priority above other threads
thread_ctrl::set_native_priority(1);
@ -1779,10 +1744,10 @@ namespace rsx
const auto [program_offset, program_location] = method_registers.shader_program_address();
result.addr = vm::base(rsx::get_address(program_offset, program_location, HERE));
current_fp_metadata = program_hash_util::fragment_program_utils::analyse_fragment_program(result.addr);
result.data = vm::base(rsx::get_address(program_offset, program_location, HERE));
current_fp_metadata = program_hash_util::fragment_program_utils::analyse_fragment_program(result.get_data());
result.addr = (static_cast<u8*>(result.addr) + current_fp_metadata.program_start_offset);
result.data = (static_cast<u8*>(result.get_data()) + current_fp_metadata.program_start_offset);
result.offset = program_offset + current_fp_metadata.program_start_offset;
result.ucode_length = current_fp_metadata.program_ucode_length;
result.total_length = result.ucode_length + current_fp_metadata.program_start_offset;