skyline/app
Billy Laws 98c0cc3e7f Impl preserve attached buffers/textures to avoid GPFIFO lock thrashing
When profiling SMO, it became obvious that the constant locking of textures and buffers in SyncDescriptors took up a large amount of CPU time (3-5%), a precious resource in intensive areas like Metro. This commit implements somewhat of a workaround to avoid constant relocking, if a buffer is frequently attached on the GPU and almost never used on the CPU we can keep the lock held between executions. Of course it's not that simple though, if the guest tries to lock a texture for the first time which has already been locked as preserve on the GPFIFO we need to avoid a deadlock. This is acheived through a combination of two things: first we periodically clear the locked attachments every 2*SlotCount submissions, preventing a complete deadlock on the CPU (just a long wait instead) and meaning that the next time the resource is attached on the GPU it will not be marked for preservation due to having been locked on the guest before; second, we always need to unlock everything when the GPU thread runs out of work, as the perioding clearing will not execute in this case which would otherwise leave the textures locked on the GPFIFO thread forever (if guest was waiting on a lock to submit work). It should be noted that we don't clear preserve attached resources in the latter scenario, only unlock them and then relock when more work is available.
2022-11-02 17:46:07 +00:00
..
libraries Enable hades vertex position input workaround for Adreno 2022-08-08 18:09:00 +01:00
src/main Impl preserve attached buffers/textures to avoid GPFIFO lock thrashing 2022-11-02 17:46:07 +00:00
.gitignore libNX FS Initalization (v0.3) 2019-10-18 16:22:38 +05:30
build.gradle Introduce a releasedebug build variant 2022-10-17 18:39:32 +02:00
CMakeLists.txt Implement Maxwell3D texture pool management and view creation 2022-11-02 17:46:07 +00:00
proguard-rules.pro Add kotlinx.serialization-json dependencies 2022-08-06 22:00:19 +05:30