From d03d7187c1881237b1a98404a125507d33d85a0e Mon Sep 17 00:00:00 2001 From: Fox Caminiti Date: Sun, 21 Aug 2022 22:05:10 -0400 Subject: a bit of housekeeping --- debug.h | 32 +++++++++++++++----------------- 1 file changed, 15 insertions(+), 17 deletions(-) (limited to 'debug.h') diff --git a/debug.h b/debug.h index 5863298..0e6c9b6 100644 --- a/debug.h +++ b/debug.h @@ -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 -- cgit v1.2.3