mirror of
https://github.com/RPCS3/rpcs3.git
synced 2025-07-09 16:31:28 +12:00
rsx: Fixup for resolution scaling support
This commit is contained in:
parent
4a5bbba277
commit
acb14320da
2 changed files with 20 additions and 5 deletions
|
@ -80,11 +80,26 @@ namespace rsx
|
|||
{
|
||||
// Perform intersection here
|
||||
const auto region = rsx::get_transferable_region(target_surface);
|
||||
width = std::get<0>(region);
|
||||
height = std::get<1>(region);
|
||||
|
||||
transfer_scale_x = f32(std::get<2>(region)) / width;
|
||||
transfer_scale_y = f32(std::get<3>(region)) / height;
|
||||
auto src_w = std::get<0>(region);
|
||||
auto src_h = std::get<1>(region);
|
||||
auto dst_w = std::get<2>(region);
|
||||
auto dst_h = std::get<3>(region);
|
||||
|
||||
// Apply resolution scale if needed
|
||||
if (g_cfg.video.resolution_scale_percent != 100)
|
||||
{
|
||||
auto src = static_cast<T>(source);
|
||||
src_w = rsx::apply_resolution_scale(src_w, true, src->get_surface_width(rsx::surface_metrics::pixels));
|
||||
src_h = rsx::apply_resolution_scale(src_h, true, src->get_surface_height(rsx::surface_metrics::pixels));
|
||||
dst_w = rsx::apply_resolution_scale(dst_w, true, target_surface->get_surface_width(rsx::surface_metrics::pixels));
|
||||
dst_h = rsx::apply_resolution_scale(dst_h, true, target_surface->get_surface_height(rsx::surface_metrics::pixels));
|
||||
}
|
||||
|
||||
width = src_w;
|
||||
height = src_h;
|
||||
transfer_scale_x = f32(dst_w) / src_w;
|
||||
transfer_scale_y = f32(dst_h) / src_h;
|
||||
|
||||
target = target_surface;
|
||||
}
|
||||
|
|
|
@ -578,7 +578,7 @@ namespace rsx
|
|||
std::tuple<u16, u16, u16, u16> get_transferable_region(const SurfaceType* surface)
|
||||
{
|
||||
auto src = static_cast<const SurfaceType*>(surface->old_contents.source);
|
||||
auto area1 = surface->get_normalized_memory_area();
|
||||
auto area1 = src->get_normalized_memory_area();
|
||||
auto area2 = surface->get_normalized_memory_area();
|
||||
|
||||
auto w = std::min(area1.x2, area2.x2);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue