Demo update and start counting tests times
-Fixed performance issue with multithreading and rendering -start making better shaders (by using many macros) -speed up rendeing when maximum objects count was reached -remove map rendering form Snake demo, and render entities by themself -start adding depth and color rendering parameters -added properly names to jobs (for debugging purpses) -starts adding multithreaded rendering -added some math to vectors -changes execute() to willExecute(). Probably should have different name.
This commit is contained in:
parent
46aba822d0
commit
4bd5a37b5d
13 changed files with 429 additions and 198 deletions
66
tests/time.d
Normal file
66
tests/time.d
Normal file
|
|
@ -0,0 +1,66 @@
|
|||
module tests.time;
|
||||
|
||||
|
||||
version (WebAssembly)
|
||||
{
|
||||
alias int time_t;
|
||||
alias int clockid_t;
|
||||
enum CLOCK_REALTIME = 0;
|
||||
|
||||
struct timespec
|
||||
{
|
||||
time_t tv_sec;
|
||||
int tv_nsec;
|
||||
}
|
||||
|
||||
extern (C) int clock_gettime(clockid_t, timespec*) @nogc nothrow @system;
|
||||
|
||||
struct Time
|
||||
{
|
||||
static long getUSecTime()
|
||||
{
|
||||
time_t time;
|
||||
timespec spec;
|
||||
|
||||
clock_gettime(CLOCK_REALTIME, &spec);
|
||||
|
||||
//time = spec.tv_sec;
|
||||
return spec.tv_sec * 1000_000 + spec.tv_nsec / 1000; //time / 1000_000;
|
||||
}
|
||||
}
|
||||
}
|
||||
else version (Windows)
|
||||
{
|
||||
import core.stdc.stdio : printf;
|
||||
import core.sys.windows.windows;
|
||||
|
||||
struct Time
|
||||
{
|
||||
static long getUSecTime()
|
||||
{
|
||||
LARGE_INTEGER time, freq;
|
||||
QueryPerformanceFrequency(&freq);
|
||||
QueryPerformanceCounter(&time);
|
||||
return time.QuadPart / (freq.QuadPart / 1000_000);
|
||||
}
|
||||
}
|
||||
}
|
||||
else version (Posix)
|
||||
{
|
||||
import core.stdc.stdio : printf;
|
||||
import core.sys.posix.time;
|
||||
|
||||
struct Time
|
||||
{
|
||||
static long getUSecTime()
|
||||
{
|
||||
time_t time;
|
||||
timespec spec;
|
||||
|
||||
clock_gettime(CLOCK_REALTIME, &spec);
|
||||
|
||||
//time = spec.tv_sec;
|
||||
return spec.tv_sec * 1000_000 + spec.tv_nsec / 1000; //time / 1000_000;
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue