Skip to content

Commit 6e45e45

Browse files
MikhailGorobetsTheMostDiligent
authored andcommitted
Improve DLSS provider initialization and feature lifecycle
1 parent 7d775a7 commit 6e45e45

File tree

5 files changed

+122
-47
lines changed

5 files changed

+122
-47
lines changed

Graphics/SuperResolution/include/SuperResolutionDLSS.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,8 @@ extern const wchar_t* DLSSAppDataPath;
4747
/// Maps Diligent optimization type to NGX performance/quality preset.
4848
NVSDK_NGX_PerfQuality_Value OptimizationTypeToNGXPerfQuality(SUPER_RESOLUTION_OPTIMIZATION_TYPE Type);
4949

50-
/// Maps Diligent super resolution flags to DLSS feature flags.
51-
Int32 SuperResolutionFlagsToDLSSFeatureFlags(SUPER_RESOLUTION_FLAGS Flags);
50+
/// Computes the full set of DLSS feature flags from the description and execution attributes.
51+
Int32 ComputeDLSSFeatureFlags(SUPER_RESOLUTION_FLAGS Flags, const ExecuteSuperResolutionAttribs& Attribs);
5252

5353
/// Populates DLSS variant info using NGX capability parameters.
5454
void EnumerateDLSSVariants(NVSDK_NGX_Parameter* pNGXParams, std::vector<SuperResolutionInfo>& Variants);

Graphics/SuperResolution/src/DLSSProviderD3D11.cpp

Lines changed: 38 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -68,8 +68,9 @@ class SuperResolutionD3D11_DLSS final : public SuperResolutionBase
6868
{
6969
ValidateTemporalExecuteSuperResolutionAttribs(m_Desc, Attribs);
7070

71-
if (m_pDLSSFeature == nullptr)
72-
CreateFeature(Attribs);
71+
NVSDK_NGX_Handle* pDLSSFeature = AcquireFeature(Attribs);
72+
if (pDLSSFeature == nullptr)
73+
return;
7374

7475
DeviceContextD3D11Impl* pCtxImpl = ClassPtrCast<DeviceContextD3D11Impl>(Attribs.pContext);
7576

@@ -100,17 +101,24 @@ class SuperResolutionD3D11_DLSS final : public SuperResolutionBase
100101
EvalParams.InPreExposure = Attribs.PreExposure;
101102
EvalParams.InExposureScale = Attribs.ExposureScale;
102103

103-
NVSDK_NGX_Result Result = NGX_D3D11_EVALUATE_DLSS_EXT(pd3d11DeviceContext, m_pDLSSFeature, m_pNGXParams, &EvalParams);
104+
NVSDK_NGX_Result Result = NGX_D3D11_EVALUATE_DLSS_EXT(pd3d11DeviceContext, pDLSSFeature, m_pNGXParams, &EvalParams);
104105
if (NVSDK_NGX_FAILED(Result))
105106
LOG_ERROR_MESSAGE("DLSS D3D11 evaluation failed. NGX Result: ", static_cast<Uint32>(Result));
106107
}
107108

