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
This commit is contained in:
kd-11 2021-12-02 16:02:08 +03:00 committed by GitHub
parent 0ab36ef44d
commit 02832d9623
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 29 additions and 0 deletions

View File

@ -131,6 +131,12 @@ void GLGSRender::flip(const rsx::display_flip_info_t& info)
u32 av_format;
const auto& avconfig = g_fxo->get<rsx::avconf>();
if (!buffer_width)
{
buffer_width = avconfig.resolution_x;
buffer_height = avconfig.resolution_y;
}
if (avconfig.state)
{
av_format = avconfig.get_compatible_gcm_format();

View File

@ -448,6 +448,12 @@ void VKGSRender::flip(const rsx::display_flip_info_t& info)
u32 av_format;
const auto& avconfig = g_fxo->get<rsx::avconf>();
if (!buffer_width)
{
buffer_width = avconfig.resolution_x;
buffer_height = avconfig.resolution_y;
}
if (avconfig.state)
{
av_format = avconfig.get_compatible_gcm_format();

View File

@ -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)

View File

@ -161,6 +161,9 @@ namespace rsx
u32 resolution_y = 720; // Y RES
atomic_t<u32> 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;