Add setter for ResidentMipLevels on GPU Texture for C# scripting

This commit is contained in:
Wojtek Figat
2021-11-08 00:25:20 +01:00
parent 884e7ce381
commit 4c4c6e8f03
2 changed files with 11 additions and 13 deletions

View File

@@ -792,9 +792,9 @@ Task* GPUTexture::DownloadDataAsync(TextureData& result)
void GPUTexture::SetResidentMipLevels(int32 count)
{
ASSERT(IsRegularTexture() && IsAllocated());
ASSERT(Math::IsInRange(count, 0, MipLevels()));
count = Math::Clamp(count, 0, MipLevels());
if (_residentMipLevels == count || !IsRegularTexture())
return;
_residentMipLevels = count;
onResidentMipsChanged();
}