108109
private:
109-
void CreateFeature(const ExecuteSuperResolutionAttribs& Attribs)
110+
NVSDK_NGX_Handle* AcquireFeature(const ExecuteSuperResolutionAttribs& Attribs)
110111
{
111-
Int32 DLSSCreateFeatureFlags = SuperResolutionFlagsToDLSSFeatureFlags(m_Desc.Flags);
112-
if (Attribs.CameraNear > Attribs.CameraFar)
113-
DLSSCreateFeatureFlags |= NVSDK_NGX_DLSS_Feature_Flags_DepthInverted;
112+
const Int32 DLSSCreateFeatureFlags = ComputeDLSSFeatureFlags(m_Desc.Flags, Attribs);
113+
if (m_pDLSSFeature != nullptr && m_DLSSFeatureFlags == DLSSCreateFeatureFlags)
114+
return m_pDLSSFeature;
115+
116+
if (m_pDLSSFeature != nullptr)
117+
{
118+
NVSDK_NGX_D3D11_ReleaseFeature(m_pDLSSFeature);
119+
m_pDLSSFeature = nullptr;
120+
}
121+
m_DLSSFeatureFlags = DLSSCreateFeatureFlags;
114122

115123
NVSDK_NGX_DLSS_Create_Params DLSSCreateParams = {};
116124
DLSSCreateParams.Feature.InWidth = m_Desc.InputWidth;
@@ -119,16 +127,23 @@ class SuperResolutionD3D11_DLSS final : public SuperResolutionBase
119127
DLSSCreateParams.Feature.InTargetHeight = m_Desc.OutputHeight;
120128
DLSSCreateParams.InFeatureCreateFlags = DLSSCreateFeatureFlags;
121129

130+
NVSDK_NGX_Handle* pFeature = nullptr;
122131
ID3D11DeviceContext* pd3d11Ctx = ClassPtrCast<DeviceContextD3D11Impl>(Attribs.pContext)->GetD3D11DeviceContext();
123-
NVSDK_NGX_Result Result = NGX_D3D11_CREATE_DLSS_EXT(pd3d11Ctx, &m_pDLSSFeature, m_pNGXParams, &DLSSCreateParams);
132+
NVSDK_NGX_Result Result = NGX_D3D11_CREATE_DLSS_EXT(pd3d11Ctx, &pFeature, m_pNGXParams, &DLSSCreateParams);
124133

125134
if (NVSDK_NGX_FAILED(Result))
126-
LOG_ERROR_AND_THROW("Failed to create DLSS D3D11 feature. NGX Result: ", static_cast<Uint32>(Result));
135+
{
136+
LOG_ERROR_MESSAGE("Failed to create DLSS D3D11 feature. NGX Result: ", static_cast<Uint32>(Result));
137+
return nullptr;
138+
}
139+
m_pDLSSFeature = pFeature;
140+
return m_pDLSSFeature;
127141
}
128142

129143
RefCntAutoPtr<IRenderDevice> m_pDevice;
130-
NVSDK_NGX_Handle* m_pDLSSFeature = nullptr;
131-
NVSDK_NGX_Parameter* m_pNGXParams = nullptr;
144+
NVSDK_NGX_Handle* m_pDLSSFeature = nullptr;
145+
NVSDK_NGX_Parameter* m_pNGXParams = nullptr;
146+
Int32 m_DLSSFeatureFlags = 0;
132147
};
133148

134149
class DLSSProviderD3D11 final : public SuperResolutionProvider
@@ -140,18 +155,27 @@ class DLSSProviderD3D11 final : public SuperResolutionProvider
140155
ID3D11Device* pd3d11Device = ClassPtrCast<RenderDeviceD3D11Impl>(pDevice)->GetD3D11Device();
141156
NVSDK_NGX_Result Result = NVSDK_NGX_D3D11_Init_with_ProjectID(DLSSProjectId, NVSDK_NGX_ENGINE_TYPE_CUSTOM, "0", DLSSAppDataPath, pd3d11Device);
142157
if (NVSDK_NGX_FAILED(Result))
143-
LOG_ERROR_AND_THROW("NVIDIA NGX D3D11 initialization failed. Result: ", static_cast<Uint32>(Result));
158+
{
159+
LOG_WARNING_MESSAGE("NVIDIA NGX D3D11 initialization failed. DLSS will not be available. Result: ", static_cast<Uint32>(Result));
160+
return;
161+
}
144162

145163
Result = NVSDK_NGX_D3D11_GetCapabilityParameters(&m_pNGXParams);
146164
if (NVSDK_NGX_FAILED(Result) || m_pNGXParams == nullptr)
147-
LOG_ERROR_AND_THROW("Failed to get NGX D3D11 capability parameters. Result: ", static_cast<Uint32>(Result));
165+
{
166+
LOG_WARNING_MESSAGE("Failed to get NGX D3D11 capability parameters. DLSS will not be available. Result: ", static_cast<Uint32>(Result));
167+
m_pNGXParams = nullptr;
168+
NVSDK_NGX_D3D11_Shutdown1(pd3d11Device);
169+
}
148170
}
149171

150172
~DLSSProviderD3D11()
151173
{
152174
if (m_pNGXParams != nullptr)
175+
{
153176
NVSDK_NGX_D3D11_DestroyParameters(m_pNGXParams);
154-
NVSDK_NGX_D3D11_Shutdown1(ClassPtrCast<RenderDeviceD3D11Impl>(m_pDevice.RawPtr())->GetD3D11Device());
177+
NVSDK_NGX_D3D11_Shutdown1(ClassPtrCast<RenderDeviceD3D11Impl>(m_pDevice.RawPtr())->GetD3D11Device());
178+
}
155179
}
156180

157181
virtual void EnumerateVariants(std::vector<SuperResolutionInfo>& Variants) override final

Graphics/SuperResolution/src/DLSSProviderD3D12.cpp

Lines changed: 38 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -68,8 +68,9 @@ class SuperResolutionD3D12_DLSS final : public SuperResolutionBase
6868
{
6969
ValidateTemporalExecuteSuperResolutionAttribs(m_Desc, Attribs);
7070

71-
if (m_pDLSSFeature == nullptr)
72-
CreateFeature(Attribs);
71+
NVSDK_NGX_Handle* pDLSSFeature = AcquireFeature(Attribs);
72+
if (pDLSSFeature == nullptr)
73+
return;
7374

7475
DeviceContextD3D12Impl* pCtxImpl = ClassPtrCast<DeviceContextD3D12Impl>(Attribs.pContext);
7576

@@ -111,7 +112,7 @@ class SuperResolutionD3D12_DLSS final : public SuperResolutionBase
111112
EvalParams.InPreExposure = Attribs.PreExposure;
112113
EvalParams.InExposureScale = Attribs.ExposureScale;
113114

114-
NVSDK_NGX_Result Result = NGX_D3D12_EVALUATE_DLSS_EXT(pCmdList, m_pDLSSFeature, m_pNGXParams, &EvalParams);
115+
NVSDK_NGX_Result Result = NGX_D3D12_EVALUATE_DLSS_EXT(pCmdList, pDLSSFeature, m_pNGXParams, &EvalParams);
115116
if (NVSDK_NGX_FAILED(Result))
116117
LOG_ERROR_MESSAGE("DLSS D3D12 evaluation failed. NGX Result: ", static_cast<Uint32>(Result));
117118

@@ -120,11 +121,18 @@ class SuperResolutionD3D12_DLSS final : public SuperResolutionBase
120121
}
121122

122123
private:
123-
void CreateFeature(const ExecuteSuperResolutionAttribs& Attribs)
124+
NVSDK_NGX_Handle* AcquireFeature(const ExecuteSuperResolutionAttribs& Attribs)
124125
{
125-
Int32 DLSSCreateFeatureFlags = SuperResolutionFlagsToDLSSFeatureFlags(m_Desc.Flags);
126-
if (Attribs.CameraNear > Attribs.CameraFar)
127-
DLSSCreateFeatureFlags |= NVSDK_NGX_DLSS_Feature_Flags_DepthInverted;
126+
const Int32 DLSSCreateFeatureFlags = ComputeDLSSFeatureFlags(m_Desc.Flags, Attribs);
127+
if (m_pDLSSFeature != nullptr && m_DLSSFeatureFlags == DLSSCreateFeatureFlags)
128+
return m_pDLSSFeature;
129+
130+
if (m_pDLSSFeature != nullptr)
131+
{
132+
NVSDK_NGX_D3D12_ReleaseFeature(m_pDLSSFeature);
133+
m_pDLSSFeature = nullptr;
134+
}
135+
m_DLSSFeatureFlags = DLSSCreateFeatureFlags;
128136

129137
NVSDK_NGX_DLSS_Create_Params DLSSCreateParams = {};
130138
DLSSCreateParams.Feature.InWidth = m_Desc.InputWidth;
@@ -133,16 +141,23 @@ class SuperResolutionD3D12_DLSS final : public SuperResolutionBase
133141
DLSSCreateParams.Feature.InTargetHeight = m_Desc.OutputHeight;
134142
DLSSCreateParams.InFeatureCreateFlags = DLSSCreateFeatureFlags;
135143

144+
NVSDK_NGX_Handle* pFeature = nullptr;
136145
ID3D12GraphicsCommandList* pCmdList = ClassPtrCast<DeviceContextD3D12Impl>(Attribs.pContext)->GetD3D12CommandList();
137-
NVSDK_NGX_Result Result = NGX_D3D12_CREATE_DLSS_EXT(pCmdList, 1, 1, &m_pDLSSFeature, m_pNGXParams, &DLSSCreateParams);
146+
NVSDK_NGX_Result Result = NGX_D3D12_CREATE_DLSS_EXT(pCmdList, 1, 1, &pFeature, m_pNGXParams, &DLSSCreateParams);
138147

139148
if (NVSDK_NGX_FAILED(Result))
140-
LOG_ERROR_AND_THROW("Failed to create DLSS D3D12 feature. NGX Result: ", static_cast<Uint32>(Result));
149+
{
150+
LOG_ERROR_MESSAGE("Failed to create DLSS D3D12 feature. NGX Result: ", static_cast<Uint32>(Result));
151+
return nullptr;
152+
}
153+
m_pDLSSFeature = pFeature;
154+
return m_pDLSSFeature;
141155
}
142156

143157
RefCntAutoPtr<IRenderDevice> m_pDevice;
144-
NVSDK_NGX_Handle* m_pDLSSFeature = nullptr;
145-
NVSDK_NGX_Parameter* m_pNGXParams = nullptr;
158+
NVSDK_NGX_Handle* m_pDLSSFeature = nullptr;
159+
NVSDK_NGX_Parameter* m_pNGXParams = nullptr;
160+
Int32 m_DLSSFeatureFlags = 0;
146161
};
147162

148163

@@ -155,18 +170,27 @@ class DLSSProviderD3D12 final : public SuperResolutionProvider
155170
ID3D12Device* pd3d12Device = ClassPtrCast<RenderDeviceD3D12Impl>(pDevice)->GetD3D12Device();
156171
NVSDK_NGX_Result Result = NVSDK_NGX_D3D12_Init_with_ProjectID(DLSSProjectId, NVSDK_NGX_ENGINE_TYPE_CUSTOM, "0", DLSSAppDataPath, pd3d12Device);
157172
if (NVSDK_NGX_FAILED(Result))
158-
LOG_ERROR_AND_THROW("NVIDIA NGX D3D12 initialization failed. Result: ", static_cast<Uint32>(Result));
173+
{
174+
LOG_WARNING_MESSAGE("NVIDIA NGX D3D12 initialization failed. DLSS will not be available. Result: ", static_cast<Uint32>(Result));
175+
return;
176+
}
159177

160178
Result = NVSDK_NGX_D3D12_GetCapabilityParameters(&m_pNGXParams);
161179
if (NVSDK_NGX_FAILED(Result) || m_pNGXParams == nullptr)
162-
LOG_ERROR_AND_THROW("Failed to get NGX D3D12 capability parameters. Result: ", static_cast<Uint32>(Result));
180+
{
181+
LOG_WARNING_MESSAGE("Failed to get NGX D3D12 capability parameters. DLSS will not be available. Result: ", static_cast<Uint32>(Result));
182+
m_pNGXParams = nullptr;
183+
NVSDK_NGX_D3D12_Shutdown1(pd3d12Device);
184+
}
163185
}
164186

165187
~DLSSProviderD3D12()
166188
{
167189
if (m_pNGXParams != nullptr)
190+
{
168191
NVSDK_NGX_D3D12_DestroyParameters(m_pNGXParams);
169-
NVSDK_NGX_D3D12_Shutdown1(ClassPtrCast<RenderDeviceD3D12Impl>(m_pDevice.RawPtr())->GetD3D12Device());
192+
NVSDK_NGX_D3D12_Shutdown1(ClassPtrCast<RenderDeviceD3D12Impl>(m_pDevice.RawPtr())->GetD3D12Device());
193+
}
170194
}
171195

172196
virtual void EnumerateVariants(std::vector<SuperResolutionInfo>& Variants) override final

Graphics/SuperResolution/src/DLSSProviderVk.cpp

Lines changed: 39 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -69,8 +69,9 @@ class SuperResolutionVk_DLSS final : public SuperResolutionBase
6969
{
7070
ValidateTemporalExecuteSuperResolutionAttribs(m_Desc, Attribs);
7171

72-
if (m_pDLSSFeature == nullptr)
73-
CreateFeature(Attribs);
72+
NVSDK_NGX_Handle* pDLSSFeature = AcquireFeature(Attribs);
73+
if (pDLSSFeature == nullptr)
74+
return;
7475

7576
DeviceContextVkImpl* pCtxImpl = ClassPtrCast<DeviceContextVkImpl>(Attribs.pContext);
7677

@@ -127,17 +128,24 @@ class SuperResolutionVk_DLSS final : public SuperResolutionBase
127128
EvalParams.InPreExposure = Attribs.PreExposure;
128129
EvalParams.InExposureScale = Attribs.ExposureScale;
129130

130-
NVSDK_NGX_Result Result = NGX_VULKAN_EVALUATE_DLSS_EXT(vkCmdBuffer, m_pDLSSFeature, m_pNGXParams, &EvalParams);
131+
NVSDK_NGX_Result Result = NGX_VULKAN_EVALUATE_DLSS_EXT(vkCmdBuffer, pDLSSFeature, m_pNGXParams, &EvalParams);
131132
if (NVSDK_NGX_FAILED(Result))
132133
LOG_ERROR_MESSAGE("DLSS Vulkan evaluation failed. NGX Result: ", static_cast<Uint32>(Result));
133134
}
134135

