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

Method Flush

Source/Engine/Graphics/RenderTargetPool.cpp:26–46  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

24}
25
26void RenderTargetPool::Flush(bool force, int32 framesOffset)
27{
28 PROFILE_CPU();
29 if (framesOffset < 0)
30 framesOffset = 3 * 60; // For how many frames RTs should be cached (by default)
31 const uint64 frameCount = Engine::FrameCount;
32 const uint64 maxReleaseFrame = frameCount - Math::Min<uint64>(frameCount, framesOffset);
33 force |= Engine::ShouldExit();
34
35 for (int32 i = 0; i < TemporaryRTs.Count(); i++)
36 {
37 const auto& e = TemporaryRTs[i];
38 if (!e.IsOccupied && (force || e.LastFrameReleased < maxReleaseFrame))
39 {
40 e.RT->DeleteObjectNow();
41 TemporaryRTs.RemoveAt(i--);
42 if (TemporaryRTs.IsEmpty())
43 break;
44 }
45 }
46}
47
48GPUTexture* RenderTargetPool::Get(const GPUTextureDescription& desc)
49{

Callers

nothing calls this directly

Calls 4

DeleteObjectNowMethod · 0.80
CountMethod · 0.45
RemoveAtMethod · 0.45
IsEmptyMethod · 0.45

Tested by

no test coverage detected