Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions src/Features/HDRDisplay.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -248,6 +248,7 @@ namespace
}

bool HDRDisplay::isHDRMonitor = false;
bool HDRDisplay::wasExclusiveFullscreen = false;

bool HDRDisplay::DetectHDR()
{
Expand Down Expand Up @@ -278,6 +279,18 @@ void HDRDisplay::DrawSettings()
} else {
ImGui::TextColored(Util::Colors::GetWarning(), "SDR Display (HDR not detected)");
}

const bool isExclusiveFullscreen = globals::features::upscaling.loaded ? !globals::features::upscaling.isWindowed : wasExclusiveFullscreen;

if (isExclusiveFullscreen) {
ImGui::Spacing();
ImGui::PushStyleColor(ImGuiCol_Text, Util::Colors::GetWarning());
ImGui::TextWrapped("WARNING: Exclusive Fullscreen detected.");
ImGui::TextWrapped("HDR is not compatible with Exclusive Fullscreen and may not work correctly. Switch to Borderless Windowed mode for proper HDR support.");
ImGui::PopStyleColor();
ImGui::Spacing();
}

ImGui::Spacing();

// Gate HDR checkbox behind monitor detection
Expand Down
1 change: 1 addition & 0 deletions src/Features/HDRDisplay.h
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,7 @@ struct HDRDisplay : public Feature

static bool DetectHDR();
static bool isHDRMonitor;
static bool wasExclusiveFullscreen; // EFS detected at swapchain creation; incompatible with HDR
bool pendingAutoDetect = false;

float GetDisplayMaxLuminance() const;
Expand Down
3 changes: 3 additions & 0 deletions src/Hooks.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -364,6 +364,9 @@ HRESULT WINAPI hk_D3D11CreateDeviceAndSwapChain(
modifiedDesc.SwapEffect = DXGI_SWAP_EFFECT_FLIP_DISCARD;
if (modifiedDesc.BufferCount < 2)
modifiedDesc.BufferCount = 2;

HDRDisplay::wasExclusiveFullscreen = !modifiedDesc.Windowed;

logger::info("[HDR] Upgraded swap chain: R10G10B10A2_UNORM + FLIP_DISCARD");
}

Expand Down
Loading