Skip to content

Commit 0c29007

Browse files
committed
Show custom name in the FPS overlay when using a custom provider
1 parent a88a7f9 commit 0c29007

5 files changed

Lines changed: 19 additions & 5 deletions

File tree

‎OptiScaler/upscalers/FeatureProvider_Dx11.cpp‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,10 @@ bool FeatureProvider_Dx11::GetFeature(Upscaler upscaler, UINT handleId, NVSDK_NG
123123
upscaler = Upscaler::FSR22;
124124
loaded = true; // Assuming the fallback always loads successfully
125125
}
126+
else if (!custom.empty())
127+
{
128+
(*feature)->SetCustomName(custom);
129+
}
126130

127131
if (!rayReconstruction)
128132
cfg.Dx11Upscaler = upscaler;

‎OptiScaler/upscalers/FeatureProvider_Dx12.cpp‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,10 @@ bool FeatureProvider_Dx12::GetFeature(Upscaler upscaler, UINT handleId, NVSDK_NG
9797
upscaler = Upscaler::FSR21;
9898
loaded = true; // Assuming the fallback always loads successfully
9999
}
100+
else if (!custom.empty())
101+
{
102+
(*feature)->SetCustomName(custom);
103+
}
100104

101105
// Ray reconstruction's DLSSD isn't one of the upscalers, nor is a regular one picked for it
102106
if (rayReconstruction)

‎OptiScaler/upscalers/FeatureProvider_Vk.cpp‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,10 @@ bool FeatureProvider_Vk::GetFeature(Upscaler upscaler, UINT handleId, NVSDK_NGX_
115115
upscaler = Upscaler::FSR22;
116116
loaded = true; // Assuming the fallback always loads successfully
117117
}
118+
else if (!custom.empty())
119+
{
120+
(*feature)->SetCustomName(custom);
121+
}
118122

119123
// Ray reconstruction's DLSSD isn't one of the upscalers, nor is a regular one picked for it
120124
if (rayReconstruction)

‎OptiScaler/upscalers/IFeature.h‎

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,9 @@ class IFeature
106106
std::unordered_set<std::pair<float, float>, hashFunction> _jitterInfo;
107107

108108
protected:
109+
// Name of the custom provider it runs, empty for the regular ones
110+
std::string _customName;
111+
109112
// D3D11with12
110113
inline static ID3D12Device* _dx11on12Device = nullptr;
111114
inline static ID3D12Device* _localDx11on12Device = nullptr;
@@ -178,7 +181,10 @@ class IFeature
178181
virtual Upscaler GetUpscalerType() const = 0;
179182
virtual API Api() const = 0;
180183
std::string Name() const { return UpscalerDisplayName(GetUpscalerType()); };
181-
std::string ShortName() const { return UpscalerShortName(GetUpscalerType()); }; // Without the version
184+
// Without the version, a custom provider's name instead of the upscaler it runs as
185+
std::string ShortName() const { return _customName.empty() ? UpscalerShortName(GetUpscalerType()) : _customName; };
186+
const std::string& CustomName() const { return _customName; }
187+
void SetCustomName(const std::string& name) { _customName = name; }
182188
virtual std::optional<double> ReadUpscalerTime(void* commandQueue) { return std::nullopt; }
183189
virtual void ReadDetailedGpuTimes(void* commandQueue, std::vector<DetailedGpuTime>& detailedGpuTimes) {};
184190

‎OptiScaler/upscalers/dlssd/DLSSDFeature.h‎

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ class DLSSDFeature : public virtual IFeature
1717

1818
// Custom DLSSD, nullptr for NVIDIA's
1919
Nvngx_RRDllProxy* _custom = nullptr;
20-
std::string _customName;
2120

2221
void ProcessEvaluateParams(NVSDK_NGX_Parameter* InParameters);
2322
void ProcessInitParams(NVSDK_NGX_Parameter* InParameters);
@@ -29,9 +28,6 @@ class DLSSDFeature : public virtual IFeature
2928
feature_version Version() override { return feature_version { _version.major, _version.minor, _version.patch }; }
3029
Upscaler GetUpscalerType() const override { return Upscaler::DLSSD; }
3130

32-
// Empty for NVIDIA's
33-
const std::string& CustomName() const { return _customName; }
34-
3531
DLSSDFeature(unsigned int handleId, NVSDK_NGX_Parameter* InParameters);
3632

3733
~DLSSDFeature();

0 commit comments

Comments
 (0)