rsx: Mask FIFO PUT on rsx execution

This commit is contained in:
Eladash 2019-09-28 10:31:06 +03:00 committed by kd-11
parent 822287b418
commit 319fc8c55d
2 changed files with 10 additions and 9 deletions

View File

@ -17,26 +17,26 @@ namespace rsx
{
m_internal_get += 4;
if (wait && m_ctrl->put == m_internal_get)
if (wait && read_put() == m_internal_get)
{
// NOTE: Only supposed to be invoked to wait for a single arg on command[0] (4 bytes)
// Wait for put to allow us to procceed execution
sync_get();
while (m_ctrl->put == m_internal_get && !Emu.IsStopped())
while (read_put() == m_internal_get && !Emu.IsStopped())
{
std::this_thread::yield();
}
}
}
void FIFO_control::set_put(u32 put)
u32 FIFO_control::read_put()
{
if (m_ctrl->put == put)
{
return;
return m_ctrl->put.and_fetch(~3);
}
void FIFO_control::set_put(u32 put)
{
m_ctrl->put = put;
}
@ -65,7 +65,7 @@ namespace rsx
{
// Fast read with no processing, only safe inside a PACKET_BEGIN+count block
if (m_remaining_commands &&
m_internal_get != m_ctrl->put)
m_internal_get != read_put())
{
m_command_reg += m_command_inc;
m_args_ptr += 4;
@ -81,7 +81,7 @@ namespace rsx
void FIFO_control::read(register_pair& data)
{
const u32 put = m_ctrl->put;
const u32 put = read_put();
m_internal_get = m_ctrl->get;
if (put == m_internal_get)

View File

@ -131,6 +131,7 @@ namespace rsx
void inc_get(bool wait);
void set_get(u32 get);
void set_put(u32 put);
u32 read_put();
void read(register_pair& data);
inline bool read_unsafe(register_pair& data);