Skip to content

chore: configure CS to require engine fixes#1452

Merged
doodlum merged 2 commits into
devfrom
engine-fixes-requirements
Sep 9, 2025
Merged

chore: configure CS to require engine fixes#1452
doodlum merged 2 commits into
devfrom
engine-fixes-requirements

Conversation

@doodlum
Copy link
Copy Markdown
Collaborator

@doodlum doodlum commented Sep 8, 2025

Summary by CodeRabbit

  • New Features

    • Added startup validation for required dependencies with clear errors if missing, while continuing to block incompatible plugins.
  • Refactor

    • Removed a legacy startup graphics cache modification; existing lighting behavior remains unchanged.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Sep 8, 2025

Walkthrough

This change removes a render pass cache memory-patching block from src/Hooks.cpp and updates src/XSEPlugin.cpp to rename an incompatible DLLs array and add a new required DLLs check inside Load(), invoking LoadLibrary and logging error messages based on outcomes.

Changes

Cohort / File(s) Summary
Render pass cache patch removal
src/Hooks.cpp
Deleted the render pass cache resizing/offset PatchMemory block (VariantID, pass count/size calculations, AE vs. non-AE branches). Retained existing BSLightingShader world-space patch logic.
DLL checks in plugin load flow
src/XSEPlugin.cpp
Renamed dlls to incompatibleDLLs and kept the same entries. Added requiredDLLs (EngineFixes.dll) loop that calls LoadLibrary; on success, logs "Required DLL was missing" and records an error. Overall Load() sequencing now: incompatible checks → required checks → proceed if no errors.

Sequence Diagram(s)

sequenceDiagram
  autonumber
  actor Game
  participant Plugin as XSEPlugin::Load()
  participant Sys as OS Loader

  Game->>Plugin: Load()
  rect rgb(240,245,255)
    note right of Plugin: Check incompatible DLLs
    loop for each dll in incompatibleDLLs
      Plugin->>Sys: LoadLibrary(dll)
      Sys-->>Plugin: HMODULE/NULL
      alt HMODULE (loaded)
        Plugin->>Plugin: Record error "Incompatible DLL <path> was loaded"
      else NULL (not loaded)
        Plugin->>Plugin: No error
      end
    end
  end

  rect rgb(240,255,240)
    note right of Plugin: Check required DLLs (new)
    loop for each dll in requiredDLLs
      Plugin->>Sys: LoadLibrary(dll)
      Sys-->>Plugin: HMODULE/NULL
      alt HMODULE (loaded)
        note right of Plugin: Logs "Required DLL <path> was missing" and records error
      else NULL (not loaded)
        Plugin->>Plugin: No error recorded
      end
    end
  end

  alt errors empty
    Plugin-->>Game: Proceed to feature loading
  else errors present
    Plugin-->>Game: Abort/return with errors
  end
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Suggested reviewers

  • alandtse
  • doodlum

Poem

I hop through hooks with nimble cheer,
The render cache now disappears.
I sniff for DLLs, both foe and friend—
One must be found, one can’t attend.
Carrots compiled, logs neatly spun,
Patch by patch, the work is done. 🥕

Tip

👮 Agentic pre-merge checks are now available in preview!

Pro plan users can now enable pre-merge checks in their settings to enforce checklists before merging PRs.

  - Custom agentic checks – Define your own rules using CodeRabbit’s advanced agentic capabilities to enforce organization-specific policies and workflows. For example, you can instruct CodeRabbit’s agent to verify that API documentation is updated whenever API schema files are modified in a PR. Note: Upto 5 custom checks are currently allowed during the preview period. Pricing for this feature will be announced in a few weeks.
  - Built-in checks – Quickly apply ready-made checks to enforce title conventions, require pull request descriptions that follow templates, validate linked issues for compliance, and more.
✨ Finishing Touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch engine-fixes-requirements

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.

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 Sep 8, 2025

Using provided base ref: d25bbed
Using base ref: d25bbed
Base commit date: 2025-09-08T19:19:05+01:00 (Monday, September 08, 2025 07:19 PM)
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: 2

📜 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 d25bbed and aaef972.

📒 Files selected for processing (2)
  • src/Hooks.cpp (0 hunks)
  • src/XSEPlugin.cpp (1 hunks)
💤 Files with no reviewable changes (1)
  • src/Hooks.cpp
🧰 Additional context used
📓 Path-based instructions (2)
**/*.{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/XSEPlugin.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/XSEPlugin.cpp
🧠 Learnings (1)
📓 Common learnings
Learnt from: alandtse
PR: doodlum/skyrim-community-shaders#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.
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: Build plugin and addons

Comment thread src/XSEPlugin.cpp
Comment thread src/XSEPlugin.cpp
@github-actions
Copy link
Copy Markdown

github-actions Bot commented Sep 8, 2025

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

@doodlum doodlum merged commit 4ee9d7e into dev Sep 9, 2025
17 checks passed
@coderabbitai coderabbitai Bot mentioned this pull request Dec 24, 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.

2 participants