mirror of
https://github.com/RPCSX/rpcsx.git
synced 2026-04-04 22:19:02 +00:00
rsx: Avoid calling slow functions every draw call
- Use TSC for timing where interval duration matters. - Use atomic counter for ordering timestamps otherwise.
This commit is contained in:
parent
762b594927
commit
cfecbb24ca
10 changed files with 80 additions and 31 deletions
|
|
@ -3,6 +3,7 @@
|
|||
#include "RSXFIFO.h"
|
||||
#include "RSXThread.h"
|
||||
#include "Capture/rsx_capture.h"
|
||||
#include "Common/time.hpp"
|
||||
#include "Emu/Cell/lv2/sys_rsx.h"
|
||||
|
||||
namespace rsx
|
||||
|
|
@ -395,7 +396,7 @@ namespace rsx
|
|||
{
|
||||
if (performance_counters.state == FIFO_state::running)
|
||||
{
|
||||
performance_counters.FIFO_idle_timestamp = get_system_time();
|
||||
performance_counters.FIFO_idle_timestamp = rsx::uclock();
|
||||
performance_counters.state = FIFO_state::nop;
|
||||
}
|
||||
|
||||
|
|
@ -405,7 +406,7 @@ namespace rsx
|
|||
{
|
||||
if (performance_counters.state == FIFO_state::running)
|
||||
{
|
||||
performance_counters.FIFO_idle_timestamp = get_system_time();
|
||||
performance_counters.FIFO_idle_timestamp = rsx::uclock();
|
||||
performance_counters.state = FIFO_state::empty;
|
||||
}
|
||||
else
|
||||
|
|
@ -437,7 +438,7 @@ namespace rsx
|
|||
//Jump to self. Often preceded by NOP
|
||||
if (performance_counters.state == FIFO_state::running)
|
||||
{
|
||||
performance_counters.FIFO_idle_timestamp = get_system_time();
|
||||
performance_counters.FIFO_idle_timestamp = rsx::uclock();
|
||||
sync_point_request.release(true);
|
||||
}
|
||||
|
||||
|
|
@ -456,7 +457,7 @@ namespace rsx
|
|||
//Jump to self. Often preceded by NOP
|
||||
if (performance_counters.state == FIFO_state::running)
|
||||
{
|
||||
performance_counters.FIFO_idle_timestamp = get_system_time();
|
||||
performance_counters.FIFO_idle_timestamp = rsx::uclock();
|
||||
sync_point_request.release(true);
|
||||
}
|
||||
|
||||
|
|
@ -513,7 +514,7 @@ namespace rsx
|
|||
}
|
||||
|
||||
// Update performance counters with time spent in idle mode
|
||||
performance_counters.idle_time += (get_system_time() - performance_counters.FIFO_idle_timestamp);
|
||||
performance_counters.idle_time += (rsx::uclock() - performance_counters.FIFO_idle_timestamp);
|
||||
}
|
||||
|
||||
do
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue