mirror of https://github.com/RPCS3/rpcs3.git
rsx: Timestamp accuracy workaround
This commit is contained in:
parent
1200ca8172
commit
373e02e91c
|
@ -1207,10 +1207,19 @@ namespace rsx
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
u64 thread::timestamp() const
|
u64 thread::timestamp()
|
||||||
{
|
{
|
||||||
// Get timestamp, and convert it from microseconds to nanoseconds
|
// Get timestamp, and convert it from microseconds to nanoseconds
|
||||||
return get_system_time() * 1000;
|
const u64 t = get_system_time() * 1000;
|
||||||
|
if (t != timestamp_ctrl)
|
||||||
|
{
|
||||||
|
timestamp_ctrl = t;
|
||||||
|
timestamp_subvalue = 0;
|
||||||
|
return t;
|
||||||
|
}
|
||||||
|
|
||||||
|
timestamp_subvalue += 10;
|
||||||
|
return t + timestamp_subvalue;
|
||||||
}
|
}
|
||||||
|
|
||||||
gsl::span<const gsl::byte> thread::get_raw_index_array(const std::vector<std::pair<u32, u32> >& draw_indexed_clause) const
|
gsl::span<const gsl::byte> thread::get_raw_index_array(const std::vector<std::pair<u32, u32> >& draw_indexed_clause) const
|
||||||
|
|
|
@ -326,6 +326,9 @@ namespace rsx
|
||||||
std::shared_ptr<thread_ctrl> m_vblank_thread;
|
std::shared_ptr<thread_ctrl> m_vblank_thread;
|
||||||
std::shared_ptr<thread_ctrl> m_decompiler_thread;
|
std::shared_ptr<thread_ctrl> m_decompiler_thread;
|
||||||
|
|
||||||
|
u64 timestamp_ctrl = 0;
|
||||||
|
u64 timestamp_subvalue = 0;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
atomic_t<bool> m_rsx_thread_exiting{true};
|
atomic_t<bool> m_rsx_thread_exiting{true};
|
||||||
s32 m_return_addr{-1}, restore_ret_addr{-1};
|
s32 m_return_addr{-1}, restore_ret_addr{-1};
|
||||||
|
@ -496,7 +499,7 @@ namespace rsx
|
||||||
virtual void on_init_thread() = 0;
|
virtual void on_init_thread() = 0;
|
||||||
virtual bool do_method(u32 /*cmd*/, u32 /*value*/) { return false; }
|
virtual bool do_method(u32 /*cmd*/, u32 /*value*/) { return false; }
|
||||||
virtual void flip(int buffer) = 0;
|
virtual void flip(int buffer) = 0;
|
||||||
virtual u64 timestamp() const;
|
virtual u64 timestamp();
|
||||||
virtual bool on_access_violation(u32 /*address*/, bool /*is_writing*/) { return false; }
|
virtual bool on_access_violation(u32 /*address*/, bool /*is_writing*/) { return false; }
|
||||||
virtual void on_invalidate_memory_range(u32 /*address*/, u32 /*range*/) {}
|
virtual void on_invalidate_memory_range(u32 /*address*/, u32 /*range*/) {}
|
||||||
virtual void notify_tile_unbound(u32 /*tile*/) {}
|
virtual void notify_tile_unbound(u32 /*tile*/) {}
|
||||||
|
|
Loading…
Reference in New Issue