You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

47 lines
1.3 KiB

#pragma once
#include "UpscalerGraphicsDevice.h"
#include "ffx_api/ffx_upscale.hpp"
#include "ffx_api/dx12/ffx_api_dx12.hpp"
#include "UnityPluginAPI/IUnityGraphicsD3D12.h"
struct FSR3Feature_DX12
{
ffx::Context upscalingContext;
uint32_t upscaleSizeWidth;
uint32_t upscaleSizeHeight;
uint32_t flags;
uint64_t dispatchFrameValue;
FSR3TextureTable textureTable;
};
class FSR3Upscaler_DX12 : UpscalerGraphicsDevice<FSR3Feature_DX12>
{
public:
FSR3Upscaler_DX12(IUnityGraphicsD3D12v7* graphicsDevice):
m_GraphicsDevice(graphicsDevice), m_DX12BackendDesc(), m_FrameFenceEventHandle(nullptr)
{
}
bool Init() override;
void Shutdown() override;
protected:
bool IsValidFeature(FSR3Feature_DX12& feature) override;
bool InitFeature(FSR3Feature_DX12& feature, const FSR3CommandInitializationData* initData) override;
void SetTexture(FSR3TextureDesc* textureDesc, UnityTextureID textureID) override;
void Execute(FSR3Feature_DX12& feature, const FSR3CommandExecutionData* execData) override;
void AwaitEndOfFrame(uint64_t frameValue) override;
void DestroyContext(FSR3Feature_DX12& feature) override;
private:
IUnityGraphicsD3D12v7* m_GraphicsDevice;
ffx::CreateBackendDX12Desc m_DX12BackendDesc;
HANDLE m_FrameFenceEventHandle;
};