Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

More F3DEX3 no texture load optimizations #131

Merged
merged 2 commits into from
Jun 6, 2024
Merged

Conversation

sauraen
Copy link
Collaborator

@sauraen sauraen commented Jun 2, 2024

As discussed in #128 , F3DEX3's texture load optimizer can break when a display list is run repeatedly but with changing a segment in between to point to different textures. This will only cause problems when:

  • there can be multiple of the objects in the scene rendered sequentially. If there is only ever one of them at a time, the issue will never arise.
  • the object only has one material. If there are multiple materials, for example a character actor with eyes which are set by segment, the optimization will not occur because TMEM doesn't still contain the same texture.
  • the choice of texture is independent for each object. If the segmented texture is hardcoded (e.g. gSomething) or if it's set by a process which is the same for all instances (e.g. global timer), the textures will be the same and the optimization is a good thing.

This PR aims to fix all cases of this. Macros are created which check if a different texture is being used between instances and if so disable the optimization. If F3DEX3 is disabled, these macros become no-ops.

Every effect was manually checked for cases like this. All other actors were scanned with a regex. It's possible some example was missed due to incomplete decomp names.

@sauraen sauraen marked this pull request as ready for review June 2, 2024 21:27
@sauraen sauraen merged commit b075ab0 into develop/2.1.0 Jun 6, 2024
4 checks passed
@sauraen sauraen deleted the MoreEX3NoTexOptim branch June 6, 2024 03:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants