summaryrefslogtreecommitdiff
path: root/debug.h
diff options
context:
space:
mode:
Diffstat (limited to 'debug.h')
-rw-r--r--debug.h32
1 files changed, 15 insertions, 17 deletions
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