diff --git a/CyberXeSS/Config.cpp b/CyberXeSS/Config.cpp index 5c5e3860..02d8bcf3 100644 --- a/CyberXeSS/Config.cpp +++ b/CyberXeSS/Config.cpp @@ -1,3 +1,4 @@ +#pragma once #include "pch.h" #include "Config.h" #include diff --git a/CyberXeSS/Config.h b/CyberXeSS/Config.h index 64ddb095..74875151 100644 --- a/CyberXeSS/Config.h +++ b/CyberXeSS/Config.h @@ -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 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(); diff --git a/CyberXeSS/CyberXeSS.vcxproj b/CyberXeSS/CyberXeSS.vcxproj index a7b5425b..beb67fb1 100644 --- a/CyberXeSS/CyberXeSS.vcxproj +++ b/CyberXeSS/CyberXeSS.vcxproj @@ -82,7 +82,7 @@ $(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) $(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) nvngx - ..\..\God of War + ..\..\..\Games\Banishers Ghosts of New Eden\NWD\Binaries\Win64 $(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) @@ -141,7 +141,7 @@ Windows true false - 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) + 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) @@ -202,8 +202,8 @@ copy $(SolutionDir)nvngx.ini $(SolutionDir)x64\Release\a\ - + diff --git a/CyberXeSS/CyberXeSS.vcxproj.filters b/CyberXeSS/CyberXeSS.vcxproj.filters index 32138ff7..824cf5e5 100644 --- a/CyberXeSS/CyberXeSS.vcxproj.filters +++ b/CyberXeSS/CyberXeSS.vcxproj.filters @@ -65,26 +65,20 @@ Header Files - - Header Files - - - Header Files - Header Files Header Files + + Header Files + Config - - NVNGX - XeSS @@ -113,10 +107,13 @@ Source Files - + Source Files - + + Source Files + + Source Files @@ -125,10 +122,10 @@ Source Files - + Source Files - + Source Files diff --git a/CyberXeSS/FSR2Feature.cpp b/CyberXeSS/FSR2Feature.cpp index 5f9211c8..48328dc4 100644 --- a/CyberXeSS/FSR2Feature.cpp +++ b/CyberXeSS/FSR2Feature.cpp @@ -1,3 +1,4 @@ +#pragma once #include "pch.h" #include "FSR2Feature.h" #include "Config.h" diff --git a/CyberXeSS/FSR2Feature.h b/CyberXeSS/FSR2Feature.h index 395a32f7..dbf9fd2f 100644 --- a/CyberXeSS/FSR2Feature.h +++ b/CyberXeSS/FSR2Feature.h @@ -1,7 +1,8 @@ #pragma once -#include "IFeature.h" #include +#include "IFeature.h" + inline static std::string ResultToString(FfxErrorCode result) { switch (result) diff --git a/CyberXeSS/FSR2Feature_Dx11.cpp b/CyberXeSS/FSR2Feature_Dx11.cpp index ac26051b..f4aa332e 100644 --- a/CyberXeSS/FSR2Feature_Dx11.cpp +++ b/CyberXeSS/FSR2Feature_Dx11.cpp @@ -1,3 +1,4 @@ +#pragma once #include "pch.h" #include "FSR2Feature_Dx11.h" #include "Config.h" diff --git a/CyberXeSS/FSR2Feature_Dx12.cpp b/CyberXeSS/FSR2Feature_Dx12.cpp index 3cda718a..40bf79c0 100644 --- a/CyberXeSS/FSR2Feature_Dx12.cpp +++ b/CyberXeSS/FSR2Feature_Dx12.cpp @@ -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()); diff --git a/CyberXeSS/FSR2Feature_Dx12.h b/CyberXeSS/FSR2Feature_Dx12.h index 99e864d6..1aa242f8 100644 --- a/CyberXeSS/FSR2Feature_Dx12.h +++ b/CyberXeSS/FSR2Feature_Dx12.h @@ -1,3 +1,4 @@ +#pragma once #include "FSR2Feature.h" #include "IFeature_Dx12.h" diff --git a/CyberXeSS/FSR2Feature_Vk.cpp b/CyberXeSS/FSR2Feature_Vk.cpp index e3ca4663..566fd6db 100644 --- a/CyberXeSS/FSR2Feature_Vk.cpp +++ b/CyberXeSS/FSR2Feature_Vk.cpp @@ -1,8 +1,8 @@ +#pragma once #include "pch.h" #include "FSR2Feature_Vk.h" #include "Config.h" -#include #include "nvsdk_ngx_vk.h" bool FSR2FeatureVk::InitFSR2(const NVSDK_NGX_Parameter* InParameters) diff --git a/CyberXeSS/FSR2Feature_Vk.h b/CyberXeSS/FSR2Feature_Vk.h index ea3c1541..01dd7fae 100644 --- a/CyberXeSS/FSR2Feature_Vk.h +++ b/CyberXeSS/FSR2Feature_Vk.h @@ -1,3 +1,4 @@ +#pragma once #include #include diff --git a/CyberXeSS/IFeature.cpp b/CyberXeSS/IFeature.cpp index e48e52d3..67a3f0be 100644 --- a/CyberXeSS/IFeature.cpp +++ b/CyberXeSS/IFeature.cpp @@ -1,3 +1,4 @@ +#pragma once #include "pch.h" #include "IFeature.h" diff --git a/CyberXeSS/IFeature_Dx12.cpp b/CyberXeSS/IFeature_Dx12.cpp index dc5ab6ff..e9c6eee2 100644 --- a/CyberXeSS/IFeature_Dx12.cpp +++ b/CyberXeSS/IFeature_Dx12.cpp @@ -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) diff --git a/CyberXeSS/NVNGX_DLSS_Dx11.cpp b/CyberXeSS/NVNGX_DLSS_Dx11.cpp index 88c84413..12049428 100644 --- a/CyberXeSS/NVNGX_DLSS_Dx11.cpp +++ b/CyberXeSS/NVNGX_DLSS_Dx11.cpp @@ -1,3 +1,4 @@ +#pragma once #include "pch.h" #include @@ -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); diff --git a/CyberXeSS/NVNGX_DLSS_Dx12.cpp b/CyberXeSS/NVNGX_DLSS_Dx12.cpp index d8951a61..7c90948a 100644 --- a/CyberXeSS/NVNGX_DLSS_Dx12.cpp +++ b/CyberXeSS/NVNGX_DLSS_Dx12.cpp @@ -1,3 +1,4 @@ +#pragma once #include "pch.h" #include @@ -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); } diff --git a/CyberXeSS/NVNGX_DLSS_Vk.cpp b/CyberXeSS/NVNGX_DLSS_Vk.cpp index 6bc66df3..e6f98731 100644 --- a/CyberXeSS/NVNGX_DLSS_Vk.cpp +++ b/CyberXeSS/NVNGX_DLSS_Vk.cpp @@ -1,3 +1,4 @@ +#pragma once #include "pch.h" #include @@ -15,7 +16,7 @@ PFN_vkGetDeviceProcAddr vkGDPA; static inline ankerl::unordered_dense::map > 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(); diff --git a/CyberXeSS/NVNGX_Parameter.h b/CyberXeSS/NVNGX_Parameter.h index b4621be6..2b8782bc 100644 --- a/CyberXeSS/NVNGX_Parameter.h +++ b/CyberXeSS/NVNGX_Parameter.h @@ -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); diff --git a/CyberXeSS/Util.cpp b/CyberXeSS/Util.cpp index cd2a31b3..af36aeb2 100644 --- a/CyberXeSS/Util.cpp +++ b/CyberXeSS/Util.cpp @@ -1,3 +1,4 @@ +#pragma once #include "pch.h" #include "Util.h" diff --git a/CyberXeSS/XeSSFeature.cpp b/CyberXeSS/XeSSFeature.cpp index afdd991a..dffc63e4 100644 --- a/CyberXeSS/XeSSFeature.cpp +++ b/CyberXeSS/XeSSFeature.cpp @@ -1,3 +1,4 @@ +#pragma once #include "pch.h" #include "XeSSFeature.h" #include "Config.h" diff --git a/CyberXeSS/XeSSFeature.h b/CyberXeSS/XeSSFeature.h index b79d740b..fd068071 100644 --- a/CyberXeSS/XeSSFeature.h +++ b/CyberXeSS/XeSSFeature.h @@ -1,3 +1,4 @@ +#pragma once #include "IFeature.h" #include "xess_d3d12.h" #include "xess_debug.h" diff --git a/CyberXeSS/XeSSFeature_Dx11.cpp b/CyberXeSS/XeSSFeature_Dx11.cpp index c1693905..eae747aa 100644 --- a/CyberXeSS/XeSSFeature_Dx11.cpp +++ b/CyberXeSS/XeSSFeature_Dx11.cpp @@ -1,3 +1,4 @@ +#pragma once #include "pch.h" #include "XeSSFeature_Dx11.h" #include "Config.h" diff --git a/CyberXeSS/XeSSFeature_Dx12.cpp b/CyberXeSS/XeSSFeature_Dx12.cpp index 26406266..5ba44fb3 100644 --- a/CyberXeSS/XeSSFeature_Dx12.cpp +++ b/CyberXeSS/XeSSFeature_Dx12.cpp @@ -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()); diff --git a/CyberXeSS/XeSSFeature_Dx12.h b/CyberXeSS/XeSSFeature_Dx12.h index 0ccb62b3..725a3a3f 100644 --- a/CyberXeSS/XeSSFeature_Dx12.h +++ b/CyberXeSS/XeSSFeature_Dx12.h @@ -1,3 +1,4 @@ +#pragma once #include "IFeature_Dx12.h" #include "XeSSFeature.h" #include diff --git a/CyberXeSS/dllmain.cpp b/CyberXeSS/dllmain.cpp index ad19ffbf..4470ea8d 100644 --- a/CyberXeSS/dllmain.cpp +++ b/CyberXeSS/dllmain.cpp @@ -1,3 +1,4 @@ +#pragma once #include "pch.h" #include diff --git a/CyberXeSS/fsr2/include/dx11/ffx_fsr2_dx11.h b/CyberXeSS/fsr2/include/dx11/ffx_fsr2_dx11.h index d708e4b2..7ff870d9 100644 --- a/CyberXeSS/fsr2/include/dx11/ffx_fsr2_dx11.h +++ b/CyberXeSS/fsr2/include/dx11/ffx_fsr2_dx11.h @@ -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 interface pointer was NULL. /// /// @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 FfxResource from a ID3D11Resource. /// @@ -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 ID3D11Resource pointer. /// /// @ingroup FSR2 DX11 -FFX_API ID3D11Resource* ffxGetDX11ResourcePtr(FfxFsr2Context* context, uint32_t resId); +ID3D11Resource* ffxGetDX11ResourcePtr(FfxFsr2Context* context, uint32_t resId); #if defined(__cplusplus) } diff --git a/CyberXeSS/fsr2/include/dx11/shaders/ffx_fsr2_shaders_dx11.h b/CyberXeSS/fsr2/include/dx11/shaders/ffx_fsr2_shaders_dx11.h index 5ab70390..b4255e37 100644 --- a/CyberXeSS/fsr2/include/dx11/shaders/ffx_fsr2_shaders_dx11.h +++ b/CyberXeSS/fsr2/include/dx11/shaders/ffx_fsr2_shaders_dx11.h @@ -22,7 +22,7 @@ #pragma once #include -#include "../../ffx_fsr2_interface.h" +#include #include #include diff --git a/CyberXeSS/fsr2/include/dx12/ffx_fsr2_dx12.h b/CyberXeSS/fsr2/include/dx12/ffx_fsr2_dx12.h index 762dd4a2..50ed4f74 100644 --- a/CyberXeSS/fsr2/include/dx12/ffx_fsr2_dx12.h +++ b/CyberXeSS/fsr2/include/dx12/ffx_fsr2_dx12.h @@ -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 interface pointer was NULL. /// /// @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 FfxCommandList from a ID3D12CommandList. /// @@ -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 FfxResource from a ID3D12Resource. /// @@ -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 ID3D12Resource pointer. /// /// @ingroup FSR2 DX12 -FFX_API ID3D12Resource* ffxGetDX12ResourcePtr(FfxFsr2Context* context, uint32_t resId); +ID3D12Resource* ffxGetDX12ResourcePtr(FfxFsr2Context* context, uint32_t resId); #if defined(__cplusplus) } diff --git a/CyberXeSS/fsr2/include/dx12/shaders/ffx_fsr2_shaders_dx12.h b/CyberXeSS/fsr2/include/dx12/shaders/ffx_fsr2_shaders_dx12.h index 2097c509..f42a1c2b 100644 --- a/CyberXeSS/fsr2/include/dx12/shaders/ffx_fsr2_shaders_dx12.h +++ b/CyberXeSS/fsr2/include/dx12/shaders/ffx_fsr2_shaders_dx12.h @@ -22,7 +22,7 @@ #pragma once #include -#include "../../ffx_fsr2_interface.h" +#include #if defined(__cplusplus) extern "C" { diff --git a/CyberXeSS/fsr2/include/ffx_assert.h b/CyberXeSS/fsr2/include/ffx_assert.h index 483ed291..787f3e70 100644 --- a/CyberXeSS/fsr2/include/ffx_assert.h +++ b/CyberXeSS/fsr2/include/ffx_assert.h @@ -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. diff --git a/CyberXeSS/fsr2/include/ffx_error.h b/CyberXeSS/fsr2/include/ffx_error.h index 7ba7d9c4..8eda6cf8 100644 --- a/CyberXeSS/fsr2/include/ffx_error.h +++ b/CyberXeSS/fsr2/include/ffx_error.h @@ -21,7 +21,7 @@ #pragma once -#include "ffx_types.h" +#include /// Typedef for error codes returned from functions in the FidelityFX SDK. typedef int32_t FfxErrorCode; diff --git a/CyberXeSS/fsr2/include/ffx_fsr2.h b/CyberXeSS/fsr2/include/ffx_fsr2.h index 2a1c74ab..31024195 100644 --- a/CyberXeSS/fsr2/include/ffx_fsr2.h +++ b/CyberXeSS/fsr2/include/ffx_fsr2.h @@ -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 context was NULL. /// /// @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); /// qualityMode 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 renderWidth and displayWidth. /// /// @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 phaseCount 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 /// FFX_FSR2_RESOURCE_IDENTIFIER_NULL. @@ -447,7 +447,7 @@ FFX_API FfxErrorCode ffxFsr2GetJitterOffset(float* outX, float* outY, int32_t in /// false The resource was FFX_FSR2_RESOURCE_IDENTIFIER_NULL. /// /// @ingroup FSR2 -FFX_API bool ffxFsr2ResourceIsNull(FfxResource resource); +bool ffxFsr2ResourceIsNull(FfxResource resource); #if defined(__cplusplus) } diff --git a/CyberXeSS/fsr2/include/ffx_fsr2_interface.h b/CyberXeSS/fsr2/include/ffx_fsr2_interface.h index b6be9760..ef5a7efc 100644 --- a/CyberXeSS/fsr2/include/ffx_fsr2_interface.h +++ b/CyberXeSS/fsr2/include/ffx_fsr2_interface.h @@ -21,14 +21,14 @@ #pragma once -#include "ffx_assert.h" -#include "ffx_types.h" -#include "ffx_error.h" +#include +#include +#include // 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 +#include #if defined(__cplusplus) extern "C" { diff --git a/CyberXeSS/fsr2/include/ffx_util.h b/CyberXeSS/fsr2/include/ffx_util.h index ca4324ea..7c13eabe 100644 --- a/CyberXeSS/fsr2/include/ffx_util.h +++ b/CyberXeSS/fsr2/include/ffx_util.h @@ -21,7 +21,7 @@ #pragma once -#include "ffx_types.h" +#include /// The value of Pi. const float FFX_PI = 3.141592653589793f; diff --git a/CyberXeSS/fsr2/include/vk/ffx_fsr2_vk.h b/CyberXeSS/fsr2/include/vk/ffx_fsr2_vk.h index ddc20aa6..f1888fd9 100644 --- a/CyberXeSS/fsr2/include/vk/ffx_fsr2_vk.h +++ b/CyberXeSS/fsr2/include/vk/ffx_fsr2_vk.h @@ -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 interface pointer was NULL. /// /// @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 FfxCommandList from a VkCommandBuffer. /// @@ -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 FfxResource from a VkImage. /// @@ -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 VkImage. /// /// @ingroup FSR2 VK - FFX_API VkImage ffxGetVkImage(FfxFsr2Context* context, uint32_t resId); + VkImage ffxGetVkImage(FfxFsr2Context* context, uint32_t resId); /// Convert a FfxResource value to a VkImageView. /// @@ -140,7 +140,7 @@ extern "C" { /// A VkImage. /// /// @ingroup FSR2 VK - FFX_API VkImageView ffxGetVkImageView(FfxFsr2Context* context, uint32_t resId); + VkImageView ffxGetVkImageView(FfxFsr2Context* context, uint32_t resId); /// Convert a FfxResource value to a VkImageLayout. /// @@ -151,7 +151,7 @@ extern "C" { /// A VkImage. /// /// @ingroup FSR2 VK - FFX_API VkImageLayout ffxGetVkImageLayout(FfxFsr2Context* context, uint32_t resId); + VkImageLayout ffxGetVkImageLayout(FfxFsr2Context* context, uint32_t resId); #if defined(__cplusplus) } diff --git a/CyberXeSS/fsr2/include/vk/shaders/ffx_fsr2_shaders_vk.h b/CyberXeSS/fsr2/include/vk/shaders/ffx_fsr2_shaders_vk.h index 80356577..444fac6e 100644 --- a/CyberXeSS/fsr2/include/vk/shaders/ffx_fsr2_shaders_vk.h +++ b/CyberXeSS/fsr2/include/vk/shaders/ffx_fsr2_shaders_vk.h @@ -22,7 +22,7 @@ #pragma once #include -#include "../../ffx_fsr2_interface.h" +#include #if defined(__cplusplus) extern "C" { diff --git a/CyberXeSS/fsr2/lib/ffx_fsr2_api_dx11_x64.lib b/CyberXeSS/fsr2/lib/ffx_fsr2_api_dx11_x64.lib index ae6dc83c..1bc51b5c 100644 Binary files a/CyberXeSS/fsr2/lib/ffx_fsr2_api_dx11_x64.lib and b/CyberXeSS/fsr2/lib/ffx_fsr2_api_dx11_x64.lib differ diff --git a/CyberXeSS/fsr2/lib/ffx_fsr2_api_dx11_x64d.lib b/CyberXeSS/fsr2/lib/ffx_fsr2_api_dx11_x64d.lib index 985ba0bd..b833415c 100644 Binary files a/CyberXeSS/fsr2/lib/ffx_fsr2_api_dx11_x64d.lib and b/CyberXeSS/fsr2/lib/ffx_fsr2_api_dx11_x64d.lib differ diff --git a/CyberXeSS/fsr2/lib/ffx_fsr2_api_dx12_x64.lib b/CyberXeSS/fsr2/lib/ffx_fsr2_api_dx12_x64.lib index 1ea7c2ff..b56baac1 100644 Binary files a/CyberXeSS/fsr2/lib/ffx_fsr2_api_dx12_x64.lib and b/CyberXeSS/fsr2/lib/ffx_fsr2_api_dx12_x64.lib differ diff --git a/CyberXeSS/fsr2/lib/ffx_fsr2_api_dx12_x64d.lib b/CyberXeSS/fsr2/lib/ffx_fsr2_api_dx12_x64d.lib index 06c8b0f2..fe6855c0 100644 Binary files a/CyberXeSS/fsr2/lib/ffx_fsr2_api_dx12_x64d.lib and b/CyberXeSS/fsr2/lib/ffx_fsr2_api_dx12_x64d.lib differ diff --git a/CyberXeSS/fsr2/lib/ffx_fsr2_api_vk_x64.lib b/CyberXeSS/fsr2/lib/ffx_fsr2_api_vk_x64.lib index 1abe9466..86cfcf94 100644 Binary files a/CyberXeSS/fsr2/lib/ffx_fsr2_api_vk_x64.lib and b/CyberXeSS/fsr2/lib/ffx_fsr2_api_vk_x64.lib differ diff --git a/CyberXeSS/fsr2/lib/ffx_fsr2_api_vk_x64d.lib b/CyberXeSS/fsr2/lib/ffx_fsr2_api_vk_x64d.lib index 9afc11f6..a9a15629 100644 Binary files a/CyberXeSS/fsr2/lib/ffx_fsr2_api_vk_x64d.lib and b/CyberXeSS/fsr2/lib/ffx_fsr2_api_vk_x64d.lib differ diff --git a/CyberXeSS/fsr2/lib/ffx_fsr2_api_x64.lib b/CyberXeSS/fsr2/lib/ffx_fsr2_api_x64.lib index 5b2d51f6..41e2be4f 100644 Binary files a/CyberXeSS/fsr2/lib/ffx_fsr2_api_x64.lib and b/CyberXeSS/fsr2/lib/ffx_fsr2_api_x64.lib differ diff --git a/CyberXeSS/fsr2/lib/ffx_fsr2_api_x64d.lib b/CyberXeSS/fsr2/lib/ffx_fsr2_api_x64d.lib index a8d4f085..7e7b5a4b 100644 Binary files a/CyberXeSS/fsr2/lib/ffx_fsr2_api_x64d.lib and b/CyberXeSS/fsr2/lib/ffx_fsr2_api_x64d.lib differ