mirror of
https://github.com/RPCS3/rpcs3.git
synced 2025-07-13 18:28:35 +12:00
rsx: Compile shaders when CELL is not running
This commit is contained in:
parent
dea1d01de2
commit
1e71deb0db
4 changed files with 44 additions and 24 deletions
|
@ -813,7 +813,6 @@ void try_spawn_ppu_if_exclusive_program(const ppu_module& m)
|
|||
|
||||
auto ppu = idm::make_ptr<named_thread<ppu_thread>>("PPU[0x1000000] Thread (test_thread)", p, "test_thread", 0);
|
||||
|
||||
ppu->cmd_push({ppu_cmd::initialize, 0});
|
||||
ppu->cia = m.funcs[0].addr;
|
||||
|
||||
// For kernel explorer
|
||||
|
|
|
@ -943,7 +943,15 @@ void ppu_thread::cpu_task()
|
|||
}
|
||||
case ppu_cmd::initialize:
|
||||
{
|
||||
cmd_pop(), ppu_initialize(), spu_cache::initialize();
|
||||
cmd_pop();
|
||||
|
||||
while (!g_fxo->get<rsx::thread>().is_inited && !is_stopped())
|
||||
{
|
||||
// Wait for RSX to be initialized
|
||||
thread_ctrl::wait_on(g_fxo->get<rsx::thread>().is_inited, false);
|
||||
}
|
||||
|
||||
ppu_initialize(), spu_cache::initialize();
|
||||
break;
|
||||
}
|
||||
case ppu_cmd::sleep:
|
||||
|
|
|
@ -506,27 +506,12 @@ namespace rsx
|
|||
|
||||
void thread::cpu_task()
|
||||
{
|
||||
while (Emu.IsReady())
|
||||
{
|
||||
// Wait for startup (TODO)
|
||||
while (m_rsx_thread_exiting)
|
||||
{
|
||||
// Wait for external pause events
|
||||
if (external_interrupt_lock)
|
||||
{
|
||||
wait_pause();
|
||||
}
|
||||
|
||||
thread_ctrl::wait_for(1000);
|
||||
|
||||
if (is_stopped())
|
||||
{
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
on_task();
|
||||
thread_ctrl::wait_for(1000);
|
||||
}
|
||||
|
||||
on_task();
|
||||
on_exit();
|
||||
}
|
||||
|
||||
|
@ -548,7 +533,7 @@ namespace rsx
|
|||
g_tls_log_prefix = []
|
||||
{
|
||||
const auto rsx = get_current_renderer();
|
||||
return fmt::format("RSX [0x%07x]", +rsx->ctrl->get);
|
||||
return fmt::format("RSX [0x%07x]", rsx->ctrl ? +rsx->ctrl->get : 0);
|
||||
};
|
||||
|
||||
method_registers.init();
|
||||
|
@ -558,12 +543,42 @@ namespace rsx
|
|||
g_fxo->get<rsx::dma_manager>().init();
|
||||
on_init_thread();
|
||||
|
||||
is_inited = true;
|
||||
is_inited.notify_all();
|
||||
|
||||
if (!zcull_ctrl)
|
||||
{
|
||||
//Backend did not provide an implementation, provide NULL object
|
||||
zcull_ctrl = std::make_unique<::rsx::reports::ZCULL_control>();
|
||||
}
|
||||
|
||||
performance_counters.state = FIFO_state::empty;
|
||||
|
||||
// Wait for startup (TODO)
|
||||
while (m_rsx_thread_exiting)
|
||||
{
|
||||
// Wait for external pause events
|
||||
if (external_interrupt_lock)
|
||||
{
|
||||
wait_pause();
|
||||
}
|
||||
|
||||
// Execute backend-local tasks first
|
||||
do_local_task(performance_counters.state);
|
||||
|
||||
// Update sub-units
|
||||
zcull_ctrl->update(this);
|
||||
|
||||
if (is_stopped())
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
thread_ctrl::wait_for(1000);
|
||||
}
|
||||
|
||||
performance_counters.state = FIFO_state::running;
|
||||
|
||||
fifo_ctrl = std::make_unique<::rsx::FIFO::FIFO_control>(this);
|
||||
|
||||
last_flip_time = get_system_time() - 1000000;
|
||||
|
@ -644,9 +659,6 @@ namespace rsx
|
|||
thread_ctrl::set_thread_affinity_mask(thread_ctrl::get_affinity_mask(thread_class::rsx));
|
||||
}
|
||||
|
||||
// Round to nearest to deal with forward/reverse scaling
|
||||
fesetround(FE_TONEAREST);
|
||||
|
||||
while (!test_stopped())
|
||||
{
|
||||
// Wait for external pause events
|
||||
|
|
|
@ -649,6 +649,7 @@ namespace rsx
|
|||
u32 dbg_step_pc = 0;
|
||||
atomic_t<u32> external_interrupt_lock{ 0 };
|
||||
atomic_t<bool> external_interrupt_ack{ false };
|
||||
atomic_t<bool> is_inited{ false };
|
||||
bool is_fifo_idle() const;
|
||||
void flush_fifo();
|
||||
void recover_fifo();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue