TextureCacheBase: Change CalculateLevelSize to match D3D/OGL sizes

This was causing crashes/driver resets when odd-dimension textures were
being loaded, due to the size we were uploading being larger than the size
of the higher-level texture calculated by the runtime.
This commit is contained in:
Stenzek 2016-01-13 12:45:53 +10:00
parent 8f8134f5f4
commit 1f3b90d70a
1 changed files with 1 additions and 1 deletions

View File

@ -328,7 +328,7 @@ void TextureCacheBase::DumpTexture(TCacheEntryBase* entry, std::string basename,
static u32 CalculateLevelSize(u32 level_0_size, u32 level)
{
return (level_0_size + ((1 << level) - 1)) >> level;
return std::max(level_0_size >> level, 1u);
}
// Used by TextureCacheBase::Load