Clipping donegit status! loading and showing sponza mini

This commit is contained in:
Krzosa Karol
2022-02-25 21:16:25 +01:00
parent fd8ce7d1a9
commit 372e4fd16b
10 changed files with 885 additions and 433 deletions

22
profile.cpp Normal file
View File

@@ -0,0 +1,22 @@
enum ProfileScopeName {
ProfileScopeName_draw_triangle,
ProfileScopeName_Count,
};
struct ProfileScope {
F64 samples[5096];
I64 i;
};
GLOBAL ProfileScope profile_scopes[ProfileScopeName_Count];
#define PROFILE_BEGIN(name) do { \
ProfileScope *__profile_scope = profile_scopes + ProfileScopeName_##name; \
__profile_scope->samples[__profile_scope->i] = os_time(); \
} while (0)
#define PROFILE_END(name) do { \
ProfileScope *_profile_scope = profile_scopes + ProfileScopeName_##name; \
_profile_scope->samples[_profile_scope->i] = os_time() - _profile_scope->samples[_profile_scope->i]; \
_profile_scope->i = (_profile_scope->i + 1) % 5096; \
}while (0)