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:
@@ -1485,6 +1485,21 @@ namespace rsx
|
|||||||
continue;
|
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);
|
surfaces_to_clone.push_back(surface);
|
||||||
|
|
||||||
// Invalidate the previous surface
|
// Invalidate the previous surface
|
||||||
|
|||||||
Reference in New Issue
Block a user