Files
UnrealEngineUWP/Engine/Source/Runtime/RenderCore/Private/RenderGraphResourcePool.h
Ryan Vance 7c51ff94af Merging //UE4/Dev-Main to Dev-VR (//UE4/Dev-VR)
CL 1 of 8
#rb integration

[CL 4748712 by Ryan Vance in Dev-VR branch]
2019-01-17 18:54:05 -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;