Skip to content

feat(upscaling): framegen in menus option#2284

Merged
alandtse merged 8 commits into
community-shaders:devfrom
SkrubbySkrubInAShrub:fg-toggle
May 6, 2026
Merged

feat(upscaling): framegen in menus option#2284
alandtse merged 8 commits into
community-shaders:devfrom
SkrubbySkrubInAShrub:fg-toggle

Conversation

@SkrubbySkrubInAShrub
Copy link
Copy Markdown
Collaborator

@SkrubbySkrubInAShrub SkrubbySkrubInAShrub commented May 4, 2026

Summary by CodeRabbit

  • New Features
    • Added a "Frame Generation in Menus" option (off by default) with tooltip; frame generation now respects this setting and whether menus/paused state allow it.
    • Centralized per-frame decision for when frame generation runs, used across timing, limiter, postprocessing, and presentation paths for consistent behavior.
  • Chores
    • Upscaling feature version bumped to 1-4-0.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 4, 2026

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review
📝 Walkthrough

Walkthrough

Adds a new setting frameGenerationAllowInMenus and UI checkbox, introduces Upscaling::ShouldUseFrameGenerationThisFrame() to centralize per-frame frame-generation eligibility (considers DX12 path, mode, menus/paused and the new setting), and updates frame-timing and Present calls to use that predicate. Config version bumped.

Changes

Frame Generation in Menus

Layer / File(s) Summary
Data Shape
src/Features/Upscaling.h
Adds Upscaling::Settings::frameGenerationAllowInMenus (bool, default false) and declares bool ShouldUseFrameGenerationThisFrame() const;.
Settings Serialization
src/Features/Upscaling.cpp
Includes frameGenerationAllowInMenus in settings serialization.
Decision Logic
src/Features/Upscaling.cpp
Implements Upscaling::ShouldUseFrameGenerationThisFrame() — returns true only when DX12 path active, settings.frameGenerationMode enabled, and (menus not open OR settings.frameGenerationAllowInMenus true), also checks UI paused state.
Frame Pacing Integration
src/Features/Upscaling.cpp
FrameLimiter uses ShouldUseFrameGenerationThisFrame() to choose half-rate vs full-rate frame-time scaling.
Post-processing / Present Integration
src/Features/Upscaling.cpp, src/Features/Upscaling/DX12SwapChain.cpp
Replaces inline checks with ShouldUseFrameGenerationThisFrame() in Main_PostProcessing and DX12SwapChain::Present (passed to FidelityFX Present).
UI Binding
src/Features/Upscaling.cpp
Adds "Frame Generation in Menus" checkbox bound to settings.frameGenerationAllowInMenus with explanatory tooltip.
Version Bump
features/Upscaling/Shaders/Features/Upscaling.ini
Config Version updated from 1-3-01-4-0.

Sequence Diagram(s)

sequenceDiagram
    participant UI as Game UI
    participant State as globals::state
    participant Upscaling as Upscaling
    participant SwapChain as DX12SwapChain
    participant FFX as fidelityFX

    UI->>Upscaling: toggle "Frame Generation in Menus" (settings updated)
    SwapChain->>Upscaling: call ShouldUseFrameGenerationThisFrame()
    Upscaling->>State: read menu flags / ui->GameIsPaused()
    Upscaling-->>SwapChain: return enabled/disabled
    SwapChain->>FFX: Present(..., frameGenerationEnabled=answer, isHDR)
    FFX-->>SwapChain: present result
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

Suggested reviewers

  • alandtse
  • doodlum

Poem

🐰 I tick a box, let frames skip through,

Menus open wide but motion stays true.
A hop, a tweak, a tiny choice made,
Pixels hum on, unpaused in the glade.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'feat(upscaling): framegen in menus option' clearly summarizes the main change: adding a user-configurable option to enable frame generation in menus, which aligns with all modifications across the codebase.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Comment @coderabbitai help to get the list of available commands and usage tips.

@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 4, 2026

No actionable suggestions for changed features.

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@src/Features/Upscaling.cpp`:
- Around line 1615-1619: The current ShouldUseFrameGeneration uses
ui->GameIsPaused() as a proxy for menus (in the return expression with
settings.frameGenerationAllowInMenus), which is incorrect; replace that pause
check with a real "menu open" check (e.g., call an existing UI method like
ui->IsMenuOpen()/ui->MenuIsOpen() or add one to the UI class that accurately
reports whether any game menu is visible) and use that instead of
GameIsPaused(); update the condition in Upscaling::ShouldUseFrameGeneration to
consult that menu-open helper so settings.frameGenerationAllowInMenus behaves
consistently across menu types.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 20f6f1ce-8483-470a-9944-3f63d7dd97a2

📥 Commits

Reviewing files that changed from the base of the PR and between d919016 and 8e5c07d.

📒 Files selected for processing (3)
  • src/Features/Upscaling.cpp
  • src/Features/Upscaling.h
  • src/Features/Upscaling/DX12SwapChain.cpp

Comment thread src/Features/Upscaling.cpp Outdated
@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 5, 2026

✅ A pre-release build is available for this PR:
Download

Copy link
Copy Markdown
Collaborator

@alandtse alandtse left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Was there a reason we disabled it before?

@SkrubbySkrubInAShrub
Copy link
Copy Markdown
Collaborator Author

Was there a reason we disabled it before?

Latency in menus, but people constantly complain that is causes a jarring reduction in fps. It's a harmless option for those who want it.

Copy link
Copy Markdown
Contributor

@soda3000 soda3000 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nitpick comment, otherwise good.

Comment thread src/Features/Upscaling.cpp Outdated
ImGui::Checkbox("Frame Generation in Menus", &settings.frameGenerationAllowInMenus);
if (auto _tt = Util::HoverTooltipWrapper()) {
ImGui::TextUnformatted("Keeps frame generation active while game menus are open.");
ImGui::TextUnformatted("May feel smoother, but can increase menu input latency.");
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"can increase" -> "increases" since FG necessarily adds input latency

@alandtse alandtse merged commit c7df037 into community-shaders:dev May 6, 2026
11 checks passed
ParticleTroned pushed a commit to ParticleTroned/skyrim-community-shaders that referenced this pull request May 15, 2026
Branch-preserving adaptation: keep this branch's VR/foveated Upscaling path and no-HDRDisplay swapchain handling, wiring the menu option into the current frame-generation call sites.
ParticleTroned added a commit to ParticleTroned/skyrim-community-shaders that referenced this pull request May 15, 2026
Keep IsFrameGenerationActive as the runtime-active predicate and use the State main/loading-menu helper for the per-frame frame generation gate.
ParticleTroned pushed a commit to ParticleTroned/skyrim-community-shaders that referenced this pull request May 16, 2026
Branch-preserving adaptation: keep this branch's VR/foveated Upscaling path and no-HDRDisplay swapchain handling, wiring the menu option into the current frame-generation call sites.
ParticleTroned added a commit to ParticleTroned/skyrim-community-shaders that referenced this pull request May 16, 2026
Keep IsFrameGenerationActive as the runtime-active predicate and use the State main/loading-menu helper for the per-frame frame generation gate.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants