Skip to content

perf(upscaling): set fDRClampOffset only on dataloaded#1675

Merged
doodlum merged 3 commits into
devfrom
upscaling-perf
Jan 6, 2026
Merged

perf(upscaling): set fDRClampOffset only on dataloaded#1675
doodlum merged 3 commits into
devfrom
upscaling-perf

Conversation

@doodlum
Copy link
Copy Markdown
Collaborator

@doodlum doodlum commented Jan 4, 2026

Summary by CodeRabbit

  • Refactor
    • Reorganized internal initialization sequence. No observable behavior changes to end-users.

✏️ Tip: You can customize this high-level summary in your review settings.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Jan 4, 2026

📝 Walkthrough

Walkthrough

The initialization of the INI setting fDRClampOffset is moved from the ConfigureUpscaling method to the DataLoaded method. The observable behavior remains unchanged—fDRClampOffset is still reset to 0.0f after data loading—but the initialization timing is adjusted.

Changes

Cohort / File(s) Summary
Upscaling Initialization
src/Features/Upscaling.cpp
Moved fDRClampOffset initialization from ConfigureUpscaling to DataLoaded lifecycle hook

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~5 minutes

Possibly related PRs

Poem

🐰 bounces with glee
An offset seeks its rightful place,
From Configure to DataLoaded's embrace,
Same result, new timing divine,
Initialization in harmony aligns!

Pre-merge checks and finishing touches

❌ 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%. You can run @coderabbitai generate docstrings to improve docstring coverage.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the main change: moving fDRClampOffset initialization from ConfigureUpscaling to DataLoaded, which is a performance optimization.
✨ Finishing touches
  • 📝 Generate docstrings

📜 Recent review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between bb5615e and e011abb.

📒 Files selected for processing (1)
  • src/Features/Upscaling.cpp
🧰 Additional context used
📓 Path-based instructions (3)
**/*.{cpp,cxx,cc,c,h,hpp,hxx,hlsl,hlsli,fx,fxh,py}

📄 CodeRabbit inference engine (.github/copilot-instructions.md)

Do not include TODO/FIXME placeholders; provide complete, working solutions

Files:

  • src/Features/Upscaling.cpp
src/**/*.{cpp,cxx,cc,h,hpp,hxx}

📄 CodeRabbit inference engine (.github/copilot-instructions.md)

src/**/*.{cpp,cxx,cc,h,hpp,hxx}: Ensure SE/AE/VR runtime compatibility; use runtime detection patterns (e.g., REL::RelocateMember())
Include robust error handling and resource management with graceful degradation in the plugin code

Files:

  • src/Features/Upscaling.cpp
**/*

⚙️ CodeRabbit configuration file

**/*: When reviewing PRs, please provide suggestions for:

  1. Conventional Commit Titles (if not following https://www.conventionalcommits.org/ or
    if the existing title does not describe the code changes):
    Format: type(scope): description
    Length: 50 characters limit for title, 72 for body
    Style: lowercase description, no ending period
    Examples:

    • feat(vr): add cross-eye sampling
    • fix(water): resolve flowmap bug
    • docs: update shader documentation
  2. Issue References (if PR fixes bugs or implements features):
    Suggest adding appropriate GitHub keywords:

Otherwise, use your standard review approach focusing on code quality.

Files:

  • src/Features/Upscaling.cpp
🧠 Learnings (1)
📓 Common learnings
Learnt from: ThePagi
Repo: doodlum/skyrim-community-shaders PR: 1369
File: src/Features/SnowCover.cpp:515-515
Timestamp: 2025-10-02T14:20:33.454Z
Learning: In the Community Shaders codebase (skyrim-community-shaders repository), hardcoded shader resource slot numbers are used directly in code rather than being defined as named constants. This is the established convention and should not be flagged as an issue.
Learnt from: ThePagi
Repo: doodlum/skyrim-community-shaders PR: 1369
File: src/Features/SnowCover.cpp:277-293
Timestamp: 2025-08-05T18:22:40.578Z
Learning: In the skyrim-community-shaders SnowCover feature, the wstrtostr and strtowstr utility functions defined in src/Features/SnowCover.cpp are unused and should be removed rather than fixed, as confirmed by the original author ThePagi.
Learnt from: alandtse
Repo: doodlum/skyrim-community-shaders PR: 0
File: :0-0
Timestamp: 2025-07-05T05:20:45.823Z
Learning: In the skyrim-community-shaders repository, file deletion error handling improvements that replace existence checks and try-catch blocks with std::filesystem::remove error-code-based approaches are considered bug fixes rather than refactoring, as they address inadequate error handling and misleading log messages.
Learnt from: alandtse
Repo: doodlum/skyrim-community-shaders PR: 0
File: :0-0
Timestamp: 2025-07-01T18:01:07.079Z
Learning: In the skyrim-community-shaders project, simple scalar constants in HLSL shaders use #define (e.g., #define NTHREADS 128), while more complex constants use static const within namespaces (e.g., Math namespace in Math.hlsli). For epsilon standardization, #define is the appropriate choice since epsilon values are simple scalar constants.
🔇 Additional comments (1)
src/Features/Upscaling.cpp (1)

392-395: LGTM! Effective performance optimization.

Moving the fDRClampOffset initialization from ConfigureUpscaling (called per-frame) to DataLoaded (called once) and making it static eliminates repeated INI lookups and assignments. The static keyword ensures the pointer is cached, and a one-time reset to 0.0f during data load is sufficient.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

@doodlum doodlum changed the title perf(upscaling): make fDRClampOffset static perf(upscaling): set fDRClampOffset only on dataloaded Jan 4, 2026
Automated formatting by clang-format, prettier, and other hooks.
See https://pre-commit.ci for details.
@github-actions
Copy link
Copy Markdown

github-actions Bot commented Jan 4, 2026

Using provided base ref: bb5615e
Using base ref: bb5615e
Base commit date: 2026-01-04T00:44:58Z (Sunday, January 04, 2026 12:44 AM)
No actionable suggestions for changed features.

@github-actions
Copy link
Copy Markdown

github-actions Bot commented Jan 4, 2026

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

@doodlum doodlum merged commit d06ee23 into dev Jan 6, 2026
18 checks passed
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.

2 participants