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

VideoCommon: split cache entry creation into a separate function #11661

Merged
merged 1 commit into from Apr 8, 2023

Conversation

iwubcode
Copy link
Contributor

This splits 'GetTexture()' in TextureCacheBase into two functions. 'GetTexture()' remains the way we look up a texture entry but a new function 'CreateTextureEntry()' is defined to handle the creation. In addition, this cleans up the hi res texture logic so that it's all in one place.

There are a few advantages:

  • Code is a bit cleaner
  • Less branching for hi res textures (possibly compiler would optimize this but still)
  • Allows for a CustomTextureData to be replaced or enhanced later (used in my PRs)

@iwubcode iwubcode marked this pull request as draft March 15, 2023 00:05
@iwubcode iwubcode marked this pull request as ready for review March 15, 2023 00:41
@AdmiralCurtiss
Copy link
Contributor

Other than that this looks fine to me. It's kinda hard to tell whether the code still does the same thing after the refactor but I think it does, and it's definitely less convoluted than the old one.

…n, separating the custom texture data path from the game's texture data path
@AdmiralCurtiss AdmiralCurtiss merged commit 7519941 into dolphin-emu:master Apr 8, 2023
14 checks passed
@iwubcode iwubcode deleted the rework_texture_cache branch April 8, 2023 17:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
3 participants