// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#pragma once
#include "../RendererPass.h"
#include "Engine/Graphics/GPUPipelineStatePermutations.h"
///
/// Temporal Anti-Aliasing effect.
///
class TAA : public RendererPass
{
private:
AssetReference _shader;
GPUPipelineState* _psTAA;
public:
///
/// Determinates whenever this pass requires motion vectors rendering.
///
/// The rendering context.
/// True if need to render motion vectors, otherwise false.
static bool NeedMotionVectors(RenderContext& renderContext);
///
/// Performs AA pass rendering for the input task.
///
/// The rendering context.
/// The input render target.
/// The output render target.
void Render(RenderContext& renderContext, GPUTexture* input, GPUTextureView* output);
private:
#if COMPILE_WITH_DEV_ENV
void OnShaderReloading(Asset* obj)
{
_psTAA = nullptr;
invalidateResources();
}
#endif
public:
// [RendererPass]
String ToString() const override
{
return TEXT("TAA");
}
bool Init() override;
void Dispose() override;
protected:
// [RendererPass]
bool setupResources() override;
};