mirror of
https://github.com/shadps4-emu/shadPS4.git
synced 2025-12-08 20:58:41 +00:00
videoout: Move HDR swapchain configuration to present thread. (#3690)
This commit is contained in:
@@ -165,6 +165,9 @@ int VideoOutDriver::UnregisterBuffers(VideoOutPort* port, s32 attributeIndex) {
|
||||
}
|
||||
|
||||
void VideoOutDriver::Flip(const Request& req) {
|
||||
// Update HDR status before presenting.
|
||||
presenter->SetHDR(req.port->is_hdr);
|
||||
|
||||
// Present the frame.
|
||||
presenter->Present(req.frame);
|
||||
|
||||
|
||||
@@ -34,7 +34,7 @@ struct VideoOutPort {
|
||||
int flip_rate = 0;
|
||||
int prev_index = -1;
|
||||
bool is_open = false;
|
||||
bool is_mode_changing = false; // Used to prevent flip during mode change
|
||||
bool is_hdr = false;
|
||||
|
||||
s32 FindFreeGroup() const {
|
||||
s32 index = 0;
|
||||
|
||||
@@ -429,16 +429,17 @@ s32 PS4_SYSV_ABI sceVideoOutConfigureOutputMode_(s32 handle, u32 reserved, const
|
||||
return ORBIS_VIDEO_OUT_ERROR_INVALID_VALUE;
|
||||
}
|
||||
|
||||
if (mode->colorimetry != OrbisVideoOutColorimetry::Any) {
|
||||
auto& game_info = Common::ElfInfo::Instance();
|
||||
if (mode->colorimetry == OrbisVideoOutColorimetry::Bt2020PQ &&
|
||||
game_info.GetPSFAttributes().support_hdr) {
|
||||
port->is_mode_changing = true;
|
||||
presenter->SetHDR(true);
|
||||
port->is_mode_changing = false;
|
||||
} else {
|
||||
return ORBIS_VIDEO_OUT_ERROR_INVALID_VALUE;
|
||||
switch (mode->colorimetry) {
|
||||
case OrbisVideoOutColorimetry::Any:
|
||||
port->is_hdr = false;
|
||||
break;
|
||||
case OrbisVideoOutColorimetry::Bt2020PQ:
|
||||
if (Common::ElfInfo::Instance().GetPSFAttributes().support_hdr) {
|
||||
port->is_hdr = true;
|
||||
}
|
||||
break;
|
||||
default:
|
||||
return ORBIS_VIDEO_OUT_ERROR_INVALID_VALUE;
|
||||
}
|
||||
|
||||
return ORBIS_OK;
|
||||
|
||||
Reference in New Issue
Block a user