mirror of
https://github.com/shadps4-emu/shadPS4.git
synced 2025-08-08 00:58:43 +00:00
fix for crashes when debug tools used
Some checks failed
Build and Release / reuse (push) Has been cancelled
Build and Release / clang-format (push) Has been cancelled
Build and Release / get-info (push) Has been cancelled
Build and Release / windows-sdl (push) Has been cancelled
Build and Release / windows-qt (push) Has been cancelled
Build and Release / macos-sdl (push) Has been cancelled
Build and Release / macos-qt (push) Has been cancelled
Build and Release / linux-sdl (push) Has been cancelled
Build and Release / linux-qt (push) Has been cancelled
Build and Release / linux-sdl-gcc (push) Has been cancelled
Build and Release / linux-qt-gcc (push) Has been cancelled
Build and Release / pre-release (push) Has been cancelled
Some checks failed
Build and Release / reuse (push) Has been cancelled
Build and Release / clang-format (push) Has been cancelled
Build and Release / get-info (push) Has been cancelled
Build and Release / windows-sdl (push) Has been cancelled
Build and Release / windows-qt (push) Has been cancelled
Build and Release / macos-sdl (push) Has been cancelled
Build and Release / macos-qt (push) Has been cancelled
Build and Release / linux-sdl (push) Has been cancelled
Build and Release / linux-qt (push) Has been cancelled
Build and Release / linux-sdl-gcc (push) Has been cancelled
Build and Release / linux-qt-gcc (push) Has been cancelled
Build and Release / pre-release (push) Has been cancelled
This commit is contained in:
parent
e803e7c49d
commit
dddf805d6a
5 changed files with 15 additions and 10 deletions
|
@ -18,7 +18,6 @@ struct Frame;
|
||||||
namespace Libraries::VideoOut {
|
namespace Libraries::VideoOut {
|
||||||
|
|
||||||
struct VideoOutPort {
|
struct VideoOutPort {
|
||||||
bool is_open = false;
|
|
||||||
SceVideoOutResolutionStatus resolution;
|
SceVideoOutResolutionStatus resolution;
|
||||||
std::array<VideoOutBuffer, MaxDisplayBuffers> buffer_slots;
|
std::array<VideoOutBuffer, MaxDisplayBuffers> buffer_slots;
|
||||||
std::array<u64, MaxDisplayBuffers> buffer_labels; // should be contiguous in memory
|
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 vo_cv;
|
||||||
std::condition_variable vblank_cv;
|
std::condition_variable vblank_cv;
|
||||||
int flip_rate = 0;
|
int flip_rate = 0;
|
||||||
|
bool is_open = false;
|
||||||
|
bool is_mode_changing = false; // Used to prevent flip during mode change
|
||||||
|
|
||||||
s32 FindFreeGroup() const {
|
s32 FindFreeGroup() const {
|
||||||
s32 index = 0;
|
s32 index = 0;
|
||||||
|
|
|
@ -391,7 +391,9 @@ s32 PS4_SYSV_ABI sceVideoOutConfigureOutputMode_(s32 handle, u32 reserved, const
|
||||||
auto& game_info = Common::ElfInfo::Instance();
|
auto& game_info = Common::ElfInfo::Instance();
|
||||||
if (mode->colorimetry == OrbisVideoOutColorimetry::Bt2020PQ &&
|
if (mode->colorimetry == OrbisVideoOutColorimetry::Bt2020PQ &&
|
||||||
game_info.GetPSFAttributes().support_hdr) {
|
game_info.GetPSFAttributes().support_hdr) {
|
||||||
|
port->is_mode_changing = true;
|
||||||
presenter->SetHDR(true);
|
presenter->SetHDR(true);
|
||||||
|
port->is_mode_changing = false;
|
||||||
} else {
|
} else {
|
||||||
return ORBIS_VIDEO_OUT_ERROR_INVALID_VALUE;
|
return ORBIS_VIDEO_OUT_ERROR_INVALID_VALUE;
|
||||||
}
|
}
|
||||||
|
|
|
@ -118,12 +118,7 @@ void OnResize() {
|
||||||
Sdl::OnResize();
|
Sdl::OnResize();
|
||||||
}
|
}
|
||||||
|
|
||||||
void OnSurfaceFormatChange(const vk::Device& device, vk::Format surface_format) {
|
void OnSurfaceFormatChange(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));
|
|
||||||
}
|
|
||||||
Vulkan::OnSurfaceFormatChange(surface_format);
|
Vulkan::OnSurfaceFormatChange(surface_format);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -22,7 +22,7 @@ void Initialize(const Vulkan::Instance& instance, const Frontend::WindowSDL& win
|
||||||
|
|
||||||
void OnResize();
|
void OnResize();
|
||||||
|
|
||||||
void OnSurfaceFormatChange(const vk::Device& device, vk::Format surface_format);
|
void OnSurfaceFormatChange(vk::Format surface_format);
|
||||||
|
|
||||||
void Shutdown(const vk::Device& device);
|
void Shutdown(const vk::Device& device);
|
||||||
|
|
||||||
|
|
|
@ -102,10 +102,17 @@ void Swapchain::SetHDR(bool hdr) {
|
||||||
if (needs_hdr == hdr) {
|
if (needs_hdr == hdr) {
|
||||||
return;
|
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;
|
needs_hdr = hdr;
|
||||||
Recreate(width, height);
|
Recreate(width, height);
|
||||||
ImGui::Core::OnSurfaceFormatChange(instance.GetDevice(),
|
ImGui::Core::OnSurfaceFormatChange(needs_hdr ? SURFACE_FORMAT_HDR.format
|
||||||
needs_hdr ? SURFACE_FORMAT_HDR.format : surface_format.format);
|
: surface_format.format);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool Swapchain::AcquireNextImage() {
|
bool Swapchain::AcquireNextImage() {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue