mirror of
https://github.com/gnif/LookingGlass.git
synced 2026-07-16 04:12:03 +00:00
[idd] hdr: dont advertise non hdr formats as hdr
Some checks failed
build / client (Debug, map[cc:clang cxx:clang++], libdecor) (push) Has been cancelled
build / client (Debug, map[cc:clang cxx:clang++], xdg-shell) (push) Has been cancelled
build / client (Debug, map[cc:gcc cxx:g++], libdecor) (push) Has been cancelled
build / client (Debug, map[cc:gcc cxx:g++], xdg-shell) (push) Has been cancelled
build / client (Release, map[cc:clang cxx:clang++], libdecor) (push) Has been cancelled
build / client (Release, map[cc:clang cxx:clang++], xdg-shell) (push) Has been cancelled
build / client (Release, map[cc:gcc cxx:g++], libdecor) (push) Has been cancelled
build / client (Release, map[cc:gcc cxx:g++], xdg-shell) (push) Has been cancelled
build / module (push) Has been cancelled
build / host-linux (push) Has been cancelled
build / host-windows-cross (push) Has been cancelled
build / host-windows-native (push) Has been cancelled
build / idd (push) Has been cancelled
build / obs (clang) (push) Has been cancelled
build / obs (gcc) (push) Has been cancelled
build / docs (push) Has been cancelled
Some checks failed
build / client (Debug, map[cc:clang cxx:clang++], libdecor) (push) Has been cancelled
build / client (Debug, map[cc:clang cxx:clang++], xdg-shell) (push) Has been cancelled
build / client (Debug, map[cc:gcc cxx:g++], libdecor) (push) Has been cancelled
build / client (Debug, map[cc:gcc cxx:g++], xdg-shell) (push) Has been cancelled
build / client (Release, map[cc:clang cxx:clang++], libdecor) (push) Has been cancelled
build / client (Release, map[cc:clang cxx:clang++], xdg-shell) (push) Has been cancelled
build / client (Release, map[cc:gcc cxx:g++], libdecor) (push) Has been cancelled
build / client (Release, map[cc:gcc cxx:g++], xdg-shell) (push) Has been cancelled
build / module (push) Has been cancelled
build / host-linux (push) Has been cancelled
build / host-windows-cross (push) Has been cancelled
build / host-windows-native (push) Has been cancelled
build / idd (push) Has been cancelled
build / obs (clang) (push) Has been cancelled
build / obs (gcc) (push) Has been cancelled
build / docs (push) Has been cancelled
This commit is contained in:
committed by
Geoffrey McRae
parent
2f59de572b
commit
ff1631da67
@@ -366,11 +366,16 @@ bool CSwapChainProcessor::SwapChainNewFrame(ComPtr<IDXGIResource> acquiredBuffer
|
||||
srcFormat.height = srcDesc.Height;
|
||||
srcFormat.format = GetFrameType(srcDesc.Format);
|
||||
|
||||
// Determine HDR status from both format and color space.
|
||||
// HDR metadata loading is handled inside each branch so the logic
|
||||
// is self-contained: first identify the content type, then load the
|
||||
// matching metadata.
|
||||
if (srcDesc.Format == DXGI_FORMAT_R16G16B16A16_FLOAT)
|
||||
// Only HDR-capable formats can carry HDR content.
|
||||
// 8-bit formats (BGRA, RGBA) cannot represent HDR,
|
||||
// even if IsHDRActive() is momentarily stale during mode switches.
|
||||
if (srcDesc.Format != DXGI_FORMAT_R16G16B16A16_FLOAT &&
|
||||
srcDesc.Format != DXGI_FORMAT_R10G10B10A2_UNORM)
|
||||
{
|
||||
srcFormat.hdr = false;
|
||||
srcFormat.hdrPQ = false;
|
||||
}
|
||||
else if (srcDesc.Format == DXGI_FORMAT_R16G16B16A16_FLOAT)
|
||||
{
|
||||
// FP16 is HDR content (scRGB / linear, not PQ-curve).
|
||||
// FP16 always carries HDR color data regardless of OS HDR mode,
|
||||
@@ -408,7 +413,10 @@ bool CSwapChainProcessor::SwapChainNewFrame(ComPtr<IDXGIResource> acquiredBuffer
|
||||
|
||||
// Load HDR metadata; if none is available the frame is not HDR.
|
||||
if (!m_devContext->GetHDRMetadata(srcFormat))
|
||||
srcFormat.hdr = false;
|
||||
{
|
||||
srcFormat.hdr = false;
|
||||
srcFormat.hdrPQ = false;
|
||||
}
|
||||
}
|
||||
|
||||
bool postProcessFormatChanged = false;
|
||||
|
||||
Reference in New Issue
Block a user