Toggles render profiling output (shows detailed timing breakdown every 120 frames).
Takes no parameters.
Returns nothing.
3D Graphics
Parameters & Returns
Parameters
This function takes no parameters.
Returns
Void
Quick Summary
Toggles render profiling output (shows detailed timing breakdown every 120 frames).
Takes no parameters.
Returns nothing.
Technical Exegesis...
Toggles render profiling output (shows detailed timing breakdown every 120 frames). Takes no parameters. Returns nothing. Flips g_showRenderProfiling flag and prints status message.
This function toggles profiling.
Toggles render profiling output (shows detailed timing breakdown every 120 frames). Takes no parameters. Returns nothing. Flips g_showRenderProfiling flag and prints status message.
This function toggles profiling. When enabled: profiling data accumulated over 120 frames, average timings displayed every 120 frames (1/120 of accumulated time), output shows: animations+physics timing, camera updates, hierarchy transforms, frustum culling + GPU command building, render loop breakdown (mesh group iteration, material uploads, draw calls), entity counts (total/mesh), mesh group statistics (draw calls, unique signatures). Output format: timing in milliseconds (ms), averages over 120 frames for stability, displayed to stderr (std::cerr), prefixed with section names. Toggle operation: first call enables profiling (sets flag to true), second call disables profiling (sets flag to false), continues toggling with each call, prints "[PROFILING] Render profiling ENABLED" or "DISABLED". Use cases: (1) Performance analysis (identify bottlenecks in render pipeline), (2) Optimization validation (measure impact of code changes), (3) Scene complexity analysis (understand entity/mesh group costs), (4) GPU vs CPU balance (see where time is spent), (5) Debugging frame drops (identify expensive operations). Common patterns: enable during development = call once at startup for continuous profiling, hotkey toggle = bind to key press for on-demand profiling (press P to toggle in examples), temporary profiling = enable before test, run 120 frames, disable, conditional profiling = if entityCount > 10000 then b3dShowRenderProfiling(). Typical usage: call in Setup() function to enable from start, bind to hotkey for runtime toggle (useful for comparisons), enable when debugging performance issues. Profiling sections: [0] Animations+Physics (skeletal animation + Jolt physics update), [1] Cameras (camera transform updates), [2] HierarchyTransform (GPU compute shader for parent-child transforms), [3] CameraPos+Radiance (camera position upload + radiance setup), [4] Shadows+Lights (shadow map setup + light processing), [5] ShadowPass (shadow map rendering), [6] EntityCache (entity visibility filtering), [7] FrustumCull+CmdBuild (frustum culling + GPU command buffer building), [8] RenderSetup (PSO binding + root signature setup), [9] RenderLoop (main rendering loop), [11] MeshGroupWalk (iterating mesh groups), [12] MaterialUpload (material constant buffer uploads), [13] DrawCalls (ExecuteIndirect/DrawInstanced calls), [10] TOTAL (sum of all sections). Additional metrics: DrawCalls/frame (number of draw calls per frame), MeshGroups walked/frame (mesh groups processed), UniqueSignatures (number of unique mesh signatures), Entities (total) (total active entities), Entities (mesh) (visible mesh entities). Performance impact: minimal when disabled (single boolean check), small when enabled (timing accumulation, no synchronization), output only every 120 frames (minimal console spam). Global state: g_showRenderProfiling is global flag (affects all rendering, not per-camera), persists across frames until toggled again. 120 frame average: reduces noise from frame-to-frame variance, provides stable measurements, takes 2 seconds at 60 FPS for one output. Related: b3dShowConsoleOutput enables general debug output (different from profiling), timing done with std::chrono high_resolution_clock (microsecond precision).
Example
Example.bam
; Enable profiling at startup for continuous monitoring
b3dShowRenderProfiling()
; Hotkey toggle for on-demand profilingIf inpIsKeyHit(VKEY_P) Then
b3dShowRenderProfiling()
EndIf