Skip to content

Commit 9814565

Browse files
committed
cleanup some unused code
1 parent 50ea2b0 commit 9814565

File tree

5 files changed

+2
-87
lines changed

5 files changed

+2
-87
lines changed

OptiScaler/backends/dlss/DLSSFeature_Dx12.cpp

-17
Original file line numberDiff line numberDiff line change
@@ -155,23 +155,6 @@ bool DLSSFeatureDx12::Evaluate(ID3D12GraphicsCommandList* InCommandList, const N
155155

156156
if (_EvaluateFeature != nullptr)
157157
{
158-
if (Config::Instance()->changeRCAS)
159-
{
160-
if (RCAS != nullptr && RCAS.get() != nullptr)
161-
{
162-
spdlog::trace("DLSSFeatureDx12::Evaluate sleeping before CAS.reset() for 250ms");
163-
std::this_thread::sleep_for(std::chrono::milliseconds(250));
164-
RCAS.reset();
165-
}
166-
else
167-
{
168-
Config::Instance()->changeRCAS = false;
169-
spdlog::trace("DLSSFeatureDx12::Evaluate sleeping before CAS creation for 250ms");
170-
std::this_thread::sleep_for(std::chrono::milliseconds(250));
171-
RCAS = std::make_unique<RCAS_Dx12>("RCAS", Device);
172-
}
173-
}
174-
175158
ProcessEvaluateParams(InParameters);
176159

177160
ID3D12Resource* paramOutput = nullptr;

OptiScaler/backends/fsr2/FSR2Feature_Dx11On12.cpp

-17
Original file line numberDiff line numberDiff line change
@@ -134,23 +134,6 @@ bool FSR2FeatureDx11on12::Evaluate(ID3D11DeviceContext* InDeviceContext, const N
134134
Dx11DeviceContext = dc;
135135
}
136136

137-
if (Config::Instance()->changeRCAS)
138-
{
139-
if (RCAS != nullptr && RCAS.get() != nullptr)
140-
{
141-
spdlog::trace("FSR2FeatureDx11on12::Evaluate sleeping before RCAS.reset() for 250ms");
142-
std::this_thread::sleep_for(std::chrono::milliseconds(250));
143-
RCAS.reset();
144-
}
145-
else
146-
{
147-
Config::Instance()->changeRCAS = false;
148-
spdlog::trace("FSR2FeatureDx11on12::Evaluate sleeping before RCAS creation for 250ms");
149-
std::this_thread::sleep_for(std::chrono::milliseconds(250));
150-
RCAS = std::make_unique<RCAS_Dx12>("RCAS", Dx12Device);
151-
}
152-
}
153-
154137
FfxFsr2DispatchDescription params{};
155138

156139
InParameters->Get(NVSDK_NGX_Parameter_Jitter_Offset_X, &params.jitterOffset.x);

OptiScaler/backends/fsr2_212/FSR2Feature_Dx11On12_212.cpp

-17
Original file line numberDiff line numberDiff line change
@@ -132,23 +132,6 @@ bool FSR2FeatureDx11on12_212::Evaluate(ID3D11DeviceContext* InDeviceContext, con
132132
Dx11DeviceContext = dc;
133133
}
134134

135-
if (Config::Instance()->changeRCAS)
136-
{
137-
if (RCAS != nullptr && RCAS.get() != nullptr)
138-
{
139-
spdlog::trace("FSR2FeatureDx11on12_212::Evaluate sleeping before RCAS.reset() for 250ms");
140-
std::this_thread::sleep_for(std::chrono::milliseconds(250));
141-
RCAS.reset();
142-
}
143-
else
144-
{
145-
Config::Instance()->changeRCAS = false;
146-
spdlog::trace("FSR2FeatureDx11on12_212::Evaluate sleeping before RCAS creation for 250ms");
147-
std::this_thread::sleep_for(std::chrono::milliseconds(250));
148-
RCAS = std::make_unique<RCAS_Dx12>("RCAS", Dx12Device);
149-
}
150-
}
151-
152135
Fsr212::FfxFsr2DispatchDescription params{};
153136

154137
InParameters->Get(NVSDK_NGX_Parameter_Jitter_Offset_X, &params.jitterOffset.x);

OptiScaler/backends/xess/XeSSFeature_Dx11.cpp

+2-19
Original file line numberDiff line numberDiff line change
@@ -167,23 +167,6 @@ bool XeSSFeatureDx11::Evaluate(ID3D11DeviceContext* InDeviceContext, const NVSDK
167167
dumpCount += Config::Instance()->xessDebugFrames;
168168
}
169169

170-
if (Config::Instance()->changeRCAS)
171-
{
172-
if (RCAS != nullptr && RCAS.get() != nullptr)
173-
{
174-
spdlog::trace("XeSSFeatureDx11::Evaluate sleeping before CAS.reset() for 250ms");
175-
std::this_thread::sleep_for(std::chrono::milliseconds(250));
176-
RCAS.reset();
177-
}
178-
else
179-
{
180-
Config::Instance()->changeRCAS = false;
181-
spdlog::trace("XeSSFeatureDx11::Evaluate sleeping before CAS creation for 250ms");
182-
std::this_thread::sleep_for(std::chrono::milliseconds(250));
183-
RCAS = std::make_unique<RCAS_Dx12>("RCAS", Dx12Device);
184-
}
185-
}
186-
187170
// creatimg params for XeSS
188171
xess_result_t xessResult;
189172
xess_d3d12_execute_params_t params{};
@@ -259,7 +242,7 @@ bool XeSSFeatureDx11::Evaluate(ID3D11DeviceContext* InDeviceContext, const NVSDK
259242
// RCAS
260243
if (!Config::Instance()->changeRCAS &&
261244
Config::Instance()->RcasEnabled.value_or(true) &&
262-
sharpness > 0.0f &&
245+
(sharpness > 0.0f || Config::Instance()->MotionSharpnessEnabled.value_or(false)) &&
263246
RCAS != nullptr && RCAS.get() != nullptr &&
264247
RCAS->CreateBufferResource(Dx12Device, params.pOutputTexture, D3D12_RESOURCE_STATE_UNORDERED_ACCESS))
265248
{
@@ -326,13 +309,13 @@ bool XeSSFeatureDx11::Evaluate(ID3D11DeviceContext* InDeviceContext, const NVSDK
326309
RCAS != nullptr && RCAS.get() != nullptr)
327310
{
328311
spdlog::debug("XeSSFeatureDx11::Evaluate Apply CAS");
312+
329313
if (params.pOutputTexture != RCAS->Buffer())
330314
ResourceBarrier(Dx12CommandList, params.pOutputTexture, D3D12_RESOURCE_STATE_UNORDERED_ACCESS, D3D12_RESOURCE_STATE_NON_PIXEL_SHADER_RESOURCE);
331315

332316
RCAS->SetBufferState(Dx12CommandList, D3D12_RESOURCE_STATE_NON_PIXEL_SHADER_RESOURCE);
333317

334318
RcasConstants rcasConstants{};
335-
336319
rcasConstants.Sharpness = sharpness;
337320
rcasConstants.DisplayWidth = DisplayWidth();
338321
rcasConstants.DisplayHeight = DisplayHeight();

OptiScaler/backends/xess/XeSSFeature_Dx12.cpp

-17
Original file line numberDiff line numberDiff line change
@@ -55,23 +55,6 @@ bool XeSSFeatureDx12::Evaluate(ID3D12GraphicsCommandList* InCommandList, const N
5555
dumpCount += Config::Instance()->xessDebugFrames;
5656
}
5757

58-
if (Config::Instance()->changeRCAS)
59-
{
60-
if (RCAS != nullptr && RCAS.get() != nullptr)
61-
{
62-
spdlog::trace("XeSSFeatureDx12::Evaluate sleeping before RCAS.reset() for 250ms");
63-
std::this_thread::sleep_for(std::chrono::milliseconds(250));
64-
RCAS.reset();
65-
}
66-
else
67-
{
68-
Config::Instance()->changeRCAS = false;
69-
spdlog::trace("XeSSFeatureDx12::Evaluate sleeping before CAS creation for 250ms");
70-
std::this_thread::sleep_for(std::chrono::milliseconds(250));
71-
RCAS = std::make_unique<RCAS_Dx12>("RCAS", Device);
72-
}
73-
}
74-
7558
xess_result_t xessResult;
7659
xess_d3d12_execute_params_t params{};
7760

0 commit comments

Comments
 (0)