Skip to content

fix: move shadercache validation after feature PostPostLoad#1171

Merged
alandtse merged 3 commits into
community-shaders:devfrom
alandtse:validate_cache
Jun 22, 2025
Merged

fix: move shadercache validation after feature PostPostLoad#1171
alandtse merged 3 commits into
community-shaders:devfrom
alandtse:validate_cache

Conversation

@alandtse

@alandtse alandtse commented Jun 21, 2025

Copy link
Copy Markdown
Contributor

Fixes shadercache constantly rebuilding when features disable themselves on load.

  • Move ValidateDiskCache() call after feature PostPostLoad() calls
  • Ensures cache validation uses correct feature state
  • Prevents unnecessary cache rebuilds due to timing issues

Closes #1164

Summary by CodeRabbit

  • Refactor
    • Adjusted the sequence of operations during feature loading to ensure features can update their state before disk cache validation and file watcher activation. No visible changes to end-user functionality.

Fixes shadercache constantly rebuilding when features disable themselves on load.

- Move ValidateDiskCache() call after feature PostPostLoad() calls
- Ensures cache validation uses correct feature state
- Prevents unnecessary cache rebuilds due to timing issues

Closes community-shaders#1164
@coderabbitai

coderabbitai Bot commented Jun 21, 2025

Copy link
Copy Markdown
Contributor

Walkthrough

The change updates the initialization sequence in src/XSEPlugin.cpp by moving the shader cache validation and file watcher startup to occur after all features have executed their PostPostLoad() methods, allowing features to modify their state before these operations.

Changes

Files Change Summary
src/XSEPlugin.cpp Moved shader cache validation and file watcher initialization after feature PostPostLoad() loop

Sequence Diagram(s)

sequenceDiagram
    participant XSEPlugin
    participant Features
    participant ShaderCache

    XSEPlugin->>Features: PostPostLoad() (for each feature)
    XSEPlugin->>ShaderCache: ValidateDiskCache()
    XSEPlugin->>ShaderCache: StartFileWatcher() (if needed)
Loading

Assessment against linked issues

Objective Addressed Explanation
Move shader cache validation after all features have executed PostPostLoad (#1164)

Poem

A shuffle in the loading dance,
Features now get their chance,
To tweak and tune before the cache,
Avoiding rebuilds in a flash!
The watcher waits, the disk is checked—
Bunny hops, code is correct!
🐇✨


📜 Recent review details

Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between ebba8a2 and 6e3d1fd.

📒 Files selected for processing (1)
  • src/XSEPlugin.cpp (1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (1)
  • GitHub Check: Build plugin and addons
🔇 Additional comments (1)
src/XSEPlugin.cpp (1)

93-104: LGTM! This change correctly addresses the timing issue.

The reordering of operations is well-reasoned and should resolve the shader cache rebuild issue. By allowing features to complete their PostPostLoad() methods before validating the disk cache, the cache validation now occurs with the correct feature state, preventing unnecessary rebuilds when features disable themselves during initialization.

The comments clearly explain the intent and the logic is sound.

✨ Finishing Touches
  • 📝 Generate Docstrings

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
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@github-actions

Copy link
Copy Markdown

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

@alandtse alandtse merged commit 9f1c4de into community-shaders:dev Jun 22, 2025
10 checks passed
soda3000 pushed a commit to soda3000/skyrim-community-shaders that referenced this pull request Jun 22, 2025
alandtse added a commit to alandtse/open-shaders that referenced this pull request Jul 20, 2025
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.

Shadercache constantly rebuilds if features disable themselves on load.

2 participants