135136
private:
136-
void CreateFeature(const ExecuteSuperResolutionAttribs& Attribs)
137+
NVSDK_NGX_Handle* AcquireFeature(const ExecuteSuperResolutionAttribs& Attribs)
137138
{
138-
Int32 DLSSCreateFeatureFlags = SuperResolutionFlagsToDLSSFeatureFlags(m_Desc.Flags);
139-
if (Attribs.CameraNear > Attribs.CameraFar)
140-
DLSSCreateFeatureFlags |= NVSDK_NGX_DLSS_Feature_Flags_DepthInverted;
139+
const Int32 DLSSCreateFeatureFlags = ComputeDLSSFeatureFlags(m_Desc.Flags, Attribs);
140+
if (m_pDLSSFeature != nullptr && m_DLSSFeatureFlags == DLSSCreateFeatureFlags)
141+
return m_pDLSSFeature;
142+
143+
if (m_pDLSSFeature != nullptr)
144+
{
145+
NVSDK_NGX_VULKAN_ReleaseFeature(m_pDLSSFeature);
146+
m_pDLSSFeature = nullptr;
147+
}
148+
m_DLSSFeatureFlags = DLSSCreateFeatureFlags;
141149

142150
NVSDK_NGX_DLSS_Create_Params DLSSCreateParams = {};
143151
DLSSCreateParams.Feature.InWidth = m_Desc.InputWidth;
@@ -146,16 +154,23 @@ class SuperResolutionVk_DLSS final : public SuperResolutionBase
146154
DLSSCreateParams.Feature.InTargetHeight = m_Desc.OutputHeight;
147155
DLSSCreateParams.InFeatureCreateFlags = DLSSCreateFeatureFlags;
148156

149-
VkCommandBuffer vkCmdBuffer = ClassPtrCast<DeviceContextVkImpl>(Attribs.pContext)->GetVkCommandBuffer();
150-
NVSDK_NGX_Result Result = NGX_VULKAN_CREATE_DLSS_EXT(vkCmdBuffer, 1, 1, &m_pDLSSFeature, m_pNGXParams, &DLSSCreateParams);
157+
NVSDK_NGX_Handle* pFeature = nullptr;
158+
VkCommandBuffer vkCmdBuffer = ClassPtrCast<DeviceContextVkImpl>(Attribs.pContext)->GetVkCommandBuffer();
159+
NVSDK_NGX_Result Result = NGX_VULKAN_CREATE_DLSS_EXT(vkCmdBuffer, 1, 1, &pFeature, m_pNGXParams, &DLSSCreateParams);
151160

152161
if (NVSDK_NGX_FAILED(Result))
153-
LOG_ERROR_AND_THROW("Failed to create DLSS Vulkan feature. NGX Result: ", static_cast<Uint32>(Result));
162+
{
163+
LOG_ERROR_MESSAGE("Failed to create DLSS Vulkan feature. NGX Result: ", static_cast<Uint32>(Result));
164+
return nullptr;
165+
}
166+
m_pDLSSFeature = pFeature;
167+
return m_pDLSSFeature;
154168
}
155169

156170
RefCntAutoPtr<IRenderDevice> m_pDevice;
157-
NVSDK_NGX_Handle* m_pDLSSFeature = nullptr;
158-
NVSDK_NGX_Parameter* m_pNGXParams = nullptr;
171+
NVSDK_NGX_Handle* m_pDLSSFeature = nullptr;
172+
NVSDK_NGX_Parameter* m_pNGXParams = nullptr;
173+
Int32 m_DLSSFeatureFlags = 0;
159174
};
160175

