mirror of
https://github.com/shadps4-emu/shadPS4.git
synced 2025-08-04 16:32:39 +00:00
fix for crashes when debug tools used
This commit is contained in:
parent
e803e7c49d
commit
dddf805d6a
@ -18,7 +18,6 @@ struct Frame;
|
||||
namespace Libraries::VideoOut {
|
||||
|
||||
struct VideoOutPort {
|
||||
bool is_open = false;
|
||||
SceVideoOutResolutionStatus resolution;
|
||||
std::array<VideoOutBuffer, MaxDisplayBuffers> buffer_slots;
|
||||
std::array<u64, MaxDisplayBuffers> buffer_labels; // should be contiguous in memory
|
||||
@ -33,6 +32,8 @@ struct VideoOutPort {
|
||||
std::condition_variable vo_cv;
|
||||
std::condition_variable vblank_cv;
|
||||
int flip_rate = 0;
|
||||
bool is_open = false;
|
||||
bool is_mode_changing = false; // Used to prevent flip during mode change
|
||||
|
||||
s32 FindFreeGroup() const {
|
||||
s32 index = 0;
|
||||
|
@ -391,7 +391,9 @@ s32 PS4_SYSV_ABI sceVideoOutConfigureOutputMode_(s32 handle, u32 reserved, const
|
||||
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;
|
||||
}
|
||||
|
@ -118,12 +118,7 @@ void OnResize() {
|
||||
Sdl::OnResize();
|
||||
}
|
||||
|
||||
void OnSurfaceFormatChange(const vk::Device& device, vk::Format surface_format) {
|
||||
auto result = device.waitIdle();
|
||||
if (result != vk::Result::eSuccess) {
|
||||
LOG_WARNING(ImGui, "Failed to wait for Vulkan device idle on shutdown: {}",
|
||||
vk::to_string(result));
|
||||
}
|
||||
void OnSurfaceFormatChange(vk::Format surface_format) {
|
||||
Vulkan::OnSurfaceFormatChange(surface_format);
|
||||
}
|
||||
|
||||
|
@ -22,7 +22,7 @@ void Initialize(const Vulkan::Instance& instance, const Frontend::WindowSDL& win
|
||||
|
||||
void OnResize();
|
||||
|
||||
void OnSurfaceFormatChange(const vk::Device& device, vk::Format surface_format);
|
||||
void OnSurfaceFormatChange(vk::Format surface_format);
|
||||
|
||||
void Shutdown(const vk::Device& device);
|
||||
|
||||
|
@ -102,10 +102,17 @@ void Swapchain::SetHDR(bool hdr) {
|
||||
if (needs_hdr == hdr) {
|
||||
return;
|
||||
}
|
||||
|
||||
auto result = instance.GetDevice().waitIdle();
|
||||
if (result != vk::Result::eSuccess) {
|
||||
LOG_WARNING(ImGui, "Failed to wait for Vulkan device idle on mode change: {}",
|
||||
vk::to_string(result));
|
||||
}
|
||||
|
||||
needs_hdr = hdr;
|
||||
Recreate(width, height);
|
||||
ImGui::Core::OnSurfaceFormatChange(instance.GetDevice(),
|
||||
needs_hdr ? SURFACE_FORMAT_HDR.format : surface_format.format);
|
||||
ImGui::Core::OnSurfaceFormatChange(needs_hdr ? SURFACE_FORMAT_HDR.format
|
||||
: surface_format.format);
|
||||
}
|
||||
|
||||
bool Swapchain::AcquireNextImage() {
|
||||
|
Loading…
Reference in New Issue
Block a user