Files
UnrealEngineUWP/Engine/Source/Runtime/RenderCore/Private/RenderGraphResourcePool.h
Marcus Wassmer cbfcbbb93b Merging //UE4/Dev-Main@4662404 to Dev-Rendering (//UE4/Dev-Rendering)
#rb none
Should be just copyright updates

[CL 4680440 by Marcus Wassmer in Dev-Rendering branch]
2019-01-03 19:16:26 -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;