MCPcopy Create free account
hub / github.com/FlaxEngine/FlaxEngine / preDispose

Method preDispose

Source/Engine/Graphics/GPUDevice.cpp:626–654  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

624extern void ClearVertexLayoutCache();
625
626void GPUDevice::preDispose()
627{
628 Locker.Lock();
629 RenderTargetPool::Flush();
630
631 // Release resources
632 _res->DefaultMaterial = nullptr;
633 _res->DefaultDeformableMaterial = nullptr;
634 _res->DefaultNormalMap = nullptr;
635 _res->DefaultWhiteTexture = nullptr;
636 _res->DefaultBlackTexture = nullptr;
637 SAFE_DELETE_GPU_RESOURCE(_res->PS_CopyLinear);
638 SAFE_DELETE_GPU_RESOURCE(_res->PS_Clear);
639 SAFE_DELETE_GPU_RESOURCE(_res->PS_DecodeYUY2);
640 SAFE_DELETE_GPU_RESOURCE(_res->FullscreenTriangleVB);
641 ClearVertexLayoutCache();
642
643 Locker.Unlock();
644
645 // Release GPU resources memory and unlink from device
646 // Note: after that no GPU resources should be used/created, only deleted
647 _resourcesLock.Lock();
648 for (int32 i = _resources.Count() - 1; i >= 0 && i < _resources.Count(); i--)
649 {
650 _resources[i]->OnDeviceDispose();
651 }
652 _resources.Clear();
653 _resourcesLock.Unlock();
654}
655
656void GPUDevice::DrawBegin()
657{

Callers

nothing calls this directly

Calls 7

ClearVertexLayoutCacheFunction · 0.85
LockMethod · 0.80
UnlockMethod · 0.80
FlushFunction · 0.70
CountMethod · 0.45
OnDeviceDisposeMethod · 0.45
ClearMethod · 0.45

Tested by

no test coverage detected