Skip to content
This repository was archived by the owner on Sep 17, 2024. It is now read-only.

Commit b0522b9

Browse files
committed
Nits
1 parent 4323e44 commit b0522b9

File tree

7 files changed

+13
-20
lines changed

7 files changed

+13
-20
lines changed

source/maindll/FFFrameInterpolator.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
#pragma once
22

3-
#include <FidelityFX/host/ffx_interface.h>
43
#include <FidelityFX/host/ffx_opticalflow.h>
54
#include "FFDilator.h"
65
#include "FFInterfaceWrapper.h"

source/maindll/FFFrameInterpolatorVK.cpp

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -194,18 +194,16 @@ bool FFFrameInterpolatorVK::LoadTextureFromNGXParameters(
194194
FfxResource *OutFfxResource,
195195
FfxResourceStates State)
196196
{
197-
void *resource = nullptr;
198-
NGXParameters->GetVoidPointer(Name, &resource);
197+
NGXVulkanResourceHandle *resourceHandle = nullptr;
198+
NGXParameters->GetVoidPointer(Name, reinterpret_cast<void **>(&resourceHandle));
199199

200-
if (!resource)
200+
if (!resourceHandle)
201201
{
202202
*OutFfxResource = {};
203203
return false;
204204
}
205205

206206
// Vulkan provides no mechanism to query resource information. Convert it manually.
207-
auto resourceHandle = static_cast<const NGXVulkanResourceHandle *>(resource);
208-
209207
if (resourceHandle->Type != 0)
210208
__debugbreak();
211209

source/maindll/NGX/NvNGXDirectX12.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ NGXDLLEXPORT NGXResult NVSDK_NGX_D3D12_EvaluateFeature(ID3D12GraphicsCommandList
7474
auto itr = FeatureInstanceHandles.find(InstanceHandle->InternalId);
7575

7676
if (itr == FeatureInstanceHandles.end())
77-
return decltype(itr->second){};
77+
return decltype(itr->second) {};
7878

7979
return itr->second;
8080
}();

source/maindll/Util.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
#include <spdlog/sinks/basic_file_sink.h>
22
#include <Windows.h>
3-
#include <stdio.h>
43
#include "Util.h"
54

65
namespace Util

source/maindll/dllmain.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ BOOL WINAPI DllMain(HINSTANCE hInstDLL, DWORD fdwReason, LPVOID lpvReserved)
4848
BUILD_VERSION_MINOR);
4949
spdlog::warn("implementation of AMD's FSR 3.");
5050
spdlog::warn("");
51-
spdlog::warn("dlssg-to-fsr3 is freely downloadable from https://www.nexusmods.com/site/mods/738?tab=files or "
51+
spdlog::warn("dlssg-to-fsr3 is freely downloadable from https://www.nexusmods.com/site/mods/738 or "
5252
"https://github.com/Nukem9/dlssg-to-fsr3/releases.");
5353
spdlog::warn("If you paid for these files, you've been scammed.");
5454
spdlog::warn("");

source/wrapper_generic/dllmain.cpp

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
// sl.common.dll loads _nvngx.dll <- we are here
77
// _nvngx.dll loads nvngx_dlssg.dll <- intercept this stage
88
//
9-
std::vector<const wchar_t *> TargetLibrariesToHook = { L"sl.interposer.dll", L"sl.common.dll", L"sl.dlss_g.dll", L"_nvngx.dll" };
9+
std::vector TargetLibrariesToHook = { L"sl.interposer.dll", L"sl.common.dll", L"sl.dlss_g.dll", L"_nvngx.dll" };
1010
constinit const wchar_t *TargetImplementationDll = L"nvngx_dlssg.dll";
1111
constinit const wchar_t *RelplacementImplementationDll = L"dlssg_to_fsr3_amd_is_better.dll";
1212

@@ -114,9 +114,8 @@ bool PatchImportsForModule(const wchar_t *Path, HMODULE ModuleHandle)
114114
if (!Path || !ModuleHandle)
115115
return false;
116116

117-
const bool isMatch = std::any_of(
118-
TargetLibrariesToHook.begin(),
119-
TargetLibrariesToHook.end(),
117+
const bool isMatch = std::ranges::any_of(
118+
TargetLibrariesToHook,
120119
[path = std::wstring_view(Path)](const wchar_t *Target)
121120
{
122121
return path.ends_with(Target);
@@ -159,7 +158,7 @@ BOOL WINAPI DllMain(HINSTANCE hInstDLL, DWORD fdwReason, LPVOID lpvReserved)
159158
// "Returnal\ Returnal\ Binaries\Win64\Returnal-Win64-Shipping.exe"
160159
// "Hogwarts Legacy\ Phoenix\ Binaries\Win64\HogwartsLegacy.exe"
161160
// "SW Jedi Survivor\ SwGame\ Binaries\Win64\JediSurvivor.exe"
162-
// "Atomic Heart\ AtomicHeart\ Binaries\Win64\AtomicHeart-Win64-Shipping.exe
161+
// "Atomic Heart\ AtomicHeart\ Binaries\Win64\AtomicHeart-Win64-Shipping.exe"
163162
// "MMS\ MidnightSuns\ Binaries\Win64\MidnightSuns-Win64-Shipping.exe"
164163
//
165164
// "Dying Light 2\ ph\work\bin\x64\sl.interposer.dll"
@@ -177,10 +176,9 @@ BOOL WINAPI DllMain(HINSTANCE hInstDLL, DWORD fdwReason, LPVOID lpvReserved)
177176

178177
if (!LoadLibraryW(bruteInterposerPaths[0]))
179178
{
180-
wchar_t path[2048];
181-
182179
for (auto interposer : bruteInterposerPaths)
183180
{
181+
wchar_t path[2048];
184182
if (!Util::GetModulePath(path, true, GetModuleHandleW(nullptr)))
185183
break;
186184

@@ -193,9 +191,8 @@ BOOL WINAPI DllMain(HINSTANCE hInstDLL, DWORD fdwReason, LPVOID lpvReserved)
193191
}
194192

195193
// We probably loaded after sl.interposer.dll and sl.common.dll. Try patching them up front.
196-
bool anyPatched = std::count_if(
197-
TargetLibrariesToHook.begin(),
198-
TargetLibrariesToHook.end(),
194+
bool anyPatched = std::ranges::count_if(
195+
TargetLibrariesToHook,
199196
[](const wchar_t *Target)
200197
{
201198
return PatchImportsForModule(Target, GetModuleHandleW(Target)) && _wcsicmp(Target, TargetEGSServicesDll) != 0;

source/wrapper_generic/nvapi.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ struct NV_SCG_PRIORITY_INFO
3333
uint32_t Unknown8; // 14
3434
};
3535

36-
struct NV_D3DKMT_PRIVATE_DRIVER_DATA // nvwg2umx.dll (546.33)
36+
struct NV_D3DKMT_PRIVATE_DRIVER_DATA // nvwgf2umx.dll (546.33)
3737
{
3838
uint32_t Header; // 0 NVDA
3939
char Padding[0xE4]; // 4

0 commit comments

Comments
 (0)