RPCS3 / rpcs3

PlayStation 3 emulator and debugger
https://rpcs3.net/
GNU General Public License v2.0
15.64k stars 1.92k forks source link

rsx: Asynchronous host memory management #16352

Open kd-11 opened 3 hours ago

kd-11 commented 3 hours ago

When requesting memory protection operations, enqueue the requests and handle them in batches. Applies to the texture cache only. A common issue is that when locking pages, we end up trampling on our own work (e.g upload texture 1, lock pages, upload texture 2, requires to unlock texture 1 then lock texture 1 and texture 2, etc). This can get really slow. Instead, we don't actually care about the memory protection during command recording, so freely mark the slots for protection until we have gathered everything and are ready to render. Then apply the protections in bulk. The result is a significant speedup in sensitive games though this is admittedly a rare scenario. Makes id tech 5 stop stuttering to single digit framerates.

Darkhost1999 commented 1 hour ago
Master VS PR Master ![image](https://github.com/user-attachments/assets/9c201ac5-c35f-4f28-9a60-3c2d3b165799) [RPCS3.log](https://github.com/user-attachments/files/17910323/RPCS3.log) PR ![image](https://github.com/user-attachments/assets/b2004a58-882e-4421-84a9-a915744c1da2) [RPCS3.log](https://github.com/user-attachments/files/17910335/RPCS3.log)

A significant performance increase in Need for Speed Most Wanted Note: I was unsuccessful in uncapping the framerate. The exact performance increase is an unknown value.

MarioSonic2987 commented 1 hour ago

Water no longer shakes in Saints Row: The Third, but breaks player's character textures. image

image

In master or disabling Asynchronous Memory Manager in this PR fixes player's characters textures, but the water will shake again. image