Skip to content

fix: tes singleton ptr#2316

Merged
alandtse merged 4 commits into
community-shaders:devfrom
Dlizzio:fix-volumetric-shadows
May 12, 2026
Merged

fix: tes singleton ptr#2316
alandtse merged 4 commits into
community-shaders:devfrom
Dlizzio:fix-volumetric-shadows

Conversation

@Dlizzio
Copy link
Copy Markdown
Contributor

@Dlizzio Dlizzio commented May 11, 2026

Fixes globals::game::tes

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 11, 2026

📝 Walkthrough

Walkthrough

This PR refactors TES singleton access in src/Globals.cpp by extracting a centralized RefreshTES() helper function and integrating it into both ReInit() and OnDataLoaded() initialization paths. The TerrainShadows feature version is incremented to reflect the changes.

Changes

TES Singleton Refresh Refactoring

Layer / File(s) Summary
RefreshTES Helper Function
src/Globals.cpp
New file-local RefreshTES() helper conditionally assigns globals::game::tes from RE::TES::GetSingleton().
ReInit Integration
src/Globals.cpp
ReInit() calls RefreshTES() instead of directly assigning the TES singleton.
OnDataLoaded Integration
src/Globals.cpp
OnDataLoaded() calls RefreshTES() to refresh the TES singleton before initializing other game pointers.
Feature Version Update
features/Terrain Shadows/Shaders/Features/TerrainShadows.ini
TerrainShadows feature version incremented from 1-1-0 to 1-1-1.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

Possibly related PRs

Suggested reviewers

  • doodlum
  • alandtse
  • davo0411

Poem

🐰 A helper hops into view,
RefreshTES() knows just what to do,
Singletons sync both here and there,
No duplication in the air! ✨

🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (1 warning, 1 inconclusive)

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.
Title check ❓ Inconclusive The PR title 'fix: tes singleton ptr' is related to changes in src/Globals.cpp involving TES singleton management, but the PR objectives describe loading terrain shadow heightmap into volumetric shadows, creating a mismatch. Clarify whether the PR title should reflect the TES singleton fix in Globals.cpp or the terrain shadow heightmap loading mentioned in the PR description, as they appear to address different concerns.
✅ Passed checks (3 passed)
Check name Status Explanation
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.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.

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

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

Tip

💬 Introducing Slack Agent: The best way for teams to turn conversations into code.

Slack Agent is built on CodeRabbit's deep understanding of your code, so your team can collaborate across the entire SDLC without losing context.

  • Generate code and open pull requests
  • Plan features and break down work
  • Investigate incidents and troubleshoot customer tickets together
  • Automate recurring tasks and respond to alerts with triggers
  • Summarize progress and report instantly

Built for teams:

  • Shared memory across your entire org—no repeating context
  • Per-thread sandboxes to safely plan and execute work
  • Governance built-in—scoped access, auditability, and budget controls

One agent for your entire SDLC. Right inside Slack.

👉 Get started


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

@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 11, 2026

No actionable suggestions for changed features.

@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 11, 2026

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

@Dlizzio Dlizzio changed the title fix(volumetric shadows): load terrain shadow heightmap fix: tes singleton ptr May 11, 2026
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

🧹 Nitpick comments (1)
src/Globals.cpp (1)

1-1: PR metadata suggestion: conventional title + issue keyword

Suggested title (<=50 chars): fix(volumetric-shadows): load terrain shadow map
If this maps to a tracked issue, add Fixes #... / Addresses #... in the PR description.

As per coding guidelines, "When reviewing PRs, please provide suggestions for: 1. Conventional Commit Titles ... 2. Issue References ..."

🤖 Prompt for 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.

In `@src/Globals.cpp` at line 1, Update the pull request metadata: change the PR
title to a conventional commit style like "fix(volumetric-shadows): load terrain
shadow map" and add an issue reference in the PR description (e.g., "Fixes
#<issue-number>" or "Addresses #<issue-number>"). Ensure the PR description
includes the mapping to the tracked issue and that the new title is ≤50
characters; no code changes are required in Globals.cpp for this metadata
update.
🤖 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/Globals.cpp`:
- Around line 134-138: Replace the conditional assignment in RefreshTES so
game::tes is set directly from RE::TES::GetSingleton() instead of only updating
when non-null; specifically, inside the RefreshTES function assign game::tes =
RE::TES::GetSingleton() to ensure game::tes becomes nullptr when the singleton
is gone (defensive clarity) and avoid preserving a stale pointer.

---

Nitpick comments:
In `@src/Globals.cpp`:
- Line 1: Update the pull request metadata: change the PR title to a
conventional commit style like "fix(volumetric-shadows): load terrain shadow
map" and add an issue reference in the PR description (e.g., "Fixes
#<issue-number>" or "Addresses #<issue-number>"). Ensure the PR description
includes the mapping to the tracked issue and that the new title is ≤50
characters; no code changes are required in Globals.cpp for this metadata
update.
🪄 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: e373ee70-6b0d-44f8-ae22-e0ab286fe00b

📥 Commits

Reviewing files that changed from the base of the PR and between db107c8 and d720993.

📒 Files selected for processing (1)
  • src/Globals.cpp

Comment thread src/Globals.cpp
@alandtse alandtse merged commit 4bd6800 into community-shaders:dev May 12, 2026
14 checks passed
alandtse pushed a commit that referenced this pull request May 12, 2026
(cherry picked from commit 4bd6800)
SkrubbySkrubInAShrub pushed a commit that referenced this pull request May 14, 2026
(cherry picked from commit 4bd6800)
ParticleTroned pushed a commit to ParticleTroned/skyrim-community-shaders that referenced this pull request May 15, 2026
ParticleTroned pushed a commit to ParticleTroned/skyrim-community-shaders that referenced this pull request May 16, 2026
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