mirror of
https://github.com/boykopovar/AnyPS5.git
synced 2026-10-22 08:33:12 -05:00
Detect HDR output on the host: on Windows the monitor showing the window must run in HDR10 (DXGI IDXGIOutput6), and on every host the window's Vulkan surface must offer a 10-bit VK_COLOR_SPACE_HDR10_ST2084_EXT swapchain with VK_EXT_swapchain_colorspace and VK_EXT_hdr_metadata. The monitor's luminance comes from DXGI; hosts that report none get 1000 nits peak and full frame, 0 nits black. While HDR output is available, sceVideoOutGetOutputStatus reports dynamic range 2 and flag bit 0, sceSystemServiceGetHdrToneMapLuminance reports the monitor's luminance, and every open port's output mode event fires when that changes. PQ display buffers are presented unchanged through an HDR10 swapchain with HDR metadata; any other display buffer switches back to the SDR swapchain. Without HDR output the PQ to SDR conversion uses the peak the title was last told as its white level. AI-assisted: yes
23 lines
502 B
C++
23 lines
502 B
C++
#ifndef CORE_LIBS_PRX_LIBSCEVIDEOOUT_INCLUDE_HOSTHDRPROBE_HPP
|
|
#define CORE_LIBS_PRX_LIBSCEVIDEOOUT_INCLUDE_HOSTHDRPROBE_HPP
|
|
|
|
#include "SDL.h"
|
|
|
|
class HostHdrProbe {
|
|
public:
|
|
HostHdrProbe() = default;
|
|
~HostHdrProbe();
|
|
HostHdrProbe(const HostHdrProbe&) = delete;
|
|
HostHdrProbe& operator=(const HostHdrProbe&) = delete;
|
|
|
|
void Poll(SDL_Window* window);
|
|
void Release() noexcept;
|
|
|
|
private:
|
|
void* factory = nullptr;
|
|
void* monitor = nullptr;
|
|
bool published = false;
|
|
};
|
|
|
|
#endif
|