VideoCommon: don't treat incorrect aspect ratio or sizes that aren't a multiple of native textures as an error

This commit is contained in:
iwubcode 2023-06-11 21:28:08 -05:00
parent 4e4705e983
commit 3e27fc7c0b
1 changed files with 8 additions and 4 deletions

View File

@ -60,24 +60,28 @@ bool GameTextureAsset::Validate(u32 native_width, u32 native_height) const
const VideoCommon::CustomTextureData::Level& first_mip = m_data->m_levels[0];
if (first_mip.width * native_height != first_mip.height * native_width)
{
ERROR_LOG_FMT(
// Note: this feels like this should return an error but
// for legacy reasons this is only a notice that something *could*
// go wrong
WARN_LOG_FMT(
VIDEO,
"Invalid custom texture size {}x{} for game texture asset '{}'. The aspect differs "
"from the native size {}x{}.",
first_mip.width, first_mip.height, GetAssetId(), native_width, native_height);
return false;
}
// Same deal if the custom texture isn't a multiple of the native size.
if (native_width != 0 && native_height != 0 &&
(first_mip.width % native_width || first_mip.height % native_height))
{
ERROR_LOG_FMT(
// Note: this feels like this should return an error but
// for legacy reasons this is only a notice that something *could*
// go wrong
WARN_LOG_FMT(
VIDEO,
"Invalid custom texture size {}x{} for game texture asset '{}'. Please use an integer "
"upscaling factor based on the native size {}x{}.",
first_mip.width, first_mip.height, GetAssetId(), native_width, native_height);
return false;
}
return true;