rsx: Optimize FIFO PUT masking

This commit is contained in:
Eladash 2019-09-29 20:23:52 +03:00 committed by kd-11
parent bcf8799079
commit 70b4ae6bd6
2 changed files with 12 additions and 4 deletions

View file

@ -17,7 +17,7 @@ namespace rsx
{
m_internal_get += 4;
if (wait && read_put() == m_internal_get)
if (wait && read_put<false>() == 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
@ -30,9 +30,17 @@ namespace rsx
}
}
template <bool full>
u32 FIFO_control::read_put()
{
return m_ctrl->put.and_fetch(~3);
if constexpr (!full)
{
return m_ctrl->put & ~3;
}
else
{
return m_ctrl->put.and_fetch(~3);
}
}
void FIFO_control::set_put(u32 put)
@ -65,7 +73,7 @@ namespace rsx
{
// Fast read with no processing, only safe inside a PACKET_BEGIN+count block
if (m_remaining_commands &&
m_internal_get != read_put())
m_internal_get != read_put<false>())
{
m_command_reg += m_command_inc;
m_args_ptr += 4;

View file

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