rsx: Add optimization to skip cloning surfaces whose dimensions did not change

- If only the threshold changed or the surface is below threshold anyway, nothing will change
- In those cases, just update the internal data and continue
This commit is contained in:
kd-11 2026-03-28 03:10:31 +03:00 committed by kd-11
parent e2dff6bbf8
commit fe3cbde1d3

View File

@ -1485,6 +1485,21 @@ namespace rsx
continue;
}
// Perform a test scaling and check if anything is different after scaling
// There are many cases where this will avoid creating new surfaces
const auto [new_w, new_h] = rsx::apply_inverse_resolution_scale<true>(
active_config,
surface->template get_surface_width<>(),
surface->template get_surface_height<>());
if (new_w == surface->width() && new_h == surface->height())
{
// Not affected by resolution scale. Just update the details and move on.
surface->resolution_scaling_config = active_config;
++It;
continue;
}
surfaces_to_clone.push_back(surface);
// Invalidate the previous surface