squash reallocs in command buffers by using large prealloced buffer, directly use virtual memory with it so os allocs on demand

mark raw clock functions as noinline, the way msvc was inlining them and ordering the branches meant that rdtsc would often be speculatively executed
add alternative clock impl for win, instead of using queryperformancecounter we grab systemtime from kusershared. it does not have the same precision as queryperformancecounter, we only have 100 nanosecond precision, but we round to milliseconds so it never made sense to use the performance counter in the first place
stubbed out the "guest clock mutex"... (the entirety of clock.cc needs a rewrite)
added some helpers for minf/maxf without the nan handling behavior
This commit is contained in:
chss95cs@gmail.com
2022-08-14 13:42:08 -07:00
parent c9b2d10e17
commit 7cc364dcb8
11 changed files with 263 additions and 38 deletions

View File

@@ -33,11 +33,15 @@ class Clock {
// Either from platform suplied time source or from hardware directly.
static uint64_t host_tick_frequency_platform();
#if XE_CLOCK_RAW_AVAILABLE
XE_NOINLINE
static uint64_t host_tick_frequency_raw();
#endif
// Host tick count. Generally QueryHostTickCount() should be used.
static uint64_t host_tick_count_platform();
#if XE_CLOCK_RAW_AVAILABLE
//chrispy: the way msvc was ordering the branches was causing rdtsc to be speculatively executed each time
//the branch history was lost
XE_NOINLINE
static uint64_t host_tick_count_raw();
#endif