161176

@@ -195,18 +210,27 @@ class DLSSProviderVk final : public SuperResolutionProvider
195210
}
196211

197212
if (NVSDK_NGX_FAILED(Result))
198-
LOG_ERROR_AND_THROW("NVIDIA NGX Vulkan initialization failed. Result: ", static_cast<Uint32>(Result));
213+
{
214+
LOG_WARNING_MESSAGE("NVIDIA NGX Vulkan initialization failed. DLSS will not be available. Result: ", static_cast<Uint32>(Result));
215+
return;
216+
}
199217

200218
Result = NVSDK_NGX_VULKAN_GetCapabilityParameters(&m_pNGXParams);
201219
if (NVSDK_NGX_FAILED(Result) || m_pNGXParams == nullptr)
202-
LOG_ERROR_AND_THROW("Failed to get NGX Vulkan capability parameters. Result: ", static_cast<Uint32>(Result));
220+
{
221+
LOG_WARNING_MESSAGE("Failed to get NGX Vulkan capability parameters. DLSS will not be available. Result: ", static_cast<Uint32>(Result));
222+
m_pNGXParams = nullptr;
223+
NVSDK_NGX_VULKAN_Shutdown1(vkDevice);
224+
}
203225
}
204226

205227
~DLSSProviderVk()
206228
{
207229
if (m_pNGXParams != nullptr)
230+
{
208231
NVSDK_NGX_VULKAN_DestroyParameters(m_pNGXParams);
209-
NVSDK_NGX_VULKAN_Shutdown1(ClassPtrCast<RenderDeviceVkImpl>(m_pDevice.RawPtr())->GetVkDevice());
232+
NVSDK_NGX_VULKAN_Shutdown1(ClassPtrCast<RenderDeviceVkImpl>(m_pDevice.RawPtr())->GetVkDevice());
233+
}
210234
}
211235

212236
void EnumerateVariants(std::vector<SuperResolutionInfo>& Variants)

Graphics/SuperResolution/src/SuperResolutionDLSS.cpp

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,14 +54,16 @@ NVSDK_NGX_PerfQuality_Value OptimizationTypeToNGXPerfQuality(SUPER_RESOLUTION_OP
5454
}
5555
}
5656

57-
Int32 SuperResolutionFlagsToDLSSFeatureFlags(SUPER_RESOLUTION_FLAGS Flags)
57+
Int32 ComputeDLSSFeatureFlags(SUPER_RESOLUTION_FLAGS Flags, const ExecuteSuperResolutionAttribs& Attribs)
5858
{
5959
Int32 DLSSFlags = NVSDK_NGX_DLSS_Feature_Flags_None;
6060

6161
if (Flags & SUPER_RESOLUTION_FLAG_AUTO_EXPOSURE)
6262
DLSSFlags |= NVSDK_NGX_DLSS_Feature_Flags_AutoExposure;
6363
if (Flags & SUPER_RESOLUTION_FLAG_ENABLE_SHARPENING)
6464
DLSSFlags |= NVSDK_NGX_DLSS_Feature_Flags_DoSharpening;
65+
if (Attribs.CameraNear > Attribs.CameraFar)
66+
DLSSFlags |= NVSDK_NGX_DLSS_Feature_Flags_DepthInverted;
6567

6668
DLSSFlags |= NVSDK_NGX_DLSS_Feature_Flags_MVLowRes;
6769
DLSSFlags |= NVSDK_NGX_DLSS_Feature_Flags_IsHDR;
@@ -71,7 +73,8 @@ Int32 SuperResolutionFlagsToDLSSFeatureFlags(SUPER_RESOLUTION_FLAGS Flags)
7173

7274
void EnumerateDLSSVariants(NVSDK_NGX_Parameter* pNGXParams, std::vector<SuperResolutionInfo>& Variants)
7375
{
74-
DEV_CHECK_ERR(pNGXParams != nullptr, "NGX parameters must not be null");
76+
if (pNGXParams == nullptr)
77+
return;
7578

7679
Int32 NeedsUpdatedDriver = 0;
7780
NVSDK_NGX_Parameter_GetI(pNGXParams, NVSDK_NGX_Parameter_SuperSampling_NeedsUpdatedDriver, &NeedsUpdatedDriver);

0 commit comments

Comments
 (0)