auto ue fixes corrected

This commit is contained in:
cdozdil
2024-03-09 23:43:56 +03:00
parent ed9ff56867
commit 8d64e4e513
43 changed files with 156 additions and 134 deletions
+1
View File
@@ -1,3 +1,4 @@
#pragma once
#include "pch.h"
#include "Config.h"
#include <SimpleIni.h>
+2 -12
View File
@@ -11,15 +11,6 @@ typedef enum NVNGX_EngineType
NVNGX_ENGINE_COUNT
} NVNGX_EngineType;
typedef enum GPU_Vendor
{
AMD = 0,
NVIDIA,
INTEL,
OTHER,
} GPU_Vendor;
class Config
{
public:
@@ -84,9 +75,8 @@ public:
std::optional<std::string> VulkanUpscaler;
// Engine Info
NVNGX_EngineType NVNGX_Engine;
const char* NVNGX_EngineVersion;
const wchar_t* NVNGX_AppDataPath;
NVNGX_EngineType NVNGX_Engine = NVNGX_ENGINE_TYPE_CUSTOM;
bool NVNGX_EngineVersion5 = false;
void Reload();
+3 -3
View File
@@ -82,7 +82,7 @@
<IncludePath>$(SolutionDir)external\vulkan\include;$(SolutionDir)external\nvngx_dlss_sdk;$(SolutionDir)external\xess\inc\xess;$(SolutionDir)CyberXeSS\fsr2\include;$(SolutionDir)external\simpleini;$(SolutionDir)external\unordered_dense\include;$(SolutionDir)external\spdlog\include;C:\Program Files %28x86%29\Microsoft DirectX SDK %28June 2010%29\Include;$(IncludePath)</IncludePath>
<LibraryPath>$(SolutionDir)CyberXess\fsr2\lib;$(SolutionDir)CyberXess\vulkan;$(SolutionDir)external\xess\lib;C:\Program Files %28x86%29\Microsoft DirectX SDK %28June 2010%29\Lib\x64;$(LibraryPath)</LibraryPath>
<TargetName>nvngx</TargetName>
<OutDir>..\..\God of War</OutDir>
<OutDir>..\..\..\Games\Banishers Ghosts of New Eden\NWD\Binaries\Win64</OutDir>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<IncludePath>$(SolutionDir)external\vulkan\include;$(SolutionDir)external\nvngx_dlss_sdk;$(SolutionDir)external\xess\inc\xess;$(SolutionDir)CyberXeSS\fsr2\include;$(SolutionDir)external\simpleini;$(SolutionDir)external\unordered_dense\include;$(SolutionDir)external\spdlog\include;C:\Program Files %28x86%29\Microsoft DirectX SDK %28June 2010%29\Include;$(IncludePath)</IncludePath>
@@ -141,7 +141,7 @@
<SubSystem>Windows</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
<EnableUAC>false</EnableUAC>
<AdditionalDependencies>d3d11.lib;dxgi.lib;d3d12.lib;dxguid.lib;libxess.lib;vulkan-1.lib;ffx_fsr2_api_x64d.lib;ffx_fsr2_api_dx11_x64d.lib;ffx_fsr2_api_dx12_x64d.lib;ffx_fsr2_api_vk_x64d.lib;%(AdditionalDependencies)</AdditionalDependencies>
<AdditionalDependencies>dxgi.lib;d3d11.lib;d3d12.lib;vulkan-1.lib;dxguid.lib;libxess.lib;ffx_fsr2_api_x64d.lib;ffx_fsr2_api_dx11_x64d.lib;ffx_fsr2_api_dx12_x64d.lib;ffx_fsr2_api_vk_x64d.lib;%(AdditionalDependencies)</AdditionalDependencies>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
@@ -202,8 +202,8 @@ copy $(SolutionDir)nvngx.ini $(SolutionDir)x64\Release\a\</Command>
<ClCompile Include="IFeature_Dx12.cpp" />
<ClCompile Include="NVNGX_DLSS_Dx11.cpp" />
<ClCompile Include="NVNGX_DLSS_Dx12.cpp" />
<ClCompile Include="NVNGX_DLSS_Vk.cpp" />
<ClCompile Include="dllmain.cpp" />
<ClCompile Include="NVNGX_DLSS_Vk.cpp" />
<ClCompile Include="XeSSFeature.cpp" />
<ClCompile Include="XeSSFeature.h" />
<ClCompile Include="XeSSFeature_Dx11.cpp" />
+10 -13
View File
@@ -65,26 +65,20 @@
<ClInclude Include="FSR2Feature.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="dllmain.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="FSR2Feature_Vk.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="FSR2Feature_Dx11.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="FSR2Feature_Dx12.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="FSR2Feature_Vk.h">
<Filter>Header Files</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
<ClCompile Include="Config.cpp">
<Filter>Config</Filter>
</ClCompile>
<ClCompile Include="NVNGX_DLSS_Vk.cpp">
<Filter>NVNGX</Filter>
</ClCompile>
<ClCompile Include="XeSSFeature.cpp">
<Filter>XeSS</Filter>
</ClCompile>
@@ -113,10 +107,13 @@
<ClCompile Include="XeSSFeature_Dx11.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="FSR2Feature.cpp">
<ClCompile Include="NVNGX_DLSS_Dx12.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="FSR2Feature_Vk.cpp">
<ClCompile Include="NVNGX_DLSS_Dx11.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="FSR2Feature.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="FSR2Feature_Dx11.cpp">
@@ -125,10 +122,10 @@
<ClCompile Include="FSR2Feature_Dx12.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="NVNGX_DLSS_Dx11.cpp">
<ClCompile Include="FSR2Feature_Vk.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="NVNGX_DLSS_Dx12.cpp">
<ClCompile Include="NVNGX_DLSS_Vk.cpp">
<Filter>Source Files</Filter>
</ClCompile>
</ItemGroup>
+1
View File
@@ -1,3 +1,4 @@
#pragma once
#include "pch.h"
#include "FSR2Feature.h"
#include "Config.h"
+2 -1
View File
@@ -1,7 +1,8 @@
#pragma once
#include "IFeature.h"
#include <ffx_fsr2.h>
#include "IFeature.h"
inline static std::string ResultToString(FfxErrorCode result)
{
switch (result)
+1
View File
@@ -1,3 +1,4 @@
#pragma once
#include "pch.h"
#include "FSR2Feature_Dx11.h"
#include "Config.h"
+3 -2
View File
@@ -1,3 +1,4 @@
#pragma once
#include "pch.h"
#include "FSR2Feature_Dx12.h"
#include "Config.h"
@@ -52,7 +53,7 @@ bool FSR2FeatureDx12::Evaluate(ID3D12GraphicsCommandList* InCommandList, const N
}
else if (Config::Instance()->NVNGX_Engine == NVNGX_ENGINE_TYPE_UNREAL)
{
Config::Instance()->ColorResourceBarrier = (int)D3D12_RESOURCE_STATE_NON_PIXEL_SHADER_RESOURCE;
Config::Instance()->ColorResourceBarrier = (int)D3D12_RESOURCE_STATE_RENDER_TARGET;
ResourceBarrier(InCommandList, paramColor,
D3D12_RESOURCE_STATE_RENDER_TARGET,
@@ -232,7 +233,7 @@ bool FSR2FeatureDx12::Evaluate(ID3D12GraphicsCommandList* InCommandList, const N
}
// restore resource states
if (paramColor && (Config::Instance()->ColorResourceBarrier.value_or(false) || Config::Instance()->NVNGX_Engine == NVNGX_ENGINE_TYPE_UNREAL))
if (paramColor && Config::Instance()->ColorResourceBarrier.has_value())
ResourceBarrier(InCommandList, paramColor,
D3D12_RESOURCE_STATE_NON_PIXEL_SHADER_RESOURCE,
(D3D12_RESOURCE_STATES)Config::Instance()->ColorResourceBarrier.value());
+1
View File
@@ -1,3 +1,4 @@
#pragma once
#include "FSR2Feature.h"
#include "IFeature_Dx12.h"
+1 -1
View File
@@ -1,8 +1,8 @@
#pragma once
#include "pch.h"
#include "FSR2Feature_Vk.h"
#include "Config.h"
#include <vulkan/vulkan.hpp>
#include "nvsdk_ngx_vk.h"
bool FSR2FeatureVk::InitFSR2(const NVSDK_NGX_Parameter* InParameters)
+1
View File
@@ -1,3 +1,4 @@
#pragma once
#include <vulkan/vulkan.hpp>
#include <ffx_fsr2.h>
+1
View File
@@ -1,3 +1,4 @@
#pragma once
#include "pch.h"
#include "IFeature.h"
+1
View File
@@ -1,3 +1,4 @@
#pragma once
#include "IFeature_Dx12.h"
void IFeature_Dx12::ResourceBarrier(ID3D12GraphicsCommandList* commandList, ID3D12Resource* resource, D3D12_RESOURCE_STATES beforeState, D3D12_RESOURCE_STATES afterState)
+24 -17
View File
@@ -1,3 +1,4 @@
#pragma once
#include "pch.h"
#include <ankerl/unordered_dense.h>
@@ -39,12 +40,15 @@ NVSDK_NGX_API NVSDK_NGX_Result NVSDK_NGX_D3D11_Init_ProjectID(const char* InProj
{
spdlog::debug("NVSDK_NGX_D3D11_Init_ProjectID InProjectId: {0}", InProjectId);
spdlog::debug("NVSDK_NGX_D3D11_Init_ProjectID InEngineType: {0}", (int)InEngineType);
spdlog::debug("NVSDK_NGX_D3D11_Init_ProjectID InEngineVersion: {0}", InEngineVersion);
Config::Instance()->NVNGX_Engine = (NVNGX_EngineType)InEngineType;
Config::Instance()->NVNGX_EngineVersion = InEngineVersion;
Config::Instance()->NVNGX_AppDataPath = InApplicationDataPath;
if (Config::Instance()->NVNGX_Engine == NVNGX_ENGINE_TYPE_UNREAL && InEngineVersion)
{
spdlog::debug("NVSDK_NGX_D3D11_Init_ProjectID InEngineVersion: {0}", InEngineVersion);
Config::Instance()->NVNGX_EngineVersion5 = InEngineVersion[0] == '5';
}
return NVSDK_NGX_D3D11_Init_Ext(0x1337, InApplicationDataPath, InDevice, InFeatureInfo, InSDKVersion, 0);
}
@@ -53,11 +57,14 @@ NVSDK_NGX_API NVSDK_NGX_Result NVSDK_NGX_D3D11_Init_with_ProjectID(const char* I
{
spdlog::debug("NVSDK_NGX_D3D11_Init_with_ProjectID InProjectId: {0}", InProjectId);
spdlog::debug("NVSDK_NGX_D3D11_Init_with_ProjectID InEngineType: {0}", (int)InEngineType);
spdlog::debug("NVSDK_NGX_D3D11_Init_with_ProjectID InEngineVersion: {0}", InEngineVersion);
Config::Instance()->NVNGX_Engine = (NVNGX_EngineType)InEngineType;
Config::Instance()->NVNGX_EngineVersion = InEngineVersion;
Config::Instance()->NVNGX_AppDataPath = InApplicationDataPath;
if (Config::Instance()->NVNGX_Engine == NVNGX_ENGINE_TYPE_UNREAL && InEngineVersion)
{
spdlog::debug("NVSDK_NGX_D3D11_Init_with_ProjectID InEngineVersion: {0}", InEngineVersion);
Config::Instance()->NVNGX_EngineVersion5 = InEngineVersion[0] == '5';
}
return NVSDK_NGX_D3D11_Init_Ext(0x1337, InApplicationDataPath, InDevice, InFeatureInfo, InSDKVersion, 0);
}
@@ -66,7 +73,7 @@ NVSDK_NGX_API NVSDK_NGX_Result NVSDK_NGX_D3D11_Init_with_ProjectID(const char* I
#pragma region NVSDK_NGX_D3D11_Shutdown
NVSDK_NGX_Result NVSDK_CONV NVSDK_NGX_D3D11_Shutdown(void)
NVSDK_NGX_API NVSDK_NGX_Result NVSDK_NGX_D3D11_Shutdown(void)
{
spdlog::info("NVSDK_NGX_D3D11_Shutdown");
@@ -79,7 +86,7 @@ NVSDK_NGX_Result NVSDK_CONV NVSDK_NGX_D3D11_Shutdown(void)
return NVSDK_NGX_Result_Success;
}
NVSDK_NGX_Result NVSDK_CONV NVSDK_NGX_D3D11_Shutdown1(ID3D11Device* InDevice)
NVSDK_NGX_API NVSDK_NGX_Result NVSDK_NGX_D3D11_Shutdown1(ID3D11Device* InDevice)
{
spdlog::info("NVSDK_NGX_D3D11_Shutdown1");
return NVSDK_NGX_D3D11_Shutdown();
@@ -89,7 +96,7 @@ NVSDK_NGX_Result NVSDK_CONV NVSDK_NGX_D3D11_Shutdown1(ID3D11Device* InDevice)
#pragma region NVSDK_NGX_D3D11 Parameters
NVSDK_NGX_Result NVSDK_NGX_D3D11_GetParameters(NVSDK_NGX_Parameter** OutParameters)
NVSDK_NGX_API NVSDK_NGX_Result NVSDK_NGX_D3D11_GetParameters(NVSDK_NGX_Parameter** OutParameters)
{
spdlog::debug("NVSDK_NGX_D3D11_GetParameters");
@@ -105,7 +112,7 @@ NVSDK_NGX_Result NVSDK_NGX_D3D11_GetParameters(NVSDK_NGX_Parameter** OutParamete
}
}
NVSDK_NGX_Result NVSDK_NGX_D3D11_GetCapabilityParameters(NVSDK_NGX_Parameter** OutParameters)
NVSDK_NGX_API NVSDK_NGX_Result NVSDK_NGX_D3D11_GetCapabilityParameters(NVSDK_NGX_Parameter** OutParameters)
{
spdlog::debug("NVSDK_NGX_D3D11_GetCapabilityParameters");
@@ -121,7 +128,7 @@ NVSDK_NGX_Result NVSDK_NGX_D3D11_GetCapabilityParameters(NVSDK_NGX_Parameter** O
}
}
NVSDK_NGX_Result NVSDK_NGX_D3D11_AllocateParameters(NVSDK_NGX_Parameter** OutParameters)
NVSDK_NGX_API NVSDK_NGX_Result NVSDK_NGX_D3D11_AllocateParameters(NVSDK_NGX_Parameter** OutParameters)
{
spdlog::debug("NVSDK_NGX_D3D11_AllocateParameters");
@@ -151,7 +158,7 @@ NVSDK_NGX_API NVSDK_NGX_Result NVSDK_NGX_D3D11_PopulateParameters_Impl(NVSDK_NGX
return NVSDK_NGX_Result_Success;
}
NVSDK_NGX_Result NVSDK_NGX_D3D11_DestroyParameters(NVSDK_NGX_Parameter* InParameters)
NVSDK_NGX_API NVSDK_NGX_Result NVSDK_NGX_D3D11_DestroyParameters(NVSDK_NGX_Parameter* InParameters)
{
spdlog::debug("NVSDK_NGX_D3D11_DestroyParameters");
@@ -163,7 +170,7 @@ NVSDK_NGX_Result NVSDK_NGX_D3D11_DestroyParameters(NVSDK_NGX_Parameter* InParame
return NVSDK_NGX_Result_Success;
}
NVSDK_NGX_Result NVSDK_NGX_D3D11_GetScratchBufferSize(NVSDK_NGX_Feature InFeatureId, const NVSDK_NGX_Parameter* InParameters, size_t* OutSizeInBytes)
NVSDK_NGX_API NVSDK_NGX_Result NVSDK_NGX_D3D11_GetScratchBufferSize(NVSDK_NGX_Feature InFeatureId, const NVSDK_NGX_Parameter* InParameters, size_t* OutSizeInBytes)
{
spdlog::warn("NVSDK_NGX_D3D11_GetScratchBufferSize -> 52428800");
*OutSizeInBytes = 52428800;
@@ -174,7 +181,7 @@ NVSDK_NGX_Result NVSDK_NGX_D3D11_GetScratchBufferSize(NVSDK_NGX_Feature InFeatur
#pragma region NVSDK_NGX_D3D11 Feature
NVSDK_NGX_Result NVSDK_NGX_D3D11_CreateFeature(ID3D11DeviceContext* InDevCtx, NVSDK_NGX_Feature InFeatureID, NVSDK_NGX_Parameter* InParameters, NVSDK_NGX_Handle** OutHandle)
NVSDK_NGX_API NVSDK_NGX_Result NVSDK_NGX_D3D11_CreateFeature(ID3D11DeviceContext* InDevCtx, NVSDK_NGX_Feature InFeatureID, NVSDK_NGX_Parameter* InParameters, NVSDK_NGX_Handle** OutHandle)
{
spdlog::info("NVSDK_NGX_D3D11_CreateFeature");
@@ -214,7 +221,7 @@ NVSDK_NGX_Result NVSDK_NGX_D3D11_CreateFeature(ID3D11DeviceContext* InDevCtx, NV
return NVSDK_NGX_Result_Fail;
}
NVSDK_NGX_Result NVSDK_NGX_D3D11_ReleaseFeature(NVSDK_NGX_Handle* InHandle)
NVSDK_NGX_API NVSDK_NGX_Result NVSDK_NGX_D3D11_ReleaseFeature(NVSDK_NGX_Handle* InHandle)
{
spdlog::info("NVSDK_NGX_D3D11_ReleaseFeature");
@@ -232,7 +239,7 @@ NVSDK_NGX_Result NVSDK_NGX_D3D11_ReleaseFeature(NVSDK_NGX_Handle* InHandle)
return NVSDK_NGX_Result_Success;
}
NVSDK_NGX_Result NVSDK_NGX_D3D11_GetFeatureRequirements(IDXGIAdapter* Adapter, const NVSDK_NGX_FeatureDiscoveryInfo* FeatureDiscoveryInfo, NVSDK_NGX_FeatureRequirement* OutSupported)
NVSDK_NGX_API NVSDK_NGX_Result NVSDK_NGX_D3D11_GetFeatureRequirements(IDXGIAdapter* Adapter, const NVSDK_NGX_FeatureDiscoveryInfo* FeatureDiscoveryInfo, NVSDK_NGX_FeatureRequirement* OutSupported)
{
spdlog::debug("NVSDK_NGX_D3D11_GetFeatureRequirements");
@@ -245,7 +252,7 @@ NVSDK_NGX_Result NVSDK_NGX_D3D11_GetFeatureRequirements(IDXGIAdapter* Adapter, c
return NVSDK_NGX_Result_Success;
}
NVSDK_NGX_Result NVSDK_NGX_D3D11_EvaluateFeature(ID3D11DeviceContext* InDevCtx, const NVSDK_NGX_Handle* InFeatureHandle, const NVSDK_NGX_Parameter* InParameters, PFN_NVSDK_NGX_ProgressCallback InCallback)
NVSDK_NGX_API NVSDK_NGX_Result NVSDK_NGX_D3D11_EvaluateFeature(ID3D11DeviceContext* InDevCtx, const NVSDK_NGX_Handle* InFeatureHandle, const NVSDK_NGX_Parameter* InParameters, PFN_NVSDK_NGX_ProgressCallback InCallback)
{
spdlog::debug("NVSDK_NGX_D3D11_EvaluateFeature Handle: {0}", InFeatureHandle->Id);
+18 -12
View File
@@ -1,3 +1,4 @@
#pragma once
#include "pch.h"
#include <ankerl/unordered_dense.h>
@@ -20,8 +21,7 @@ NVSDK_NGX_API NVSDK_NGX_Result NVSDK_NGX_D3D12_Init_Ext(unsigned long long InApp
spdlog::info("NVSDK_NGX_D3D12_Init_Ext SDK: {0:x}", (int)InSDKVersion);
std::wstring string(InApplicationDataPath);
std::string str(string.begin(), string.end());
spdlog::debug("NVSDK_NGX_D3D12_Init_Ext InApplicationDataPath {0}", str);
spdlog::info("NVSDK_NGX_D3D12_Init_Ext InApplicationDataPath {0}", str);
return NVSDK_NGX_Result_Success;
}
@@ -36,13 +36,16 @@ NVSDK_NGX_API NVSDK_NGX_Result NVSDK_NGX_D3D12_Init(unsigned long long InApplica
NVSDK_NGX_API NVSDK_NGX_Result NVSDK_NGX_D3D12_Init_ProjectID(const char* InProjectId, NVSDK_NGX_EngineType InEngineType,
const char* InEngineVersion, const wchar_t* InApplicationDataPath, ID3D12Device* InDevice, const NVSDK_NGX_FeatureCommonInfo* InFeatureInfo, NVSDK_NGX_Version InSDKVersion)
{
spdlog::debug("NVSDK_NGX_D3D12_Init_ProjectID InProjectId: {0}", InProjectId);
spdlog::debug("NVSDK_NGX_D3D12_Init_ProjectID InEngineType: {0}", (int)InEngineType);
spdlog::debug("NVSDK_NGX_D3D12_Init_ProjectID InEngineVersion: {0}", InEngineVersion);
spdlog::info("NVSDK_NGX_D3D12_Init_ProjectID InProjectId: {0}", InProjectId);
spdlog::info("NVSDK_NGX_D3D12_Init_ProjectID InEngineType: {0}", (int)InEngineType);
Config::Instance()->NVNGX_Engine = (NVNGX_EngineType)InEngineType;
Config::Instance()->NVNGX_EngineVersion = InEngineVersion;
Config::Instance()->NVNGX_AppDataPath = InApplicationDataPath;
if (Config::Instance()->NVNGX_Engine == NVNGX_ENGINE_TYPE_UNREAL && InEngineVersion)
{
spdlog::debug("NVSDK_NGX_D3D12_Init_ProjectID InEngineVersion: {0}", InEngineVersion);
Config::Instance()->NVNGX_EngineVersion5 = InEngineVersion[0] == '5';
}
return NVSDK_NGX_D3D12_Init_Ext(0x1337, InApplicationDataPath, InDevice, InFeatureInfo, InSDKVersion, 0);
}
@@ -50,13 +53,16 @@ NVSDK_NGX_API NVSDK_NGX_Result NVSDK_NGX_D3D12_Init_ProjectID(const char* InProj
NVSDK_NGX_API NVSDK_NGX_Result NVSDK_NGX_D3D12_Init_with_ProjectID(const char* InProjectId, NVSDK_NGX_EngineType InEngineType, const char* InEngineVersion,
const wchar_t* InApplicationDataPath, ID3D12Device* InDevice, const NVSDK_NGX_FeatureCommonInfo* InFeatureInfo, NVSDK_NGX_Version InSDKVersion)
{
spdlog::debug("NVSDK_NGX_D3D12_Init_with_ProjectID InProjectId: {0}", InProjectId);
spdlog::debug("NVSDK_NGX_D3D12_Init_with_ProjectID InEngineType: {0}", (int)InEngineType);
spdlog::debug("NVSDK_NGX_D3D12_Init_with_ProjectID InEngineVersion: {0}", InEngineVersion);
spdlog::info("NVSDK_NGX_D3D12_Init_with_ProjectID InProjectId: {0}", InProjectId);
spdlog::info("NVSDK_NGX_D3D12_Init_with_ProjectID InEngineType: {0}", (int)InEngineType);
Config::Instance()->NVNGX_Engine = (NVNGX_EngineType)InEngineType;
Config::Instance()->NVNGX_EngineVersion = InEngineVersion;
Config::Instance()->NVNGX_AppDataPath = InApplicationDataPath;
if (Config::Instance()->NVNGX_Engine == NVNGX_ENGINE_TYPE_UNREAL && InEngineVersion)
{
spdlog::debug("NVSDK_NGX_D3D12_Init_with_ProjectID InEngineVersion: {0}", InEngineVersion);
Config::Instance()->NVNGX_EngineVersion5 = InEngineVersion[0] == '5';
}
return NVSDK_NGX_D3D12_Init_Ext(0x1337, InApplicationDataPath, InDevice, InFeatureInfo, InSDKVersion, 0);
}
+32 -22
View File
@@ -1,3 +1,4 @@
#pragma once
#include "pch.h"
#include <ankerl/unordered_dense.h>
@@ -15,7 +16,7 @@ PFN_vkGetDeviceProcAddr vkGDPA;
static inline ankerl::unordered_dense::map <unsigned int, std::unique_ptr<IFeature_Vk>> VkContexts;
NVSDK_NGX_API NVSDK_NGX_Result NVSDK_NGX_VULKAN_Init(unsigned long long InApplicationId, const wchar_t* InApplicationDataPath, VkInstance InInstance, VkPhysicalDevice InPD,
NVSDK_NGX_API NVSDK_NGX_Result NVSDK_NGX_VULKAN_Init(unsigned long long InApplicationId, const wchar_t* InApplicationDataPath, VkInstance InInstance, VkPhysicalDevice InPD,
VkDevice InDevice, PFN_vkGetInstanceProcAddr InGIPA, PFN_vkGetDeviceProcAddr InGDPA, const NVSDK_NGX_FeatureCommonInfo* InFeatureInfo, NVSDK_NGX_Version InSDKVersion)
{
spdlog::info("NVSDK_NGX_VULKAN_Init InApplicationId: {0}", InApplicationId);
@@ -57,32 +58,41 @@ NVSDK_NGX_API NVSDK_NGX_Result NVSDK_NGX_VULKAN_Init(unsigned long long InApplic
return NVSDK_NGX_Result_Success;
}
NVSDK_NGX_API NVSDK_NGX_Result NVSDK_NGX_VULKAN_Init_ProjectID(const char* InProjectId, NVSDK_NGX_EngineType InEngineType, const char* InEngineVersion,
const wchar_t* InApplicationDataPath, VkInstance InInstance, VkPhysicalDevice InPD, VkDevice InDevice, PFN_vkGetInstanceProcAddr InGIPA, PFN_vkGetDeviceProcAddr InGDPA,
NVSDK_NGX_API NVSDK_NGX_Result NVSDK_NGX_VULKAN_Init_ProjectID(const char* InProjectId, NVSDK_NGX_EngineType InEngineType, const char* InEngineVersion,
const wchar_t* InApplicationDataPath, VkInstance InInstance, VkPhysicalDevice InPD, VkDevice InDevice, PFN_vkGetInstanceProcAddr InGIPA, PFN_vkGetDeviceProcAddr InGDPA,
const NVSDK_NGX_FeatureCommonInfo* InFeatureInfo, NVSDK_NGX_Version InSDKVersion)
{
spdlog::debug("NVSDK_NGX_VULKAN_Init_ProjectID InProjectId: {0}", InProjectId);
spdlog::debug("NVSDK_NGX_VULKAN_Init_ProjectID InEngineType: {0}", (int)InEngineType);
spdlog::debug("NVSDK_NGX_VULKAN_Init_ProjectID InEngineVersion: {0}", InEngineVersion);
Config::Instance()->NVNGX_Engine = (NVNGX_EngineType)InEngineType;
Config::Instance()->NVNGX_EngineVersion = InEngineVersion;
Config::Instance()->NVNGX_AppDataPath = InApplicationDataPath;
if (Config::Instance()->NVNGX_Engine == NVNGX_ENGINE_TYPE_UNREAL && InEngineVersion)
{
spdlog::debug("NVSDK_NGX_VULKAN_Init_ProjectID InEngineVersion: {0}", InEngineVersion);
Config::Instance()->NVNGX_EngineVersion5 = InEngineVersion[0] == '5';
}
return NVSDK_NGX_VULKAN_Init(0x1337, InApplicationDataPath, InInstance, InPD, InDevice, InGIPA, InGDPA, InFeatureInfo, InSDKVersion);
}
NVSDK_NGX_API NVSDK_NGX_Result NVSDK_NGX_VULKAN_Init_with_ProjectID(const char* InProjectId, NVSDK_NGX_EngineType InEngineType, const char* InEngineVersion,
const wchar_t* InApplicationDataPath, VkInstance InInstance, VkPhysicalDevice InPD, VkDevice InDevice, PFN_vkGetInstanceProcAddr InGIPA, PFN_vkGetDeviceProcAddr InGDPA,
NVSDK_NGX_API NVSDK_NGX_Result NVSDK_NGX_VULKAN_Init_with_ProjectID(const char* InProjectId, NVSDK_NGX_EngineType InEngineType, const char* InEngineVersion,
const wchar_t* InApplicationDataPath, VkInstance InInstance, VkPhysicalDevice InPD, VkDevice InDevice, PFN_vkGetInstanceProcAddr InGIPA, PFN_vkGetDeviceProcAddr InGDPA,
const NVSDK_NGX_FeatureCommonInfo* InFeatureInfo, NVSDK_NGX_Version InSDKVersion)
{
spdlog::debug("NVSDK_NGX_VULKAN_Init_with_ProjectID InProjectId: {0}", InProjectId);
spdlog::debug("NVSDK_NGX_VULKAN_Init_with_ProjectID InEngineType {0}", (int)InEngineType);
spdlog::debug("NVSDK_NGX_VULKAN_Init_with_ProjectID InEngineVersion: {0}", InEngineVersion);
Config::Instance()->NVNGX_Engine = (NVNGX_EngineType)InEngineType;
Config::Instance()->NVNGX_EngineVersion = InEngineVersion;
Config::Instance()->NVNGX_AppDataPath = InApplicationDataPath;
if (Config::Instance()->NVNGX_Engine == NVNGX_ENGINE_TYPE_UNREAL && InEngineVersion)
{
spdlog::debug("NVSDK_NGX_VULKAN_Init_with_ProjectID InEngineVersion: {0}", InEngineVersion);
Config::Instance()->NVNGX_EngineVersion5 = InEngineVersion[0] == '5';
}
Config::Instance()->NVNGX_Engine = (NVNGX_EngineType)InEngineType;
Config::Instance()->NVNGX_EngineVersion5 = InEngineVersion;
return NVSDK_NGX_VULKAN_Init(0x1337, InApplicationDataPath, InInstance, InPD, InDevice, InGIPA, InGDPA, InFeatureInfo, InSDKVersion);
}
@@ -103,7 +113,7 @@ NVSDK_NGX_API NVSDK_NGX_Result NVSDK_NGX_VULKAN_GetParameters(NVSDK_NGX_Paramete
}
}
NVSDK_NGX_API NVSDK_NGX_Result NVSDK_CONV NVSDK_NGX_VULKAN_AllocateParameters(NVSDK_NGX_Parameter** OutParameters)
NVSDK_NGX_API NVSDK_NGX_Result NVSDK_NGX_VULKAN_AllocateParameters(NVSDK_NGX_Parameter** OutParameters)
{
spdlog::debug("NVSDK_NGX_VULKAN_AllocateParameters");
@@ -119,7 +129,7 @@ NVSDK_NGX_API NVSDK_NGX_Result NVSDK_CONV NVSDK_NGX_VULKAN_AllocateParameters(NV
}
}
NVSDK_NGX_API NVSDK_NGX_Result NVSDK_CONV NVSDK_NGX_VULKAN_GetCapabilityParameters(NVSDK_NGX_Parameter** OutParameters)
NVSDK_NGX_API NVSDK_NGX_Result NVSDK_NGX_VULKAN_GetCapabilityParameters(NVSDK_NGX_Parameter** OutParameters)
{
spdlog::debug("NVSDK_NGX_VULKAN_GetCapabilityParameters");
@@ -147,7 +157,7 @@ NVSDK_NGX_API NVSDK_NGX_Result NVSDK_NGX_VULKAN_PopulateParameters_Impl(NVSDK_NG
return NVSDK_NGX_Result_Success;
}
NVSDK_NGX_API NVSDK_NGX_Result NVSDK_CONV NVSDK_NGX_VULKAN_DestroyParameters(NVSDK_NGX_Parameter* InParameters)
NVSDK_NGX_API NVSDK_NGX_Result NVSDK_NGX_VULKAN_DestroyParameters(NVSDK_NGX_Parameter* InParameters)
{
spdlog::debug("NVSDK_NGX_VULKAN_DestroyParameters");
@@ -159,7 +169,7 @@ NVSDK_NGX_API NVSDK_NGX_Result NVSDK_CONV NVSDK_NGX_VULKAN_DestroyParameters(NVS
return NVSDK_NGX_Result_Success;
}
NVSDK_NGX_API NVSDK_NGX_Result NVSDK_CONV NVSDK_NGX_VULKAN_GetScratchBufferSize(NVSDK_NGX_Feature InFeatureId, const NVSDK_NGX_Parameter* InParameters, size_t* OutSizeInBytes)
NVSDK_NGX_API NVSDK_NGX_Result NVSDK_NGX_VULKAN_GetScratchBufferSize(NVSDK_NGX_Feature InFeatureId, const NVSDK_NGX_Parameter* InParameters, size_t* OutSizeInBytes)
{
spdlog::debug("NVSDK_NGX_VULKAN_GetScratchBufferSize -> 52428800");
@@ -167,7 +177,7 @@ NVSDK_NGX_API NVSDK_NGX_Result NVSDK_CONV NVSDK_NGX_VULKAN_GetScratchBufferSize(
return NVSDK_NGX_Result_Success;
}
NVSDK_NGX_API NVSDK_NGX_Result NVSDK_CONV NVSDK_NGX_VULKAN_CreateFeature1(VkDevice InDevice, VkCommandBuffer InCmdList, NVSDK_NGX_Feature InFeatureID, NVSDK_NGX_Parameter* InParameters, NVSDK_NGX_Handle** OutHandle)
NVSDK_NGX_API NVSDK_NGX_Result NVSDK_NGX_VULKAN_CreateFeature1(VkDevice InDevice, VkCommandBuffer InCmdList, NVSDK_NGX_Feature InFeatureID, NVSDK_NGX_Parameter* InParameters, NVSDK_NGX_Handle** OutHandle)
{
spdlog::info("NVSDK_NGX_VULKAN_CreateFeature1");
@@ -192,14 +202,14 @@ NVSDK_NGX_API NVSDK_NGX_Result NVSDK_CONV NVSDK_NGX_VULKAN_CreateFeature1(VkDevi
return NVSDK_NGX_Result_FAIL_PlatformError;
}
NVSDK_NGX_API NVSDK_NGX_Result NVSDK_CONV NVSDK_NGX_VULKAN_CreateFeature(VkCommandBuffer InCmdBuffer, NVSDK_NGX_Feature InFeatureID, NVSDK_NGX_Parameter* InParameters, NVSDK_NGX_Handle** OutHandle)
NVSDK_NGX_API NVSDK_NGX_Result NVSDK_NGX_VULKAN_CreateFeature(VkCommandBuffer InCmdBuffer, NVSDK_NGX_Feature InFeatureID, NVSDK_NGX_Parameter* InParameters, NVSDK_NGX_Handle** OutHandle)
{
spdlog::info("NVSDK_NGX_VULKAN_CreateFeature");
return NVSDK_NGX_VULKAN_CreateFeature1(vkDevice, InCmdBuffer, InFeatureID, InParameters, OutHandle);
}
NVSDK_NGX_API NVSDK_NGX_Result NVSDK_CONV NVSDK_NGX_VULKAN_ReleaseFeature(NVSDK_NGX_Handle* InHandle)
NVSDK_NGX_API NVSDK_NGX_Result NVSDK_NGX_VULKAN_ReleaseFeature(NVSDK_NGX_Handle* InHandle)
{
spdlog::debug("NVSDK_NGX_VULKAN_ReleaseFeature");
@@ -217,7 +227,7 @@ NVSDK_NGX_API NVSDK_NGX_Result NVSDK_CONV NVSDK_NGX_VULKAN_ReleaseFeature(NVSDK_
return NVSDK_NGX_Result_Success;
}
NVSDK_NGX_API NVSDK_NGX_Result NVSDK_CONV NVSDK_NGX_VULKAN_EvaluateFeature(VkCommandBuffer InCmdList, const NVSDK_NGX_Handle* InFeatureHandle, const NVSDK_NGX_Parameter* InParameters, PFN_NVSDK_NGX_ProgressCallback InCallback)
NVSDK_NGX_API NVSDK_NGX_Result NVSDK_NGX_VULKAN_EvaluateFeature(VkCommandBuffer InCmdList, const NVSDK_NGX_Handle* InFeatureHandle, const NVSDK_NGX_Parameter* InParameters, PFN_NVSDK_NGX_ProgressCallback InCallback)
{
spdlog::debug("NVSDK_NGX_VULKAN_EvaluateFeature");
@@ -238,7 +248,7 @@ NVSDK_NGX_API NVSDK_NGX_Result NVSDK_CONV NVSDK_NGX_VULKAN_EvaluateFeature(VkCom
return NVSDK_NGX_Result_Fail;
}
NVSDK_NGX_API NVSDK_NGX_Result NVSDK_CONV NVSDK_NGX_VULKAN_Shutdown(void)
NVSDK_NGX_API NVSDK_NGX_Result NVSDK_NGX_VULKAN_Shutdown(void)
{
spdlog::debug("NVSDK_NGX_VULKAN_Shutdown");
@@ -254,7 +264,7 @@ NVSDK_NGX_API NVSDK_NGX_Result NVSDK_CONV NVSDK_NGX_VULKAN_Shutdown(void)
return NVSDK_NGX_Result_Success;
}
NVSDK_NGX_API NVSDK_NGX_Result NVSDK_CONV NVSDK_NGX_VULKAN_Shutdown1(VkDevice InDevice)
NVSDK_NGX_API NVSDK_NGX_Result NVSDK_NGX_VULKAN_Shutdown1(VkDevice InDevice)
{
spdlog::debug("NVSDK_NGX_VULKAN_Shutdown1");
return NVSDK_NGX_VULKAN_Shutdown();
+4 -8
View File
@@ -91,8 +91,7 @@ inline NVSDK_NGX_Result NVSDK_CONV NVSDK_NGX_DLSS_GetOptimalSettingsCallback(NVS
case NVSDK_NGX_PerfQuality_Value_Balanced:
//UE5 ratio fix
if (Config::Instance()->NVNGX_Engine == NVNGX_ENGINE_TYPE_UNREAL &&
strlen(Config::Instance()->NVNGX_EngineVersion) > 0 &&
Config::Instance()->NVNGX_EngineVersion[0] == '5' &&
Config::Instance()->NVNGX_EngineVersion5 &&
Config::Instance()->Dx12Upscaler.value_or("xess") == "xess")
{
OutHeight = (unsigned int)((float)Height / 1.6666666667);
@@ -111,8 +110,7 @@ inline NVSDK_NGX_Result NVSDK_CONV NVSDK_NGX_DLSS_GetOptimalSettingsCallback(NVS
case NVSDK_NGX_PerfQuality_Value_MaxQuality:
//UE5 ratio fix
if (Config::Instance()->NVNGX_Engine == NVNGX_ENGINE_TYPE_UNREAL &&
strlen(Config::Instance()->NVNGX_EngineVersion) > 0 &&
Config::Instance()->NVNGX_EngineVersion[0] == '5' &&
Config::Instance()->NVNGX_EngineVersion5 &&
Config::Instance()->Dx12Upscaler.value_or("xess") == "xess")
{
OutHeight = (unsigned int)((float)Height / 1.4285714286);
@@ -131,8 +129,7 @@ inline NVSDK_NGX_Result NVSDK_CONV NVSDK_NGX_DLSS_GetOptimalSettingsCallback(NVS
case NVSDK_NGX_PerfQuality_Value_UltraQuality:
//UE5 ratio fix
if (Config::Instance()->NVNGX_Engine == NVNGX_ENGINE_TYPE_UNREAL &&
strlen(Config::Instance()->NVNGX_EngineVersion) > 0 &&
Config::Instance()->NVNGX_EngineVersion[0] == '5' &&
Config::Instance()->NVNGX_EngineVersion5 &&
Config::Instance()->Dx12Upscaler.value_or("xess") == "xess")
{
OutHeight = (unsigned int)((float)Height / 1.25);
@@ -157,8 +154,7 @@ inline NVSDK_NGX_Result NVSDK_CONV NVSDK_NGX_DLSS_GetOptimalSettingsCallback(NVS
default:
//UE5 ratio fix
if (Config::Instance()->NVNGX_Engine == NVNGX_ENGINE_TYPE_UNREAL &&
strlen(Config::Instance()->NVNGX_EngineVersion) > 0 &&
Config::Instance()->NVNGX_EngineVersion[0] == '5' &&
Config::Instance()->NVNGX_EngineVersion5 &&
Config::Instance()->Dx12Upscaler.value_or("xess") == "xess")
{
OutHeight = (unsigned int)((float)Height / 1.6666666667);
+1
View File
@@ -1,3 +1,4 @@
#pragma once
#include "pch.h"
#include "Util.h"
+1
View File
@@ -1,3 +1,4 @@
#pragma once
#include "pch.h"
#include "XeSSFeature.h"
#include "Config.h"
+1
View File
@@ -1,3 +1,4 @@
#pragma once
#include "IFeature.h"
#include "xess_d3d12.h"
#include "xess_debug.h"
+1
View File
@@ -1,3 +1,4 @@
#pragma once
#include "pch.h"
#include "XeSSFeature_Dx11.h"
#include "Config.h"
+3 -2
View File
@@ -1,3 +1,4 @@
#pragma once
#include "pch.h"
#include "XeSSFeature_Dx12.h"
#include "Config.h"
@@ -49,7 +50,7 @@ bool XeSSFeatureDx12::Evaluate(ID3D12GraphicsCommandList* InCommandList, const N
D3D12_RESOURCE_STATE_NON_PIXEL_SHADER_RESOURCE);
else if (Config::Instance()->NVNGX_Engine == NVNGX_ENGINE_TYPE_UNREAL)
{
Config::Instance()->ColorResourceBarrier = (int)D3D12_RESOURCE_STATE_NON_PIXEL_SHADER_RESOURCE;
Config::Instance()->ColorResourceBarrier = (int)D3D12_RESOURCE_STATE_RENDER_TARGET;
ResourceBarrier(InCommandList, params.pColorTexture,
D3D12_RESOURCE_STATE_RENDER_TARGET,
@@ -184,7 +185,7 @@ bool XeSSFeatureDx12::Evaluate(ID3D12GraphicsCommandList* InCommandList, const N
}
// restore resource states
if (params.pColorTexture && (Config::Instance()->ColorResourceBarrier.value_or(false) || Config::Instance()->NVNGX_Engine == NVNGX_ENGINE_TYPE_UNREAL))
if (params.pColorTexture && Config::Instance()->ColorResourceBarrier.has_value())
ResourceBarrier(InCommandList, params.pColorTexture,
D3D12_RESOURCE_STATE_NON_PIXEL_SHADER_RESOURCE,
(D3D12_RESOURCE_STATES)Config::Instance()->ColorResourceBarrier.value());
+1
View File
@@ -1,3 +1,4 @@
#pragma once
#include "IFeature_Dx12.h"
#include "XeSSFeature.h"
#include <string>
+1
View File
@@ -1,3 +1,4 @@
#pragma once
#include "pch.h"
#include <iostream>
+5 -5
View File
@@ -34,7 +34,7 @@ extern "C" {
///
/// @returns
/// The size (in bytes) of the required scratch memory buffer for the DX11 backend.
FFX_API size_t ffxFsr2GetScratchMemorySizeDX11();
size_t ffxFsr2GetScratchMemorySizeDX11();
/// Populate an interface with pointers for the DX11 backend.
///
@@ -49,7 +49,7 @@ FFX_API size_t ffxFsr2GetScratchMemorySizeDX11();
/// FFX_ERROR_CODE_INVALID_POINTER The <c><i>interface</i></c> pointer was <c><i>NULL</i></c>.
///
/// @ingroup FSR2 DX11
FFX_API FfxErrorCode ffxFsr2GetInterfaceDX11(
FfxErrorCode ffxFsr2GetInterfaceDX11(
FfxFsr2Interface* fsr2Interface,
ID3D11Device* device,
void* scratchBuffer,
@@ -63,7 +63,7 @@ FFX_API FfxErrorCode ffxFsr2GetInterfaceDX11(
/// An abstract FidelityFX device.
///
/// @ingroup FSR2 DX11
FFX_API FfxDevice ffxGetDeviceDX11(ID3D11Device* device);
FfxDevice ffxGetDeviceDX11(ID3D11Device* device);
/// Create a <c><i>FfxResource</i></c> from a <c><i>ID3D11Resource</i></c>.
///
@@ -76,7 +76,7 @@ FFX_API FfxDevice ffxGetDeviceDX11(ID3D11Device* device);
/// An abstract FidelityFX resources.
///
/// @ingroup FSR2 DX11
FFX_API FfxResource ffxGetResourceDX11(
FfxResource ffxGetResourceDX11(
FfxFsr2Context* context,
ID3D11Resource* resDx11,
const wchar_t* name = nullptr,
@@ -92,7 +92,7 @@ FFX_API FfxResource ffxGetResourceDX11(
/// A <c><i>ID3D11Resource</i> pointer</c>.
///
/// @ingroup FSR2 DX11
FFX_API ID3D11Resource* ffxGetDX11ResourcePtr(FfxFsr2Context* context, uint32_t resId);
ID3D11Resource* ffxGetDX11ResourcePtr(FfxFsr2Context* context, uint32_t resId);
#if defined(__cplusplus)
}
@@ -22,7 +22,7 @@
#pragma once
#include <stdint.h>
#include "../../ffx_fsr2_interface.h"
#include <ffx_fsr2_interface.h>
#include <d3d11.h>
#include <vector>
+6 -6
View File
@@ -37,7 +37,7 @@ extern "C" {
///
/// @returns
/// The size (in bytes) of the required scratch memory buffer for the DX12 backend.
FFX_API size_t ffxFsr2GetScratchMemorySizeDX12();
size_t ffxFsr2GetScratchMemorySizeDX12();
/// Populate an interface with pointers for the DX12 backend.
///
@@ -52,7 +52,7 @@ FFX_API size_t ffxFsr2GetScratchMemorySizeDX12();
/// FFX_ERROR_CODE_INVALID_POINTER The <c><i>interface</i></c> pointer was <c><i>NULL</i></c>.
///
/// @ingroup FSR2 DX12
FFX_API FfxErrorCode ffxFsr2GetInterfaceDX12(
FfxErrorCode ffxFsr2GetInterfaceDX12(
FfxFsr2Interface* fsr2Interface,
ID3D12Device* device,
void* scratchBuffer,
@@ -66,7 +66,7 @@ FFX_API FfxErrorCode ffxFsr2GetInterfaceDX12(
/// An abstract FidelityFX device.
///
/// @ingroup FSR2 DX12
FFX_API FfxDevice ffxGetDeviceDX12(ID3D12Device* device);
FfxDevice ffxGetDeviceDX12(ID3D12Device* device);
/// Create a <c><i>FfxCommandList</i></c> from a <c><i>ID3D12CommandList</i></c>.
///
@@ -76,7 +76,7 @@ FFX_API FfxDevice ffxGetDeviceDX12(ID3D12Device* device);
/// An abstract FidelityFX command list.
///
/// @ingroup FSR2 DX12
FFX_API FfxCommandList ffxGetCommandListDX12(ID3D12CommandList* cmdList);
FfxCommandList ffxGetCommandListDX12(ID3D12CommandList* cmdList);
/// Create a <c><i>FfxResource</i></c> from a <c><i>ID3D12Resource</i></c>.
///
@@ -90,7 +90,7 @@ FFX_API FfxCommandList ffxGetCommandListDX12(ID3D12CommandList* cmdList);
/// An abstract FidelityFX resources.
///
/// @ingroup FSR2 DX12
FFX_API FfxResource ffxGetResourceDX12(
FfxResource ffxGetResourceDX12(
FfxFsr2Context* context,
ID3D12Resource* resDx12,
const wchar_t* name = nullptr,
@@ -107,7 +107,7 @@ FFX_API FfxResource ffxGetResourceDX12(
/// A <c><i>ID3D12Resource</i> pointer</c>.
///
/// @ingroup FSR2 DX12
FFX_API ID3D12Resource* ffxGetDX12ResourcePtr(FfxFsr2Context* context, uint32_t resId);
ID3D12Resource* ffxGetDX12ResourcePtr(FfxFsr2Context* context, uint32_t resId);
#if defined(__cplusplus)
}
@@ -22,7 +22,7 @@
#pragma once
#include <stdint.h>
#include "../../ffx_fsr2_interface.h"
#include <ffx_fsr2_interface.h>
#if defined(__cplusplus)
extern "C" {
+2 -2
View File
@@ -70,13 +70,13 @@ typedef void (*FfxAssertCallback)(const char* message);
/// @returns
/// Always returns true.
///
FFX_API bool ffxAssertReport(const char* file, int32_t line, const char* condition, const char* msg);
bool ffxAssertReport(const char* file, int32_t line, const char* condition, const char* msg);
/// Provides the ability to set a callback for assert messages.
///
/// @param [in] callback The callback function that will receive assert messages.
///
FFX_API void ffxAssertSetPrintingCallback(FfxAssertCallback callback);
void ffxAssertSetPrintingCallback(FfxAssertCallback callback);
#ifdef _DEBUG
/// Standard assert macro.
+1 -1
View File
@@ -21,7 +21,7 @@
#pragma once
#include "ffx_types.h"
#include <ffx_types.h>
/// Typedef for error codes returned from functions in the FidelityFX SDK.
typedef int32_t FfxErrorCode;
+9 -9
View File
@@ -225,7 +225,7 @@ typedef struct FfxFsr2Context {
/// FFX_ERROR_BACKEND_API_ERROR The operation failed because of an error returned from the backend.
///
/// @ingroup FSR2
FFX_API FfxErrorCode ffxFsr2ContextCreate(FfxFsr2Context* context, const FfxFsr2ContextDescription* contextDescription);
FfxErrorCode ffxFsr2ContextCreate(FfxFsr2Context* context, const FfxFsr2ContextDescription* contextDescription);
/// Dispatch the various passes that constitute FidelityFX Super Resolution 2.
///
@@ -266,7 +266,7 @@ FFX_API FfxErrorCode ffxFsr2ContextCreate(FfxFsr2Context* context, const FfxFsr2
/// FFX_ERROR_BACKEND_API_ERROR The operation failed because of an error returned from the backend.
///
/// @ingroup FSR2
FFX_API FfxErrorCode ffxFsr2ContextDispatch(FfxFsr2Context* context, const FfxFsr2DispatchDescription* dispatchDescription);
FfxErrorCode ffxFsr2ContextDispatch(FfxFsr2Context* context, const FfxFsr2DispatchDescription* dispatchDescription);
/// A helper function generate a Reactive mask from an opaque only texure and one containing translucent objects.
///
@@ -277,7 +277,7 @@ FFX_API FfxErrorCode ffxFsr2ContextDispatch(FfxFsr2Context* context, const FfxFs
/// FFX_OK The operation completed successfully.
///
/// @ingroup FSR2
FFX_API FfxErrorCode ffxFsr2ContextGenerateReactiveMask(FfxFsr2Context* context, const FfxFsr2GenerateReactiveDescription* params);
FfxErrorCode ffxFsr2ContextGenerateReactiveMask(FfxFsr2Context* context, const FfxFsr2GenerateReactiveDescription* params);
/// Destroy the FidelityFX Super Resolution context.
///
@@ -289,7 +289,7 @@ FFX_API FfxErrorCode ffxFsr2ContextGenerateReactiveMask(FfxFsr2Context* context,
/// FFX_ERROR_CODE_NULL_POINTER The operation failed because either <c><i>context</i></c> was <c><i>NULL</i></c>.
///
/// @ingroup FSR2
FFX_API FfxErrorCode ffxFsr2ContextDestroy(FfxFsr2Context* context);
FfxErrorCode ffxFsr2ContextDestroy(FfxFsr2Context* context);
/// Get the upscale ratio from the quality mode.
///
@@ -312,7 +312,7 @@ FFX_API FfxErrorCode ffxFsr2ContextDestroy(FfxFsr2Context* context);
/// <c><i>qualityMode</i></c> according to the table above.
///
/// @ingroup FSR2
FFX_API float ffxFsr2GetUpscaleRatioFromQualityMode(FfxFsr2QualityMode qualityMode);
float ffxFsr2GetUpscaleRatioFromQualityMode(FfxFsr2QualityMode qualityMode);
/// A helper function to calculate the rendering resolution from a target
/// resolution and desired quality level.
@@ -334,7 +334,7 @@ FFX_API float ffxFsr2GetUpscaleRatioFromQualityMode(FfxFsr2QualityMode qualityMo
/// FFX_ERROR_INVALID_ENUM An invalid quality mode was specified.
///
/// @ingroup FSR2
FFX_API FfxErrorCode ffxFsr2GetRenderResolutionFromQualityMode(
FfxErrorCode ffxFsr2GetRenderResolutionFromQualityMode(
uint32_t* renderWidth,
uint32_t* renderHeight,
uint32_t displayWidth,
@@ -366,7 +366,7 @@ FFX_API FfxErrorCode ffxFsr2GetRenderResolutionFromQualityMode(
/// The jitter phase count for the scaling factor between <c><i>renderWidth</i></c> and <c><i>displayWidth</i></c>.
///
/// @ingroup FSR2
FFX_API int32_t ffxFsr2GetJitterPhaseCount(int32_t renderWidth, int32_t displayWidth);
int32_t ffxFsr2GetJitterPhaseCount(int32_t renderWidth, int32_t displayWidth);
/// A helper function to calculate the subpixel jitter offset.
///
@@ -434,7 +434,7 @@ FFX_API int32_t ffxFsr2GetJitterPhaseCount(int32_t renderWidth, int32_t displayW
/// FFX_ERROR_INVALID_ARGUMENT Argument <c><i>phaseCount</i></c> must be greater than 0.
///
/// @ingroup FSR2
FFX_API FfxErrorCode ffxFsr2GetJitterOffset(float* outX, float* outY, int32_t index, int32_t phaseCount);
FfxErrorCode ffxFsr2GetJitterOffset(float* outX, float* outY, int32_t index, int32_t phaseCount);
/// A helper function to check if a resource is
/// <c><i>FFX_FSR2_RESOURCE_IDENTIFIER_NULL</i></c>.
@@ -447,7 +447,7 @@ FFX_API FfxErrorCode ffxFsr2GetJitterOffset(float* outX, float* outY, int32_t in
/// false The <c><i>resource</i></c> was <c><i>FFX_FSR2_RESOURCE_IDENTIFIER_NULL</i></c>.
///
/// @ingroup FSR2
FFX_API bool ffxFsr2ResourceIsNull(FfxResource resource);
bool ffxFsr2ResourceIsNull(FfxResource resource);
#if defined(__cplusplus)
}
+5 -5
View File
@@ -21,14 +21,14 @@
#pragma once
#include "ffx_assert.h"
#include "ffx_types.h"
#include "ffx_error.h"
#include <ffx_assert.h>
#include <ffx_types.h>
#include <ffx_error.h>
// Include the FSR2 resources defined in the HLSL code. This shared here to avoid getting out of sync.
#define FFX_CPU
#include "shaders/ffx_fsr2_resources.h"
#include "shaders/ffx_fsr2_common.h"
#include <shaders/ffx_fsr2_resources.h>
#include <shaders/ffx_fsr2_common.h>
#if defined(__cplusplus)
extern "C" {
+1 -1
View File
@@ -21,7 +21,7 @@
#pragma once
#include "ffx_types.h"
#include <ffx_types.h>
/// The value of Pi.
const float FFX_PI = 3.141592653589793f;
+9 -9
View File
@@ -34,7 +34,7 @@ extern "C" {
///
/// @returns
/// The size (in bytes) of the required scratch memory buffer for the VK backend.
FFX_API size_t ffxFsr2GetScratchMemorySizeVK(VkPhysicalDevice physicalDevice);
size_t ffxFsr2GetScratchMemorySizeVK(VkPhysicalDevice physicalDevice);
/// Populate an interface with pointers for the VK backend.
///
@@ -51,7 +51,7 @@ extern "C" {
/// FFX_ERROR_CODE_INVALID_POINTER The <c><i>interface</i></c> pointer was <c><i>NULL</i></c>.
///
/// @ingroup FSR2 VK
FFX_API FfxErrorCode ffxFsr2GetInterfaceVK(
FfxErrorCode ffxFsr2GetInterfaceVK(
FfxFsr2Interface* outInterface,
void* scratchBuffer,
size_t scratchBufferSize,
@@ -66,7 +66,7 @@ extern "C" {
/// An abstract FidelityFX device.
///
/// @ingroup FSR2 VK
FFX_API FfxDevice ffxGetDeviceVK(VkDevice device);
FfxDevice ffxGetDeviceVK(VkDevice device);
/// Create a <c><i>FfxCommandList</i></c> from a <c><i>VkCommandBuffer</i></c>.
///
@@ -76,7 +76,7 @@ extern "C" {
/// An abstract FidelityFX command list.
///
/// @ingroup FSR2 VK
FFX_API FfxCommandList ffxGetCommandListVK(VkCommandBuffer cmdBuf);
FfxCommandList ffxGetCommandListVK(VkCommandBuffer cmdBuf);
/// Create a <c><i>FfxResource</i></c> from a <c><i>VkImage</i></c>.
///
@@ -93,7 +93,7 @@ extern "C" {
/// An abstract FidelityFX resources.
///
/// @ingroup FSR2 VK
FFX_API FfxResource ffxGetTextureResourceVK(FfxFsr2Context* context,
FfxResource ffxGetTextureResourceVK(FfxFsr2Context* context,
VkImage imgVk,
VkImageView imageView,
uint32_t width,
@@ -114,7 +114,7 @@ extern "C" {
/// An abstract FidelityFX resources.
///
/// @ingroup FSR2 VK
FFX_API FfxResource ffxGetBufferResourceVK(FfxFsr2Context* context,
FfxResource ffxGetBufferResourceVK(FfxFsr2Context* context,
VkBuffer bufVk,
uint32_t size,
const wchar_t* name = nullptr,
@@ -129,7 +129,7 @@ extern "C" {
/// A <c><i>VkImage</i></c>.
///
/// @ingroup FSR2 VK
FFX_API VkImage ffxGetVkImage(FfxFsr2Context* context, uint32_t resId);
VkImage ffxGetVkImage(FfxFsr2Context* context, uint32_t resId);
/// Convert a <c><i>FfxResource</i></c> value to a <c><i>VkImageView</i></c>.
///
@@ -140,7 +140,7 @@ extern "C" {
/// A <c><i>VkImage</i></c>.
///
/// @ingroup FSR2 VK
FFX_API VkImageView ffxGetVkImageView(FfxFsr2Context* context, uint32_t resId);
VkImageView ffxGetVkImageView(FfxFsr2Context* context, uint32_t resId);
/// Convert a <c><i>FfxResource</i></c> value to a <c><i>VkImageLayout</i></c>.
///
@@ -151,7 +151,7 @@ extern "C" {
/// A <c><i>VkImage</i></c>.
///
/// @ingroup FSR2 VK
FFX_API VkImageLayout ffxGetVkImageLayout(FfxFsr2Context* context, uint32_t resId);
VkImageLayout ffxGetVkImageLayout(FfxFsr2Context* context, uint32_t resId);
#if defined(__cplusplus)
}
@@ -22,7 +22,7 @@
#pragma once
#include <stdint.h>
#include "../../ffx_fsr2_interface.h"
#include <ffx_fsr2_interface.h>
#if defined(__cplusplus)
extern "C" {
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.