Skip to content

feat(HDR): warn users when in exclusive fullscreen#2187

Merged
davo0411 merged 3 commits into
community-shaders:devfrom
SkrubbySkrubInAShrub:HDR-fullscreen-detection
Apr 23, 2026
Merged

feat(HDR): warn users when in exclusive fullscreen#2187
davo0411 merged 3 commits into
community-shaders:devfrom
SkrubbySkrubInAShrub:HDR-fullscreen-detection

Conversation

@SkrubbySkrubInAShrub
Copy link
Copy Markdown
Collaborator

@SkrubbySkrubInAShrub SkrubbySkrubInAShrub commented Apr 22, 2026

HDR swapchain format expects borderless mode. Exclusive fullscreen works, but is fragile.

Closes #2181

Summary by CodeRabbit

  • New Features
    • Settings now detect Exclusive Fullscreen (including cases detected at startup) and alert users that HDR may not work correctly in this mode.
    • UI advice recommends switching to Borderless Windowed mode for more reliable HDR behavior.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Apr 22, 2026

📝 Walkthrough

Walkthrough

Adds a static flag HDRDisplay::wasExclusiveFullscreen set during swapchain creation when HDR is enabled, and updates the HDR settings UI to detect/display a warning if Exclusive Fullscreen was used (advising Borderless Windowed).

Changes

Cohort / File(s) Summary
HDR state and UI
src/Features/HDRDisplay.h, src/Features/HDRDisplay.cpp
Declare and define a new static boolean wasExclusiveFullscreen to record Exclusive Fullscreen detected at swapchain creation; HDR settings UI now reads this state to conditionally show a warning about Exclusive Fullscreen and HDR.
Swapchain hook
src/Hooks.cpp
When HDR support is loaded in hk_D3D11CreateDeviceAndSwapChain, set HDRDisplay::wasExclusiveFullscreen = !modifiedDesc.Windowed to record exclusive-fullscreen creation state alongside existing swapchain format/effect adjustments.

Sequence Diagram(s)

sequenceDiagram
  participant App
  participant Hook as hk_D3D11CreateDeviceAndSwapChain
  participant HDR as HDRDisplay
  participant UI as ImGuiSettings

  App->>Hook: CreateDeviceAndSwapChain(request)
  Hook->>Hook: enable HDR formats/effects
  Hook->>HDR: set wasExclusiveFullscreen = !Windowed
  Note right of HDR: stores exclusive-fullscreen flag

  UI->>HDR: query wasExclusiveFullscreen / upscaling state
  HDR--)UI: return flag
  UI->>UI: show warning if exclusive fullscreen detected
Loading

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

Possibly related PRs

  • feat: HDR rendering #1692: Introduced HDRDisplay and swapchain/hook logic related to HDR handling that this change extends with exclusive-fullscreen detection.

Suggested reviewers

  • alandtse
  • doodlum

Poem

🐰 I noted the fullscreen's fleeting kiss,
A tiny flag to log what we might miss.
Now settings murmur, softly, not austere—
"Switch to borderless if HDR should cheer." ✨

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ 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%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title 'feat(HDR): warn users when in exclusive fullscreen' accurately and clearly describes the main change in the pull request, which adds functionality to warn users when in exclusive fullscreen mode.
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

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

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: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@src/Hooks.cpp`:
- Around line 368-369: The code only sets HDRDisplay::wasExclusiveFullscreen to
true when modifiedDesc.Windowed is false, never clearing it later; change the
logic in the HDR swapchain creation path (the branch referencing
modifiedDesc.Windowed) to explicitly assign the flag based on the current
descriptor (e.g., set HDRDisplay::wasExclusiveFullscreen =
!modifiedDesc.Windowed or add an else that sets it to false) so the fullscreen
warning is cleared when a swapchain is recreated in windowed/borderless mode.
🪄 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

Run ID: 605c1f97-59f1-4794-95e2-0d156a2a4ce0

📥 Commits

Reviewing files that changed from the base of the PR and between 9543ada and fbc885b.

📒 Files selected for processing (3)
  • src/Features/HDRDisplay.cpp
  • src/Features/HDRDisplay.h
  • src/Hooks.cpp

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

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

Copy link
Copy Markdown
Collaborator

@davo0411 davo0411 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks fine, if it's tested im happy

@SkrubbySkrubInAShrub
Copy link
Copy Markdown
Collaborator Author

looks fine, if it's tested im happy

tested on my side and it worked fine

@davo0411 davo0411 merged commit 6d5be8f into community-shaders:dev Apr 23, 2026
16 checks passed
IgorAlanAlbuquerque pushed a commit to IgorAlanAlbuquerque/skyrim-community-shaders that referenced this pull request May 29, 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.

HDR output loses all contrast when game is tabbed out

2 participants