-
Notifications
You must be signed in to change notification settings - Fork 103
feat: conditional shader defines based on user-defined .dlls #1647
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: dev
Are you sure you want to change the base?
Conversation
📝 WalkthroughWalkthroughAdds runtime detection of Flat World Map Framework (FWMF) and a global flag; when detected it sets a build define (FWMF_DETECTED) for WORLD_MAP permutations and guards static Diffuse IBL / IBL color code in the Lighting.hlsl shader to skip those contributions for world-map builds. Changes
Sequence Diagram(s)sequenceDiagram
participant Plugin as XSEPlugin (startup)
participant Globals as globals (flag)
participant BuildState as State (shader defines)
participant Shader as Lighting.hlsl
Plugin->>Plugin: on Load, call GetModuleHandleA for FWMF DLLs
alt FWMF found
Plugin->>Globals: set flatWorldMapDetected = true
Plugin->>BuildState: SetDefines("FWMF_DETECTED")
end
Note over BuildState,Shader: WORLD_MAP shader permutation compiles with/without FWMF_DETECTED
BuildState->>Shader: provide defines (WORLD_MAP [+ FWMF_DETECTED])
alt WORLD_MAP && FWMF_DETECTED
Shader->>Shader: skip Diffuse IBL and iblColor blocks (guards active)
else
Shader->>Shader: include Diffuse IBL and iblColor logic
end
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes
Possibly related issues
Possibly related PRs
Suggested reviewers
Poem
Pre-merge checks and finishing touches❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✨ Finishing touches
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. Comment |
There was a problem hiding this 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
📜 Review details
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
package/Shaders/Lighting.hlsl(2 hunks)
🧰 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:
package/Shaders/Lighting.hlsl
**/*
⚙️ CodeRabbit configuration file
**/*: When reviewing PRs, please provide suggestions for:
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
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:
package/Shaders/Lighting.hlsl
🧠 Learnings (4)
📓 Common learnings
Learnt from: jiayev
Repo: doodlum/skyrim-community-shaders PR: 0
File: :0-0
Timestamp: 2025-08-03T18:37:19.690Z
Learning: ISReflectionsRayTracing.hlsl and ISWorldMap.hlsl in the skyrim-community-shaders repository are image-space post-processing shaders that perform color sampling and blending operations that need proper linear color space handling for the linear lighting system. ISReflectionsRayTracing handles screen-space reflections and should use conditional Color::IrradianceToLinear/Gamma conversions similar to ISCompositeLensFlareVolumetricLighting.hlsl. ISWorldMap performs 7x7 color accumulation that should be done in linear space similar to the pattern used in ISSAOComposite.hlsl.
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: 577
File: features/Wetness Effects/Shaders/WetnessEffects/WetnessEffects.hlsli:57-61
Timestamp: 2025-06-17T05:40:22.785Z
Learning: Default parameter values are supported in the HLSL compiler used by the skyrim-community-shaders project, contrary to standard HLSL (FXC/DXC) limitations.
Learnt from: ThePagi
Repo: doodlum/skyrim-community-shaders PR: 1369
File: package/Shaders/Lighting.hlsl:0-0
Timestamp: 2025-08-05T17:40:44.828Z
Learning: In the skyrim-community-shaders repository, ultra trees (object LOD trees) are detected using a compound shader define condition `defined(DO_ALPHA_TEST) && defined(LOD_BLENDING) && defined(RIM_LIGHTING) && defined(SOFT_LIGHTING)` because "they have no define" according to the comment. The `ExtraFlags::IsTree` flag is used for different tree handling (AO removal in skylighting) and may not apply to ultra trees specifically. Before replacing the compound condition with `IsTree`, verification is needed to ensure the flag covers ultra trees.
Learnt from: alandtse
Repo: doodlum/skyrim-community-shaders PR: 577
File: src/Features/WetnessEffects.h:36-36
Timestamp: 2025-06-08T11:25:14.536Z
Learning: In the skyrim-community-shaders project, boolean flags in C++ structs that interface with HLSL shaders use `uint` type instead of `bool` for compatibility reasons. This ensures consistent 4-byte size, proper 16-byte alignment in constant buffers, and cross-platform compatibility when passing data between C++ and HLSL shaders.
Learnt from: alandtse
Repo: doodlum/skyrim-community-shaders PR: 577
File: src/Features/WetnessEffects.h:36-36
Timestamp: 2025-06-08T11:25:14.536Z
Learning: In the skyrim-community-shaders project, boolean flags in C++ structs that interface with HLSL shaders use `uint` type instead of `bool` for compatibility reasons. This ensures consistent size, alignment, and cross-platform compatibility when passing data to shader constant buffers.
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.
Learnt from: CR
Repo: doodlum/skyrim-community-shaders PR: 0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-08-17T18:37:35.839Z
Learning: Applies to features/*/Shaders/**/*.{hlsl,hlsli,fx,fxh} : Avoid GPU register/buffer conflicts in HLSL; verify register usage (e.g., with hlslkit buffer scanning)
📚 Learning: 2025-08-03T18:37:19.690Z
Learnt from: jiayev
Repo: doodlum/skyrim-community-shaders PR: 0
File: :0-0
Timestamp: 2025-08-03T18:37:19.690Z
Learning: ISReflectionsRayTracing.hlsl and ISWorldMap.hlsl in the skyrim-community-shaders repository are image-space post-processing shaders that perform color sampling and blending operations that need proper linear color space handling for the linear lighting system. ISReflectionsRayTracing handles screen-space reflections and should use conditional Color::IrradianceToLinear/Gamma conversions similar to ISCompositeLensFlareVolumetricLighting.hlsl. ISWorldMap performs 7x7 color accumulation that should be done in linear space similar to the pattern used in ISSAOComposite.hlsl.
Applied to files:
package/Shaders/Lighting.hlsl
📚 Learning: 2025-08-17T18:37:35.839Z
Learnt from: CR
Repo: doodlum/skyrim-community-shaders PR: 0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-08-17T18:37:35.839Z
Learning: Applies to features/*/Shaders/**/*.{hlsl,hlsli,fx,fxh} : Avoid GPU register/buffer conflicts in HLSL; verify register usage (e.g., with hlslkit buffer scanning)
Applied to files:
package/Shaders/Lighting.hlsl
📚 Learning: 2025-07-01T18:01:07.079Z
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.
Applied to files:
package/Shaders/Lighting.hlsl
⏰ 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). (3)
- GitHub Check: Validate shader compilation (VR, .github/configs/shader-validation-vr.yaml)
- GitHub Check: Build plugin and addons
- GitHub Check: Validate shader compilation (Flatrim, .github/configs/shader-validation.yaml)
🔇 Additional comments (1)
package/Shaders/Lighting.hlsl (1)
2734-2740: LGTM - Correctly disables static/interior IBL for world map.This guard appropriately prevents IBL modifications to
directionalAmbientColorwhen rendering the world map, which addresses the overexposure issue described in the PR. The approach is consistent with how other features (CLOUD_SHADOWS, SKYLIGHTING) are disabled for WORLD_MAP at lines 885-888.
|
✅ A pre-release build is available for this PR: |
|
ibl does work nice on normal world map tho |
if its needed on regular worldmap i can re-do this but i'll only get a chance when im back, and it'll end up on backburner, i just didn't think that would really matter. |
There was a problem hiding this 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
♻️ Duplicate comments (1)
package/Shaders/Lighting.hlsl (1)
2759-2770: IBL color accumulation correctly guarded, but fog IBL path remains unguarded.This guard is correctly implemented. However, the fog IBL code at lines 3147-3151 still lacks a matching guard:
# if defined(IBL) if (SharedData::iblSettings.EnableDiffuseIBL && !SharedData::InInterior) { fogColor = ImageBasedLighting::GetFogIBLColor(fogColor); } # endifFor consistency and to fully prevent IBL-related brightness issues on the flat world map, consider adding the same guard:
# if defined(IBL) && (!defined(WORLD_MAP) || !defined(FWMF_DETECTED))
📜 Review details
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (4)
package/Shaders/Lighting.hlsl(2 hunks)src/Globals.cpp(1 hunks)src/Globals.h(1 hunks)src/XSEPlugin.cpp(1 hunks)
🧰 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/Globals.cppsrc/XSEPlugin.cppsrc/Globals.hpackage/Shaders/Lighting.hlsl
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/Globals.cppsrc/XSEPlugin.cppsrc/Globals.h
**/*
⚙️ CodeRabbit configuration file
**/*: When reviewing PRs, please provide suggestions for:
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
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/Globals.cppsrc/XSEPlugin.cppsrc/Globals.hpackage/Shaders/Lighting.hlsl
🧠 Learnings (12)
📓 Common learnings
Learnt from: jiayev
Repo: doodlum/skyrim-community-shaders PR: 0
File: :0-0
Timestamp: 2025-08-03T18:37:19.690Z
Learning: ISReflectionsRayTracing.hlsl and ISWorldMap.hlsl in the skyrim-community-shaders repository are image-space post-processing shaders that perform color sampling and blending operations that need proper linear color space handling for the linear lighting system. ISReflectionsRayTracing handles screen-space reflections and should use conditional Color::IrradianceToLinear/Gamma conversions similar to ISCompositeLensFlareVolumetricLighting.hlsl. ISWorldMap performs 7x7 color accumulation that should be done in linear space similar to the pattern used in ISSAOComposite.hlsl.
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.
📚 Learning: 2025-08-17T18:37:35.839Z
Learnt from: CR
Repo: doodlum/skyrim-community-shaders PR: 0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-08-17T18:37:35.839Z
Learning: Applies to features/**/*.{cpp,cxx,cc,h,hpp,hxx} : Register new features in the globals::features namespace
Applied to files:
src/Globals.cppsrc/XSEPlugin.cppsrc/Globals.h
📚 Learning: 2025-08-17T18:37:35.839Z
Learnt from: CR
Repo: doodlum/skyrim-community-shaders PR: 0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-08-17T18:37:35.839Z
Learning: Applies to src/**/*.{cpp,cxx,cc,h,hpp,hxx} : Ensure SE/AE/VR runtime compatibility; use runtime detection patterns (e.g., REL::RelocateMember())
Applied to files:
src/XSEPlugin.cpp
📚 Learning: 2025-08-03T18:37:19.690Z
Learnt from: jiayev
Repo: doodlum/skyrim-community-shaders PR: 0
File: :0-0
Timestamp: 2025-08-03T18:37:19.690Z
Learning: ISReflectionsRayTracing.hlsl and ISWorldMap.hlsl in the skyrim-community-shaders repository are image-space post-processing shaders that perform color sampling and blending operations that need proper linear color space handling for the linear lighting system. ISReflectionsRayTracing handles screen-space reflections and should use conditional Color::IrradianceToLinear/Gamma conversions similar to ISCompositeLensFlareVolumetricLighting.hlsl. ISWorldMap performs 7x7 color accumulation that should be done in linear space similar to the pattern used in ISSAOComposite.hlsl.
Applied to files:
package/Shaders/Lighting.hlsl
📚 Learning: 2025-08-17T18:37:35.839Z
Learnt from: CR
Repo: doodlum/skyrim-community-shaders PR: 0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-08-17T18:37:35.839Z
Learning: Applies to features/*/Shaders/**/*.{hlsl,hlsli,fx,fxh} : Avoid GPU register/buffer conflicts in HLSL; verify register usage (e.g., with hlslkit buffer scanning)
Applied to files:
package/Shaders/Lighting.hlsl
📚 Learning: 2025-07-01T18:01:07.079Z
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.
Applied to files:
package/Shaders/Lighting.hlsl
📚 Learning: 2025-06-17T05:40:22.785Z
Learnt from: alandtse
Repo: doodlum/skyrim-community-shaders PR: 577
File: features/Wetness Effects/Shaders/WetnessEffects/WetnessEffects.hlsli:57-61
Timestamp: 2025-06-17T05:40:22.785Z
Learning: Default parameter values are supported in the HLSL compiler used by the skyrim-community-shaders project, contrary to standard HLSL (FXC/DXC) limitations.
Applied to files:
package/Shaders/Lighting.hlsl
📚 Learning: 2025-08-05T17:40:44.828Z
Learnt from: ThePagi
Repo: doodlum/skyrim-community-shaders PR: 1369
File: package/Shaders/Lighting.hlsl:0-0
Timestamp: 2025-08-05T17:40:44.828Z
Learning: In the skyrim-community-shaders repository, ultra trees (object LOD trees) are detected using a compound shader define condition `defined(DO_ALPHA_TEST) && defined(LOD_BLENDING) && defined(RIM_LIGHTING) && defined(SOFT_LIGHTING)` because "they have no define" according to the comment. The `ExtraFlags::IsTree` flag is used for different tree handling (AO removal in skylighting) and may not apply to ultra trees specifically. Before replacing the compound condition with `IsTree`, verification is needed to ensure the flag covers ultra trees.
Applied to files:
package/Shaders/Lighting.hlsl
📚 Learning: 2025-08-17T18:37:35.839Z
Learnt from: CR
Repo: doodlum/skyrim-community-shaders PR: 0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-08-17T18:37:35.839Z
Learning: Applies to features/*/Shaders/**/*.{hlsl,hlsli,fx,fxh} : Place all feature shaders under features/YourFeature/Shaders/
Applied to files:
package/Shaders/Lighting.hlsl
📚 Learning: 2025-06-08T11:25:14.536Z
Learnt from: alandtse
Repo: doodlum/skyrim-community-shaders PR: 577
File: src/Features/WetnessEffects.h:36-36
Timestamp: 2025-06-08T11:25:14.536Z
Learning: In the skyrim-community-shaders project, boolean flags in C++ structs that interface with HLSL shaders use `uint` type instead of `bool` for compatibility reasons. This ensures consistent 4-byte size, proper 16-byte alignment in constant buffers, and cross-platform compatibility when passing data between C++ and HLSL shaders.
Applied to files:
package/Shaders/Lighting.hlsl
📚 Learning: 2025-07-05T05:20:45.823Z
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.
Applied to files:
package/Shaders/Lighting.hlsl
📚 Learning: 2025-10-02T14:20:33.454Z
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.
Applied to files:
package/Shaders/Lighting.hlsl
⏰ 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). (3)
- GitHub Check: Validate shader compilation (Flatrim, .github/configs/shader-validation.yaml)
- GitHub Check: Build plugin and addons
- GitHub Check: Validate shader compilation (VR, .github/configs/shader-validation-vr.yaml)
🔇 Additional comments (3)
package/Shaders/Lighting.hlsl (1)
2734-2740: LGTM - Guard correctly scopes diffuse IBL settings for FWMF world map.The preprocessor condition
!defined(WORLD_MAP) || !defined(FWMF_DETECTED)correctly allows this block to execute in all cases except when both defines are present, which is the intended behavior.src/Globals.cpp (1)
48-49: LGTM - Clean global variable definition.Properly initialized and correctly placed in the globals namespace.
src/Globals.h (1)
243-250: LGTM - Well-documented extern declaration.The documentation clearly explains the purpose and detection mechanism. Follows the existing pattern for global declarations in this file.
src/XSEPlugin.cpp
Outdated
| /** | ||
| * @brief Detect Flat World Map Framework DLLs at startup. | ||
| * | ||
| * Uses GetModuleHandleA() to avoid loading DLLs ourselves (consistent with | ||
| * optional module detection pattern). When detected, features like IBL and | ||
| * Post-Processing effects can avoid applying on world map to prevent | ||
| * visual artifacts with FWMF's flat texture replacement. | ||
| * | ||
| * Future: expand to detect Post-Processing modules that also distort FWMF output. | ||
| */ | ||
| const char* fwmfDLLs[] = { | ||
| "BakaWorldMapSpeed.dll", | ||
| "BakaWorldMapFOV.dll", | ||
| "FlatMapMarkersSSE.dll" | ||
| }; | ||
|
|
||
| for (const char* dllName : fwmfDLLs) { | ||
| if (GetModuleHandleA(dllName) != nullptr) { | ||
| logger::info("Detected Flat World Map Framework mod: {} - Imagespace effects will be disabled on world map", dllName); | ||
| globals::flatWorldMapDetected = true; | ||
| break; | ||
| } | ||
| } | ||
|
|
||
| if (globals::flatWorldMapDetected) { | ||
| // Add shader define so WORLD_MAP permutations can conditionally disable IBL | ||
| globals::state->SetDefines("FWMF_DETECTED"); | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash
# Search for DLL name references in the codebase
rg -i "BakaWorldMap|FlatMapMarkers" -g '!*.dll'Repository: doodlum/skyrim-community-shaders
Length of output: 58
🌐 Web query:
Flat World Map Framework mod DLL names SKSE
💡 Result:
Short answer: Flat World Map Framework (FWMF) itself is not an SKSE plugin and does not include a primary SKSE DLL. The SKSE-related component commonly used with FWMF is the separate "Flat Map Markers" SKSE plugin (often distributed alongside or as an optional file), whose code has been bundled into other projects (e.g., EnderalSE.dll) in some distributions. Sources: Nexus FWMF files page and Enderal project notes. [1][2]
Sources
- Flat World Map Framework (FWMF) — Nexus files listing (shows FWMF as a non-SKSE framework; separate "Flat Map Markers" file available). [1]
- Enderal project notes / credits (shows Flat Map Markers code included into EnderalSE.dll in that project). [2]
🏁 Script executed:
#!/bin/bash
# Search for any comments or references to mod compatibility in the codebase
rg -i "enderal|bundled|bundling" --type cpp --type hppRepository: doodlum/skyrim-community-shaders
Length of output: 103
🏁 Script executed:
#!/bin/bash
# Search for any comments or references to bundled mods
rg -i "enderal|bundled" -t cpp -t c -t hRepository: doodlum/skyrim-community-shaders
Length of output: 224
🏁 Script executed:
#!/bin/bash
# Simple search without type restrictions
rg -i "enderal|bundled"Repository: doodlum/skyrim-community-shaders
Length of output: 58
DLL names are correct; document known limitation with bundled variants.
The three DLL names are accurate for their respective mods:
BakaWorldMapSpeed.dllandBakaWorldMapFOV.dllare from the "Baka Flat World Map" modFlatMapMarkersSSE.dllis from the "Flat Map Markers" SKSE plugin
However, the detection has a known limitation: "Flat Map Markers" code is sometimes bundled into other DLLs (e.g., EnderalSE.dll in certain distributions). The current approach will not detect these bundled variants. Consider adding a comment documenting this limitation, and potentially expand detection in a future update to handle bundled scenarios beyond just Post-Processing modules.
🤖 Prompt for AI Agents
In src/XSEPlugin.cpp around lines 206 to 233, the FWMF DLL detection loop works
but lacks documentation about a known limitation where Flat Map Markers may be
bundled into other DLLs (e.g., EnderalSE.dll) and so won't be detected; add a
brief comment above the fwmfDLLs array explaining that bundled variants exist
(mention EnderalSE.dll as an example), note that current detection uses
GetModuleHandleA and will miss bundled plugins, and add a TODO suggesting future
improvements (e.g., scanning loaded module names for known substrings, checking
exported symbol names, or providing a user-configurable override) so maintainers
know safe extension paths.
|
Instead of hardcoding one mod/dll. Think about making this data driven via our settings file. We can prepopulate bad mods in the settings. The structure can likely do osmething like if dlls detected, create a define. Perhaps we can make it so features dynamically have a define that disables them. But think about scalability. |
|
I did make it create a define based on present .dlls. Idk how to get the dlls any smoother than hard coding the names. I can't think of another use case where we're going to need to disable features based on mod .dlls, but i can expand this to be a whole system if preferred, but this is meant to be a quick fix. Don't want to waste time expanding this, splitting the PRs up etc. |
Automated formatting by clang-format, prettier, and other hooks. See https://pre-commit.ci for details.
|
Make it data driven in the settings file. You can't just do one off non scalable code. It adds tech debt. Slop coding doesn't work for complex projects. |
UNTESTED.
Adds conditional checks to see if the 3 main FWMF .dlls are detected, and disables IBL via a new shader permutation on world maps. Should keep IBL on vanilla / other map types.
Easily expanded to PP in future
Summary by CodeRabbit
✏️ Tip: You can customize this high-level summary in your review settings.