Browse Source

DX12 interface V8 experiments

master
Nico de Poel 6 days ago
parent
commit
e20c6c47ac
  1. 2
      .gitignore
  2. 5
      src/FSR3UnityPlugin.cpp
  3. 6
      src/FSR3Upscaler_DX12.h

2
.gitignore

@ -2,3 +2,5 @@
.vs/
FSR3UnityPlugin/x64/
x64/
FSR3UnityPlugin/Debug/
FSR3UnityPlugin/Release/

5
src/FSR3UnityPlugin.cpp

@ -79,7 +79,10 @@ static void UNITY_INTERFACE_API OnGraphicsDeviceEvent(UnityGfxDeviceEventType ev
return;
}
s_Upscaler = new FSR3Upscaler_DX12(s_Log, graphicsD3D12);
// Older Unity versions won't have this interface yet, so its presence is optional
auto* graphicsD3D12v8 = s_UnityInterfaces->Get<IUnityGraphicsD3D12v8>();
s_Upscaler = new FSR3Upscaler_DX12(s_Log, graphicsD3D12, graphicsD3D12v8);
UnityD3D12PluginEventConfig eventConfig{};
eventConfig.graphicsQueueAccess = kUnityD3D12GraphicsQueueAccess_DontCare;

6
src/FSR3Upscaler_DX12.h

@ -10,9 +10,10 @@
class FSR3Upscaler_DX12 : public FSR3Upscaler_FFXBase
{
public:
FSR3Upscaler_DX12(IUnityLog* log, IUnityGraphicsD3D12v7* graphicsDevice):
FSR3Upscaler_DX12(IUnityLog* log, IUnityGraphicsD3D12v7* graphicsDevice, IUnityGraphicsD3D12v8* graphicsDeviceV8):
FSR3Upscaler_FFXBase(log),
m_GraphicsDevice(graphicsDevice), m_DX12BackendDesc(), m_FrameFenceEventHandle(nullptr)
m_GraphicsDevice(graphicsDevice), m_GraphicsDeviceV8(graphicsDeviceV8),
m_DX12BackendDesc(), m_FrameFenceEventHandle(nullptr)
{
}
@ -28,6 +29,7 @@ protected:
private:
IUnityGraphicsD3D12v7* m_GraphicsDevice;
IUnityGraphicsD3D12v8* m_GraphicsDeviceV8;
ffx::CreateBackendDX12Desc m_DX12BackendDesc;
HANDLE m_FrameFenceEventHandle;
};
Loading…
Cancel
Save