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: don't reject game textures which have the wrong size #11930

Merged
merged 1 commit into from Jun 13, 2023

Conversation

iwubcode
Copy link
Contributor

@iwubcode iwubcode commented Jun 12, 2023

This was a regression from the asset system being used for texture packs. Apparently, despite the log message, an incorrect texture aspect ratio or having the texture size not being a multiple of the original does not reject the texture from being used.

A user was reporting that they were not able to see some textures or use a dynamic input texture pack because the textures broke one or both of these rules.

Since the errors aren't fatal, I downgraded them to a warning

@iwubcode

This comment was marked as outdated.

@AdmiralCurtiss
Copy link
Contributor

AdmiralCurtiss commented Jun 13, 2023

For reference:

// Verify that the aspect ratio of the texture hasn't changed, as this could have side-effects.
const VideoCommon::CustomTextureData::Level& first_mip = ret->m_data.m_levels[0];
if (first_mip.width * height != first_mip.height * width)
{
ERROR_LOG_FMT(VIDEO,
"Invalid custom texture size {}x{} for texture {}. The aspect differs "
"from the native size {}x{}.",
first_mip.width, first_mip.height, first_mip_file.path, width, height);
}
// Same deal if the custom texture isn't a multiple of the native size.
if (width != 0 && height != 0 && (first_mip.width % width || first_mip.height % height))
{
ERROR_LOG_FMT(VIDEO,
"Invalid custom texture size {}x{} for texture {}. Please use an integer "
"upscaling factor based on the native size {}x{}.",
first_mip.width, first_mip.height, first_mip_file.path, width, height);
}

This was indeed non-fatal before. Pretty strange and probably an error, but I guess some texture packs are now out there relying on it, so we'll have to keep it that way.

@AdmiralCurtiss
Copy link
Contributor

Can you maybe add a comment that this isn't fatal for legacy reasons?

@iwubcode
Copy link
Contributor Author

Thanks @AdmiralCurtiss ! Apologies, probably shoulda referenced the old code somehow. Anyway, I added a comment, let me know if you think it needs any different wording. Thanks again for looking it over!

@AdmiralCurtiss AdmiralCurtiss merged commit 74c0519 into dolphin-emu:master Jun 13, 2023
14 checks passed
@iwubcode iwubcode deleted the game_texture_validation branch June 13, 2023 15:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants