Fix Model SDF texture streaming to properly mark highest loaded mip as resident
This commit is contained in:
@@ -83,12 +83,16 @@ protected:
|
||||
auto texture = _texture.Get();
|
||||
if (texture)
|
||||
{
|
||||
// Check if the new mips has been just uploaded
|
||||
if (_mipIndex == texture->HighestResidentMipIndex() - 1)
|
||||
{
|
||||
// Mark as mip loaded
|
||||
// Mark the new mip as loaded
|
||||
texture->SetResidentMipLevels(texture->ResidentMipLevels() + 1);
|
||||
}
|
||||
else
|
||||
{
|
||||
// Mark the new mip and all lower ones as loaded (eg. when loading Model SDF texture mips at once but out of order)
|
||||
texture->SetResidentMipLevels(Math::Max(texture->ResidentMipLevels(), texture->MipLevels() - _mipIndex));
|
||||
}
|
||||
}
|
||||
|
||||
// Base
|
||||
|
||||
Reference in New Issue
Block a user