diff options
author | Fox Caminiti <fox@foxcam.net> | 2022-08-21 22:05:10 -0400 |
---|---|---|
committer | Fox Caminiti <fox@foxcam.net> | 2022-08-21 22:05:10 -0400 |
commit | d03d7187c1881237b1a98404a125507d33d85a0e (patch) | |
tree | e0409ebb4bec224b1231317e3e7743fb9349b989 /debug.h | |
parent | ed51dab429e467fc144f0bfbed70a5291c8a0a27 (diff) |
a bit of housekeeping
Diffstat (limited to 'debug.h')
-rw-r--r-- | debug.h | 32 |
1 files changed, 15 insertions, 17 deletions
@@ -15,10 +15,6 @@ union debugval { int32 i; }; -enum PerfID { - perf_renderframe -}; - // things that get cleared every frame with the UI struct debug_temp { @@ -41,15 +37,6 @@ struct project_debug static project_debug Debug; - -#if DEBUG -#define Debug_CycleCountStart(ID) Debug.CycleCount[ID] = __rdtsc(); -#define Debug_CycleCountEnd(ID) Debug.EndCycleCount[ID] += __rdtsc() - Debug.CycleCount[ID]; Debug.ExecutionAmount[ID]++; -#else -#define Debug_CycleCountStart(ID) -#define Debug_CycleCountEnd(ID) -#endif - static void DebugWatchVar(char *Name, void *Address, valtype Type) { uint32 i = Debug.Temp.WatchedProperties; @@ -64,6 +51,17 @@ DebugWatchVar(char *Name, void *Address, valtype Type) { Debug.Temp.WatchedProperties++; } +static void +DebugPrintMemoryUsage(memory Memory) +{ + for (int i = 0; i < 8; i++) { + memory_table Table = Memory.Slot[i]; + printf("%s: %li bytes, %li kb\n", Table.Name, Table.CurrentPosition, Table.CurrentPosition / 1024); + } +} + + + #else #define Assert(Expression) @@ -82,12 +80,13 @@ struct project_debug { }; -#define DEBUG_CycleCountStart(ID) -#define DEBUG_CycleCountEnd(ID) - static void DebugWatchVar(char *Name, void *Address, valtype Type) { } + +static void +DebugPrintMemoryUsage(memory Memory) { +} #endif #ifdef PERF @@ -99,7 +98,6 @@ struct perf_stats uint64 PixelCountChecked; }; -static perf_stats Perf; static uint64 Test; #endif |