Files
UnrealEngineUWP/Engine/Source/Runtime/RenderCore/Private/RenderGraphResourcePool.h
Ben Marsh 7598af0532 Update copyright notices to 2019.
#rb none
#lockdown Nick.Penwarden

[CL 4662404 by Ben Marsh in Main branch]
2018-12-14 13:41:00 -05:00

44 lines
1.2 KiB
C++

// Copyright 1998-2019 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;
/** Good to call between levels or before memory intense operations. */
void FreeUnusedResources();
private:
/** Elements can be 0, we compact the buffer later. */
TArray< TRefCountPtr<FPooledRDGBuffer> > AllocatedBuffers;
};
/** The global render targets for easy shading. */
extern RENDERCORE_API TGlobalResource<FRenderGraphResourcePool> GRenderGraphResourcePool;