You've already forked UnrealEngineUWP
mirror of
https://github.com/izzy2lost/UnrealEngineUWP.git
synced 2026-03-26 18:15:20 -07:00
#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]
50 lines
1.4 KiB
C++
50 lines
1.4 KiB
C++
// Copyright Epic Games, Inc. All Rights Reserved.
|
|
|
|
#pragma once
|
|
|
|
#include "CoreMinimal.h"
|
|
#include "Textures/SlateShaderResource.h"
|
|
#include "RenderResource.h"
|
|
#include "RenderingThread.h"
|
|
|
|
/**
|
|
* Handle to resources used for post processing. This should not be deleted manually because it implements FDeferredCleanupInterface
|
|
*/
|
|
class FSlatePostProcessResource : public FSlateShaderResource, public FRenderResource, private FDeferredCleanupInterface
|
|
{
|
|
public:
|
|
FSlatePostProcessResource(int32 InRenderTargetCount);
|
|
~FSlatePostProcessResource();
|
|
|
|
FTexture2DRHIRef GetRenderTarget(int32 Index)
|
|
{
|
|
return RenderTargets[Index];
|
|
}
|
|
|
|
/** Performs per frame updates to this resource */
|
|
void Update(const FIntPoint& NewSize);
|
|
|
|
void CleanUp();
|
|
|
|
/** FRenderResource interface */
|
|
virtual void InitDynamicRHI() override;
|
|
virtual void ReleaseDynamicRHI() override;
|
|
|
|
/** FSlateShaderResource interface */
|
|
virtual uint32 GetWidth() const override { return RenderTargetSize.X; }
|
|
virtual uint32 GetHeight() const override { return RenderTargetSize.Y; }
|
|
virtual ESlateShaderResource::Type GetType() const override { return ESlateShaderResource::PostProcess; }
|
|
|
|
|
|
private:
|
|
/** Resizes targets to the new size */
|
|
void ResizeTargets(const FIntPoint& NewSize);
|
|
|
|
private:
|
|
TArray<FTexture2DRHIRef, TInlineAllocator<2>> RenderTargets;
|
|
EPixelFormat PixelFormat;
|
|
FIntPoint RenderTargetSize;
|
|
int32 RenderTargetCount;
|
|
};
|
|
|