From 02832d9623c1e389bbbd20ee7f27aadf2421c5d7 Mon Sep 17 00:00:00 2001 From: kd-11 <15904127+kd-11@users.noreply.github.com> Date: Thu, 2 Dec 2021 16:02:08 +0300 Subject: [PATCH] rsx: Add some sensible fallbacks (#11219) * rsx: Add some sensible fallbacks * Update GLPresent.cpp * Update VKPresent.cpp * Update rsx_utils.h * Update rsx_utils.cpp --- rpcs3/Emu/RSX/GL/GLPresent.cpp | 6 ++++++ rpcs3/Emu/RSX/VK/VKPresent.cpp | 6 ++++++ rpcs3/Emu/RSX/rsx_utils.cpp | 14 ++++++++++++++ rpcs3/Emu/RSX/rsx_utils.h | 3 +++ 4 files changed, 29 insertions(+) diff --git a/rpcs3/Emu/RSX/GL/GLPresent.cpp b/rpcs3/Emu/RSX/GL/GLPresent.cpp index c58a9c3120..d78a36ee4f 100644 --- a/rpcs3/Emu/RSX/GL/GLPresent.cpp +++ b/rpcs3/Emu/RSX/GL/GLPresent.cpp @@ -131,6 +131,12 @@ void GLGSRender::flip(const rsx::display_flip_info_t& info) u32 av_format; const auto& avconfig = g_fxo->get(); + if (!buffer_width) + { + buffer_width = avconfig.resolution_x; + buffer_height = avconfig.resolution_y; + } + if (avconfig.state) { av_format = avconfig.get_compatible_gcm_format(); diff --git a/rpcs3/Emu/RSX/VK/VKPresent.cpp b/rpcs3/Emu/RSX/VK/VKPresent.cpp index a577a49957..eb3697b6c8 100644 --- a/rpcs3/Emu/RSX/VK/VKPresent.cpp +++ b/rpcs3/Emu/RSX/VK/VKPresent.cpp @@ -448,6 +448,12 @@ void VKGSRender::flip(const rsx::display_flip_info_t& info) u32 av_format; const auto& avconfig = g_fxo->get(); + if (!buffer_width) + { + buffer_width = avconfig.resolution_x; + buffer_height = avconfig.resolution_y; + } + if (avconfig.state) { av_format = avconfig.get_compatible_gcm_format(); diff --git a/rpcs3/Emu/RSX/rsx_utils.cpp b/rpcs3/Emu/RSX/rsx_utils.cpp index fd1ebd1a0a..03197d5ac1 100644 --- a/rpcs3/Emu/RSX/rsx_utils.cpp +++ b/rpcs3/Emu/RSX/rsx_utils.cpp @@ -135,6 +135,20 @@ namespace rsx return result; } + avconf::avconf() noexcept + { + switch (g_cfg.video.aspect_ratio) + { + default: + case video_aspect::_16_9: + aspect = CELL_VIDEO_OUT_ASPECT_16_9; + break; + case video_aspect::_4_3: + aspect = CELL_VIDEO_OUT_ASPECT_4_3; + break; + } + } + u32 avconf::get_compatible_gcm_format() const { switch (format) diff --git a/rpcs3/Emu/RSX/rsx_utils.h b/rpcs3/Emu/RSX/rsx_utils.h index f15fd975c4..c4e18adafa 100644 --- a/rpcs3/Emu/RSX/rsx_utils.h +++ b/rpcs3/Emu/RSX/rsx_utils.h @@ -161,6 +161,9 @@ namespace rsx u32 resolution_y = 720; // Y RES atomic_t state = 0; // 1 after cellVideoOutConfigure was called + avconf() noexcept; + ~avconf() = default; + u32 get_compatible_gcm_format() const; u8 get_bpp() const; double get_aspect_ratio() const;