diff --git a/include/rendering/renderer.hpp b/include/rendering/renderer.hpp index e299bd6b..ae929d21 100644 --- a/include/rendering/renderer.hpp +++ b/include/rendering/renderer.hpp @@ -5,6 +5,7 @@ #include #include #include +#include #include #include #include @@ -293,6 +294,9 @@ public: #endif bool isAmdFsr3FramegenRuntimeActive() const { return fsr2_.amdFsr3FramegenRuntimeActive; } bool isAmdFsr3FramegenRuntimeReady() const { return fsr2_.amdFsr3FramegenRuntimeReady; } + size_t getAmdFsr3UpscaleDispatchCount() const { return fsr2_.amdFsr3UpscaleDispatchCount; } + size_t getAmdFsr3FramegenDispatchCount() const { return fsr2_.amdFsr3FramegenDispatchCount; } + size_t getAmdFsr3FallbackCount() const { return fsr2_.amdFsr3FallbackCount; } void setWaterRefractionEnabled(bool enabled); bool isWaterRefractionEnabled() const; @@ -444,6 +448,9 @@ private: bool amdFsr3FramegenEnabled = false; bool amdFsr3FramegenRuntimeActive = false; bool amdFsr3FramegenRuntimeReady = false; + size_t amdFsr3UpscaleDispatchCount = 0; + size_t amdFsr3FramegenDispatchCount = 0; + size_t amdFsr3FallbackCount = 0; float jitterSign = 0.38f; float motionVecScaleX = 1.0f; float motionVecScaleY = 1.0f; diff --git a/src/rendering/performance_hud.cpp b/src/rendering/performance_hud.cpp index 5008a3d6..6476b26e 100644 --- a/src/rendering/performance_hud.cpp +++ b/src/rendering/performance_hud.cpp @@ -203,6 +203,17 @@ void PerformanceHUD::render(const Renderer* renderer, const Camera* camera) { if (renderer->isFSR2Enabled()) { ImGui::TextColored(ImVec4(0.4f, 0.9f, 1.0f, 1.0f), "FSR 2.2: ON"); ImGui::Text(" JitterSign=%.2f", renderer->getFSR2JitterSign()); + const bool fgEnabled = renderer->isAmdFsr3FramegenEnabled(); + const bool fgReady = renderer->isAmdFsr3FramegenRuntimeReady(); + const bool fgActive = renderer->isAmdFsr3FramegenRuntimeActive(); + const char* fgStatus = "Disabled"; + if (fgEnabled) { + fgStatus = fgActive ? "Active" : (fgReady ? "Ready (waiting/fallback)" : "Unavailable"); + } + ImGui::Text(" FSR3 FG: %s", fgStatus); + ImGui::Text(" FG Dispatches: %zu", renderer->getAmdFsr3FramegenDispatchCount()); + ImGui::Text(" Upscale Dispatches: %zu", renderer->getAmdFsr3UpscaleDispatchCount()); + ImGui::Text(" FG Fallbacks: %zu", renderer->getAmdFsr3FallbackCount()); } ImGui::Spacing(); diff --git a/src/rendering/renderer.cpp b/src/rendering/renderer.cpp index 6fff9dc0..68d6bdf2 100644 --- a/src/rendering/renderer.cpp +++ b/src/rendering/renderer.cpp @@ -3759,6 +3759,9 @@ bool Renderer::initFSR2Resources() { fsr2_.amdFsr3FramegenRuntimeActive = false; fsr2_.amdFsr3FramegenRuntimeReady = false; fsr2_.framegenOutputValid = false; + fsr2_.amdFsr3UpscaleDispatchCount = 0; + fsr2_.amdFsr3FramegenDispatchCount = 0; + fsr2_.amdFsr3FallbackCount = 0; #if WOWEE_HAS_AMD_FSR2 LOG_INFO("FSR2: AMD FidelityFX SDK detected at build time."); #else @@ -4479,9 +4482,11 @@ void Renderer::dispatchAmdFsr3Framegen() { warnedRuntimeDispatch = true; LOG_WARNING("FSR3 runtime upscale dispatch failed; falling back to FSR2 dispatch output."); } + fsr2_.amdFsr3FallbackCount++; fsr2_.amdFsr3FramegenRuntimeActive = false; return; } + fsr2_.amdFsr3UpscaleDispatchCount++; if (!fsr2_.amdFsr3FramegenEnabled) { fsr2_.amdFsr3FramegenRuntimeActive = false; @@ -4497,9 +4502,11 @@ void Renderer::dispatchAmdFsr3Framegen() { warnedFgDispatch = true; LOG_WARNING("FSR3 runtime frame generation dispatch failed; using upscaled output only."); } + fsr2_.amdFsr3FallbackCount++; fsr2_.amdFsr3FramegenRuntimeActive = false; return; } + fsr2_.amdFsr3FramegenDispatchCount++; fsr2_.framegenOutputValid = true; fsr2_.amdFsr3FramegenRuntimeActive = true; #else