Renderer: add engine-owned debug modes, overlay, and GPU-timing scaffolding - #14
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation
Description
engine/render/debug_renderer.{hpp,cpp}) that definesRendererDebugMode, counters, per-pass timing (RendererPassTiming), a frameRendererDebugSnapshot, program override bindings, and an encapsulatedRendererDebugStatewith runtime switching and overlay text formatting.RendererAPI (engine/render/renderer.hpp) with debug controls and hooks:set_debug_mode,set_debug_mode_from_index,cycle_debug_mode,set_debug_program_overrides,set_debug_counters,add_debug_pass_timing, anddebug_snapshot.engine/render/bgfx/renderer_bgfx.cpp) so modes are applied at frame begin (dbg text/wireframe flag) and at submit time (program/state overrides for normals, albedo, depth, and overdraw); overdraw uses additive/no-depth state as an approximation.1..8+Tab) to switch modes, debug shader programs undershaders/debug/renderer_debug/*, and manifest entries inshaders/shaders.cmake; updated docs and README to describe modes and limits.Testing
g++ -std=c++20 -I. tests/render/debug_renderer_tests.cpp engine/render/debug_renderer.cpp && ./a.outwhich passed successfully and validated mode switching, snapshot, counters, and overlay line generation.tests/render/renderer_lifecycle_tests.cpp) and addedrender_debug_renderer_teststo CMake test wiring so the new test will run under CI when dependencies are configured.--preset linux-debugcould not be completed in this environment due to missing platform dependencies (SDL3/bgfx roots), so the integrated shader compilation and end-to-end runtime validation were not executed here (this is expected in the current CI environment and logged in build output).Codex Task