// Copyright (c) 2012-2022 Wojciech Figat. All rights reserved. #pragma once #include "Textures/GPUTexture.h" /// /// Utility for pooling render target resources with reusing and sharing resources during rendering. /// API_CLASS(Static) class FLAXENGINE_API RenderTargetPool { DECLARE_SCRIPTING_TYPE_NO_SPAWN(RenderTargetPool); public: /// /// Flushes the temporary render targets. /// /// True if release unused render targets by force, otherwise will use a few frames of delay. static void Flush(bool force = false); /// /// Gets a temporary render target. /// /// The texture description. /// The allocated render target or reused one. API_FUNCTION() static GPUTexture* Get(API_PARAM(Ref) const GPUTextureDescription& desc); /// /// Releases a temporary render target. /// /// The reference to temporary target to release. API_FUNCTION() static void Release(GPUTexture* rt); };