Files
UnrealEngineUWP/Engine/Source/Runtime/RenderCore/Private/RenderGraphResourcePool.h
ryan durand 0f0464a30e Updating copyright for Engine Runtime.
#rnx
#rb none


#ROBOMERGE-OWNER: ryan.durand
#ROBOMERGE-AUTHOR: ryan.durand
#ROBOMERGE-SOURCE: CL 10869210 via CL 10869511 via CL 10869900
#ROBOMERGE-BOT: (v613-10869866)

[CL 10870549 by ryan durand in Main branch]
2019-12-26 14:45:42 -05:00

46 lines
1.2 KiB
C++

// Copyright Epic Games, Inc. All Rights Reserved.
/*=============================================================================
RenderTargetPool.h: Scene render target pool manager.
=============================================================================*/
#pragma once
#include "CoreMinimal.h"
#include "RHI.h"
#include "RenderResource.h"
#include "RendererInterface.h"
#include "RenderGraphResources.h"
/**
* Pools all resources for the render graph.
*/
class RENDERCORE_API FRenderGraphResourcePool : public FRenderResource
{
public:
FRenderGraphResourcePool();
/** Allocate a buffer from a given descriptor. */
void FindFreeBuffer(
FRHICommandList& RHICmdList,
const FRDGBufferDesc& Desc,
TRefCountPtr<FPooledRDGBuffer>& Out,
const TCHAR* InDebugName);
/** Free renderer resources */
virtual void ReleaseDynamicRHI() override;
/** Call once per frame to trim elements from the pool. */
void TickPoolElements();
private:
/** Elements can be 0, we compact the buffer later. */
TArray<TRefCountPtr<FPooledRDGBuffer>> AllocatedBuffers;
uint32 FrameCounter = 0;
};
/** The global render targets for easy shading. */
extern RENDERCORE_API TGlobalResource<FRenderGraphResourcePool> GRenderGraphResourcePool;