rsx: fix 3D aspect ratio
Some checks failed
Generate Translation Template / Generate Translation Template (push) Has been cancelled
Build RPCS3 / RPCS3 Linux ${{ matrix.os }} ${{ matrix.compiler }} (/rpcs3/.ci/build-linux-aarch64.sh, gcc, rpcs3/rpcs3-ci-jammy-aarch64:1.6, ubuntu-24.04-arm) (push) Has been cancelled
Build RPCS3 / RPCS3 Linux ${{ matrix.os }} ${{ matrix.compiler }} (/rpcs3/.ci/build-linux.sh, gcc, rpcs3/rpcs3-ci-jammy:1.6, ubuntu-24.04) (push) Has been cancelled
Build RPCS3 / RPCS3 Linux ${{ matrix.os }} ${{ matrix.compiler }} (a1d35836e8d45bfc6f63c26f0a3e5d46ef622fe1, rpcs3/rpcs3-binaries-linux-arm64, /rpcs3/.ci/build-linux-aarch64.sh, clang, rpcs3/rpcs3-ci-jammy-aarch64:1.6, ubuntu-24.04-arm) (push) Has been cancelled
Build RPCS3 / RPCS3 Linux ${{ matrix.os }} ${{ matrix.compiler }} (d812f1254a1157c80fd402f94446310560f54e5f, rpcs3/rpcs3-binaries-linux, /rpcs3/.ci/build-linux.sh, clang, rpcs3/rpcs3-ci-jammy:1.6, ubuntu-24.04) (push) Has been cancelled
Build RPCS3 / RPCS3 Mac ${{ matrix.name }} (51ae32f468089a8169aaf1567de355ff4a3e0842, rpcs3/rpcs3-binaries-mac, arch -X86_64 .ci/build-mac.sh, Intel) (push) Has been cancelled
Build RPCS3 / RPCS3 Mac ${{ matrix.name }} (8e21bdbc40711a3fccd18fbf17b742348b0f4281, rpcs3/rpcs3-binaries-mac-arm64, .ci/build-mac-arm64.sh, Apple Silicon) (push) Has been cancelled
Build RPCS3 / RPCS3 Windows (push) Has been cancelled
Build RPCS3 / RPCS3 Windows Clang (win64, clang, clang64) (push) Has been cancelled
Build RPCS3 / RPCS3 FreeBSD (push) Has been cancelled

This commit is contained in:
Megamouse 2025-09-12 03:22:17 +02:00
parent a2a3ce1d7a
commit 6106e8f79f
4 changed files with 19 additions and 7 deletions

View file

@ -187,9 +187,9 @@ void GLGSRender::flip(const rsx::display_flip_info_t& info)
if (!buffer_pitch)
buffer_pitch = buffer_width * avconfig.get_bpp();
const u32 video_frame_height = (avconfig.stereo_mode == stereo_render_mode_options::disabled ? avconfig.resolution_y : ((avconfig.resolution_y - 30) / 2));
buffer_width = std::min(buffer_width, avconfig.resolution_x);
buffer_height = std::min(buffer_height, video_frame_height);
const size2u video_frame_size = avconfig.video_frame_size();
buffer_width = std::min(buffer_width, video_frame_size.width);
buffer_height = std::min(buffer_height, video_frame_size.height);
}
else
{

View file

@ -457,9 +457,9 @@ void VKGSRender::flip(const rsx::display_flip_info_t& info)
if (!buffer_pitch)
buffer_pitch = buffer_width * avconfig.get_bpp();
const u32 video_frame_height = (avconfig.stereo_mode == stereo_render_mode_options::disabled ? avconfig.resolution_y : ((avconfig.resolution_y - 30) / 2));
buffer_width = std::min(buffer_width, avconfig.resolution_x);
buffer_height = std::min(buffer_height, video_frame_height);
const size2u video_frame_size = avconfig.video_frame_size();
buffer_width = std::min(buffer_width, video_frame_size.width);
buffer_height = std::min(buffer_height, video_frame_size.height);
}
else
{

View file

@ -187,6 +187,16 @@ namespace rsx
}
}
size2u avconf::video_frame_size() const
{
if (state && stereo_mode != stereo_render_mode_options::disabled)
{
return size2u{ resolution_x, (resolution_y - 30) / 2 };
}
return size2u{ resolution_x, resolution_y };
}
size2u avconf::aspect_convert_dimensions(const size2u& image_dimensions) const
{
if (image_dimensions.width == 0 || image_dimensions.height == 0)
@ -210,7 +220,7 @@ namespace rsx
// Fit the input image into the virtual display 'window'
const auto source_aspect = 1. * image_dimensions.width / image_dimensions.height;
const auto virtual_output = size2u{ resolution_x, resolution_y };
const auto virtual_output = video_frame_size();
const auto area1 = convert_aspect_ratio_impl(virtual_output, source_aspect);
// Fit the virtual display into the physical display

View file

@ -172,6 +172,8 @@ namespace rsx
u8 get_bpp() const;
double get_aspect_ratio() const;
size2u video_frame_size() const;
areau aspect_convert_region(const size2u& image_dimensions, const size2u& output_dimensions) const;
size2u aspect_convert_dimensions(const size2u& image_dimensions) const;
};