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

Refactor the replacement cache #17134

Merged
merged 7 commits into from
Mar 16, 2023
Merged

Refactor the replacement cache #17134

merged 7 commits into from
Mar 16, 2023

Conversation

hrydgard
Copy link
Owner

@hrydgard hrydgard commented Mar 16, 2023

The cache_ now only contains minimal references, while ReplacedTexture now takes over the previous roles of the levelCache_ entries. Basically, we no longer create duplicate ReplacedTexture, only duplicated ReplacedTextureRef that point to the same ReplacedTexture.

This makes things a lot more understandable and maintainable, mainly, there might also be some minor reduction in memory usage.

Additionally, this opens for the TextureCacheCommon to find out if multiple PSP texture get replaced with the same replaced texture and avoiding creating multiple host textures, but that's for later.

Additionally, this fixes enabling/disable texture replacement at runtime as a side effect.

@hrydgard hrydgard added Code Cleanup Cleanup to make future work easier. Needs to be done sometimes. Texture replacement labels Mar 16, 2023
@hrydgard hrydgard added this to the v1.15.0 milestone Mar 16, 2023
@hrydgard hrydgard merged commit ae8c804 into master Mar 16, 2023
@hrydgard hrydgard deleted the more-replacement-work branch March 16, 2023 11:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Code Cleanup Cleanup to make future work easier. Needs to be done sometimes. Texture replacement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant