Fix crash when updating GPU texture residency to 0

This commit is contained in:
Wojtek Figat
2023-04-26 14:59:36 +02:00
parent 73ff053470
commit 6aaa5832a8
2 changed files with 5 additions and 3 deletions

View File

@@ -240,7 +240,8 @@ void GPUTextureDX12::OnResidentMipsChanged()
GPUTextureViewDX12& view = IsVolume() ? _handleVolume : _handlesPerSlice[0];
if (view.GetParent() == nullptr)
view.Init(this, _device, this, Format(), MultiSampleLevel());
view.SetSRV(srDesc);
if (mipLevels != 0)
view.SetSRV(srDesc);
}
void GPUTextureDX12::OnReleaseGPU()