Implement fast FMOD bank loading#1079
Conversation
46152f0 to
afa827d
Compare
JaThePlayer
left a comment
There was a problem hiding this comment.
From the remarks at https://documentation.help/fmod-studio-api/FMOD_Studio_System_LoadBankFile.html
Failed asynchronous banks should be released by calling Studio::Bank::unload.
|
Thanks @JaThePlayer for the feedback, I addressed it in the latest commit. |
JaThePlayer
left a comment
There was a problem hiding this comment.
I've noticed that the IngestNewBanks method in this class has an exact copy-paste of the last bit of Init() that's being changed in this PR, so it would be good to move those changes to IngestNewBanks and make Init call that method instead.
|
Thanks again for the feedback, I addressed it in the latest commit. This PR now introduces a behavioral change: failing to load a bank no longer throws an exception, but logs an error instead. |
JaThePlayer
left a comment
There was a problem hiding this comment.
My testing in SJ, seems to work fine, including with invalid banks:
Pre-PR: - AUDIO LOAD: 6903ms
Post-PR: - AUDIO LOAD: 1014ms
|
The pull request was approved and entered the 3-day last-call window. Since no PR should be merged within 3 days of the next rolling release, the last-call window is extended further. |
|
The last-call window for this pull request ended. It can now be merged if no blockers were brought up. |
…ing" This reverts commit 8956c36.
This reverts commit 733740f.
This PR implements "Fast FMOD Bank Loading" (like Fast Texture Loading, but for FMOD banks).
It relies on a non blocking bank loading API in FMOD.
The implementations loads all banks in parallel using the non blocking API, pool until all banks are loaded, and then do the same post processing of banks.
This implementation was tested against duplicated GUIDs (with duplicated bank files), which logs a warning; and with invalid bank data (with a truncated bank file), which logs an error (previously throwing an exception).
Right now, the non blocking implementation is enabled by default, and loading state is pooled every 100ms.
On my end, this reduced audio loading time when loading the "Strawberry Jam Collab", from about 6 seconds when using blocking loading, to less than 1 second when using non blocking loading.