diff --git a/src/components/game/PerformanceDashboard.tsx b/src/components/game/PerformanceDashboard.tsx index 6fb6938b..072f89b5 100644 --- a/src/components/game/PerformanceDashboard.tsx +++ b/src/components/game/PerformanceDashboard.tsx @@ -294,31 +294,52 @@ export const PerformanceDashboard = memo(function PerformanceDashboard({ )} - {/* Entity Counts */} + {/* Entity Counts & GPU Memory by Category */} {expanded && (
Entities
-
+
+ {/* GPU Memory per category */} + {snapshot.gpuMemory.totalMB > 0 && ( +
+ {snapshot.gpuMemory.categories + .filter(cat => cat.currentMB > 0.1) + .map(cat => ( +
+ {cat.name}: + {cat.currentMB.toFixed(1)}MB +
+ )) + } +
+ )}
)} - {/* Memory Usage (Chrome only) */} + {/* JS Heap Memory (Chrome only) */} {expanded && snapshot.memory.available && (
- Memory + JS Heap {PerformanceMonitor.formatBytes(snapshot.memory.usedJSHeapSize)} / {PerformanceMonitor.formatBytes(snapshot.memory.jsHeapSizeLimit)}
-
+
)} - {/* GPU Timing */} + {/* GPU (Timing + Memory combined) */} {expanded && (
GPU - {snapshot.render.gpuTimingAvailable ? ( - 12 ? '#ef4444' : - snapshot.render.gpuFrameTimeMs > 8 ? '#eab308' : '#22c55e', - }}> - {snapshot.render.gpuFrameTimeAvgMs.toFixed(2)}ms avg - - ) : ( - N/A - )} +
+ {snapshot.render.gpuTimingAvailable && ( + 12 ? '#ef4444' : + snapshot.render.gpuFrameTimeMs > 8 ? '#eab308' : '#22c55e', + }}> + {snapshot.render.gpuFrameTimeAvgMs.toFixed(2)}ms + + )} + {snapshot.gpuMemory.totalMB > 0 && ( + 80 ? '#ef4444' : + snapshot.gpuMemory.usagePercent > 60 ? '#eab308' : '#888', + }}> + {snapshot.gpuMemory.totalMB.toFixed(0)}MB + + )} +
+ {/* GPU Memory bar */} + {snapshot.gpuMemory.totalMB > 0 && ( +
+
80 ? '#ef4444' : + snapshot.gpuMemory.usagePercent > 60 ? '#eab308' : '#3b82f6', + transition: 'width 0.3s ease-out', + }} + /> +
+ )} + {/* Draw Calls & Triangles */}
-
-
Draw Calls
-
500 ? '#eab308' : '#aaa' }}> +
+ Draws: + 500 ? '#eab308' : '#aaa' }}> {snapshot.render.drawCalls.toLocaleString()} -
+
-
-
Triangles
-
+
+ Tris: + {(snapshot.render.triangles / 1000).toFixed(0)}K -
+
)} - {/* GPU Memory */} - {expanded && snapshot.gpuMemory.totalMB > 0 && ( -
-
- GPU Memory - 80 ? '#ef4444' : - snapshot.gpuMemory.usagePercent > 60 ? '#eab308' : '#888', - }}> - {snapshot.gpuMemory.totalMB.toFixed(0)}MB / {snapshot.gpuMemory.budgetMB}MB - -
-
-
80 ? '#ef4444' : - snapshot.gpuMemory.usagePercent > 60 ? '#eab308' : '#3b82f6', - transition: 'width 0.3s ease-out', - }} - /> -
- {/* Category breakdown */} -
- {snapshot.gpuMemory.categories - .filter(cat => cat.currentMB > 0.1) - .slice(0, 4) - .map(cat => ( -
- {cat.name}: - {cat.currentMB.toFixed(0)}MB -
- )) - } -
-
- )} - {/* Network (if connected) */} {expanded && snapshot.network.connected && (
@@ -436,17 +434,6 @@ export const PerformanceDashboard = memo(function PerformanceDashboard({
)} - {/* Footer */} -
- Performance Dashboard v1.0 -
); });