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: move all texture calculations to a "TextureInfo" class #9681
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some initial thoughts; I haven't read through this in detail yet.
| TexDecoder_Decode(dst_buffer, mip_level->GetData(), mip_level->GetExpandedWidth(), | ||
| mip_level->GetExpandedHeight(), texture_info.GetTextureFormat(), | ||
| texture_info.GetTlutAddress(), texture_info.GetTlutFormat()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
TexDecoder_Decode should probably take the texture_info and a mip-level. (future PR?)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks phire. I think all 3 of these are great suggestions. However, yeah, I'd prefer to save this cleanup for a separate PR (maybe even separate them out, depending on how involved they are).
| mip_level->GetExpandedHeight(), texture_info.GetTextureFormat(), | ||
| texture_info.GetTlutAddress(), texture_info.GetTlutFormat()); | ||
| entry->texture->Load(level, mip_level->GetRawWidth(), mip_level->GetRawHeight(), | ||
| mip_level->GetExpandedWidth(), dst_buffer, decoded_mip_size); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe Load should take the texture_info instead of the three parameters here? (future PR?)
| !DecodeTextureOnGPU( | ||
| entry, level, mip_level->GetData(), mip_level->GetTextureSize(), | ||
| texture_info.GetTextureFormat(), mip_level->GetRawWidth(), mip_level->GetRawHeight(), | ||
| mip_level->GetExpandedWidth(), mip_level->GetExpandedHeight(), | ||
| bytes_per_block * (mip_level->GetExpandedWidth() / texture_info.GetBlockWidth()), | ||
| texture_info.GetTlutAddress(), texture_info.GetTlutFormat())) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
DecodeTextureOnGPU should take a texture_info (future PR?)
…This ever so slightly improves readability and allows for the full texture name to be generated outside of the hires texture cache
More stuff can be moved over if desired later, I tried to stick to the basic information needed to calculate the texture id. This cleans up the code ever so slightly, the current TextureCacheBase code is hard to follow because it changes some of the parameters it passes in but not all. This centralizes the code and makes its members const, hopefully making it easier to read.
Additionally, and more importantly, texture data is currently loaded and bound in VertexManagerBase. By providing this class, the texture data can be leveraged in other areas of the code base, allowing us to provide new enhancements.