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:
parent
8f8134f5f4
commit
1f3b90d70a
|
@ -328,7 +328,7 @@ void TextureCacheBase::DumpTexture(TCacheEntryBase* entry, std::string basename,
|
||||||
|
|
||||||
static u32 CalculateLevelSize(u32 level_0_size, u32 level)
|
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
|
// Used by TextureCacheBase::Load
|
||||||
|
|
Loading…
Reference in New Issue