mirror of
https://github.com/shadps4-emu/shadPS4.git
synced 2025-12-09 13:19:00 +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) {
|
void VideoOutDriver::Flip(const Request& req) {
|
||||||
|
// Update HDR status before presenting.
|
||||||
|
presenter->SetHDR(req.port->is_hdr);
|
||||||
|
|
||||||
// Present the frame.
|
// Present the frame.
|
||||||
presenter->Present(req.frame);
|
presenter->Present(req.frame);
|
||||||
|
|
||||||
|
|||||||
@@ -34,7 +34,7 @@ struct VideoOutPort {
|
|||||||
int flip_rate = 0;
|
int flip_rate = 0;
|
||||||
int prev_index = -1;
|
int prev_index = -1;
|
||||||
bool is_open = false;
|
bool is_open = false;
|
||||||
bool is_mode_changing = false; // Used to prevent flip during mode change
|
bool is_hdr = false;
|
||||||
|
|
||||||
s32 FindFreeGroup() const {
|
s32 FindFreeGroup() const {
|
||||||
s32 index = 0;
|
s32 index = 0;
|
||||||
|
|||||||
@@ -429,16 +429,17 @@ s32 PS4_SYSV_ABI sceVideoOutConfigureOutputMode_(s32 handle, u32 reserved, const
|
|||||||
return ORBIS_VIDEO_OUT_ERROR_INVALID_VALUE;
|
return ORBIS_VIDEO_OUT_ERROR_INVALID_VALUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (mode->colorimetry != OrbisVideoOutColorimetry::Any) {
|
switch (mode->colorimetry) {
|
||||||
auto& game_info = Common::ElfInfo::Instance();
|
case OrbisVideoOutColorimetry::Any:
|
||||||
if (mode->colorimetry == OrbisVideoOutColorimetry::Bt2020PQ &&
|
port->is_hdr = false;
|
||||||
game_info.GetPSFAttributes().support_hdr) {
|
break;
|
||||||
port->is_mode_changing = true;
|
case OrbisVideoOutColorimetry::Bt2020PQ:
|
||||||
presenter->SetHDR(true);
|
if (Common::ElfInfo::Instance().GetPSFAttributes().support_hdr) {
|
||||||
port->is_mode_changing = false;
|
port->is_hdr = true;
|
||||||
} else {
|
|
||||||
return ORBIS_VIDEO_OUT_ERROR_INVALID_VALUE;
|
|
||||||
}
|
}
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
return ORBIS_VIDEO_OUT_ERROR_INVALID_VALUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
return ORBIS_OK;
|
return ORBIS_OK;
|
||||||
|
|||||||
Reference in New Issue
Block a user