[Tweak] Improve KD lava effect performance and stability #3501
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The KD lava texture effect restoration required invalidating the texture cache every frame and introduced a performance cost that was noticeable on lower end systems.
To work around this I need to invalidate the lava texture used by the scenes DLs from KD's draw code. I'm doing this via the WORK_DISP buffer which executes before the POLY_OPA_DISP, which allows the texture to be invalidated before the scene is drawn. This should improve the performance in KD's room and retain the lava effect updating properly.
Using WORK_DISP for this increases its used size from
48
to64
out of a max256
. The WORK_DISP seems to be used with the graph disassembler/crash handling, which is current disabled in SoH. Ideally this will be replaced with resource manager helpers on the LUS side in a future update.I also added some texture size validation for HD textures to ensure all the lava textures are compatible with each other. When it is not (like from older texture packs), then the lava waving effect is disabled, and the cooling off effect just cools off to a black texture. This should prevent the crashes in KD's room seen when older texture packs are used.
Build Artifacts