Skip to content

Commit

Permalink
cleanup some unused code
Browse files Browse the repository at this point in the history
  • Loading branch information
cdozdil committed May 18, 2024
1 parent 50ea2b0 commit 9814565
Show file tree
Hide file tree
Showing 5 changed files with 2 additions and 87 deletions.
17 changes: 0 additions & 17 deletions OptiScaler/backends/dlss/DLSSFeature_Dx12.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -155,23 +155,6 @@ bool DLSSFeatureDx12::Evaluate(ID3D12GraphicsCommandList* InCommandList, const N

if (_EvaluateFeature != nullptr)
{
if (Config::Instance()->changeRCAS)
{
if (RCAS != nullptr && RCAS.get() != nullptr)
{
spdlog::trace("DLSSFeatureDx12::Evaluate sleeping before CAS.reset() for 250ms");
std::this_thread::sleep_for(std::chrono::milliseconds(250));
RCAS.reset();
}
else
{
Config::Instance()->changeRCAS = false;
spdlog::trace("DLSSFeatureDx12::Evaluate sleeping before CAS creation for 250ms");
std::this_thread::sleep_for(std::chrono::milliseconds(250));
RCAS = std::make_unique<RCAS_Dx12>("RCAS", Device);
}
}

ProcessEvaluateParams(InParameters);

ID3D12Resource* paramOutput = nullptr;
Expand Down
17 changes: 0 additions & 17 deletions OptiScaler/backends/fsr2/FSR2Feature_Dx11On12.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -134,23 +134,6 @@ bool FSR2FeatureDx11on12::Evaluate(ID3D11DeviceContext* InDeviceContext, const N
Dx11DeviceContext = dc;
}

if (Config::Instance()->changeRCAS)
{
if (RCAS != nullptr && RCAS.get() != nullptr)
{
spdlog::trace("FSR2FeatureDx11on12::Evaluate sleeping before RCAS.reset() for 250ms");
std::this_thread::sleep_for(std::chrono::milliseconds(250));
RCAS.reset();
}
else
{
Config::Instance()->changeRCAS = false;
spdlog::trace("FSR2FeatureDx11on12::Evaluate sleeping before RCAS creation for 250ms");
std::this_thread::sleep_for(std::chrono::milliseconds(250));
RCAS = std::make_unique<RCAS_Dx12>("RCAS", Dx12Device);
}
}

FfxFsr2DispatchDescription params{};

InParameters->Get(NVSDK_NGX_Parameter_Jitter_Offset_X, &params.jitterOffset.x);
Expand Down
17 changes: 0 additions & 17 deletions OptiScaler/backends/fsr2_212/FSR2Feature_Dx11On12_212.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -132,23 +132,6 @@ bool FSR2FeatureDx11on12_212::Evaluate(ID3D11DeviceContext* InDeviceContext, con
Dx11DeviceContext = dc;
}

if (Config::Instance()->changeRCAS)
{
if (RCAS != nullptr && RCAS.get() != nullptr)
{
spdlog::trace("FSR2FeatureDx11on12_212::Evaluate sleeping before RCAS.reset() for 250ms");
std::this_thread::sleep_for(std::chrono::milliseconds(250));
RCAS.reset();
}
else
{
Config::Instance()->changeRCAS = false;
spdlog::trace("FSR2FeatureDx11on12_212::Evaluate sleeping before RCAS creation for 250ms");
std::this_thread::sleep_for(std::chrono::milliseconds(250));
RCAS = std::make_unique<RCAS_Dx12>("RCAS", Dx12Device);
}
}

Fsr212::FfxFsr2DispatchDescription params{};

InParameters->Get(NVSDK_NGX_Parameter_Jitter_Offset_X, &params.jitterOffset.x);
Expand Down
21 changes: 2 additions & 19 deletions OptiScaler/backends/xess/XeSSFeature_Dx11.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -167,23 +167,6 @@ bool XeSSFeatureDx11::Evaluate(ID3D11DeviceContext* InDeviceContext, const NVSDK
dumpCount += Config::Instance()->xessDebugFrames;
}

if (Config::Instance()->changeRCAS)
{
if (RCAS != nullptr && RCAS.get() != nullptr)
{
spdlog::trace("XeSSFeatureDx11::Evaluate sleeping before CAS.reset() for 250ms");
std::this_thread::sleep_for(std::chrono::milliseconds(250));
RCAS.reset();
}
else
{
Config::Instance()->changeRCAS = false;
spdlog::trace("XeSSFeatureDx11::Evaluate sleeping before CAS creation for 250ms");
std::this_thread::sleep_for(std::chrono::milliseconds(250));
RCAS = std::make_unique<RCAS_Dx12>("RCAS", Dx12Device);
}
}

// creatimg params for XeSS
xess_result_t xessResult;
xess_d3d12_execute_params_t params{};
Expand Down Expand Up @@ -259,7 +242,7 @@ bool XeSSFeatureDx11::Evaluate(ID3D11DeviceContext* InDeviceContext, const NVSDK
// RCAS
if (!Config::Instance()->changeRCAS &&
Config::Instance()->RcasEnabled.value_or(true) &&
sharpness > 0.0f &&
(sharpness > 0.0f || Config::Instance()->MotionSharpnessEnabled.value_or(false)) &&
RCAS != nullptr && RCAS.get() != nullptr &&
RCAS->CreateBufferResource(Dx12Device, params.pOutputTexture, D3D12_RESOURCE_STATE_UNORDERED_ACCESS))
{
Expand Down Expand Up @@ -326,13 +309,13 @@ bool XeSSFeatureDx11::Evaluate(ID3D11DeviceContext* InDeviceContext, const NVSDK
RCAS != nullptr && RCAS.get() != nullptr)
{
spdlog::debug("XeSSFeatureDx11::Evaluate Apply CAS");

if (params.pOutputTexture != RCAS->Buffer())
ResourceBarrier(Dx12CommandList, params.pOutputTexture, D3D12_RESOURCE_STATE_UNORDERED_ACCESS, D3D12_RESOURCE_STATE_NON_PIXEL_SHADER_RESOURCE);

RCAS->SetBufferState(Dx12CommandList, D3D12_RESOURCE_STATE_NON_PIXEL_SHADER_RESOURCE);

RcasConstants rcasConstants{};

rcasConstants.Sharpness = sharpness;
rcasConstants.DisplayWidth = DisplayWidth();
rcasConstants.DisplayHeight = DisplayHeight();
Expand Down
17 changes: 0 additions & 17 deletions OptiScaler/backends/xess/XeSSFeature_Dx12.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -55,23 +55,6 @@ bool XeSSFeatureDx12::Evaluate(ID3D12GraphicsCommandList* InCommandList, const N
dumpCount += Config::Instance()->xessDebugFrames;
}

if (Config::Instance()->changeRCAS)
{
if (RCAS != nullptr && RCAS.get() != nullptr)
{
spdlog::trace("XeSSFeatureDx12::Evaluate sleeping before RCAS.reset() for 250ms");
std::this_thread::sleep_for(std::chrono::milliseconds(250));
RCAS.reset();
}
else
{
Config::Instance()->changeRCAS = false;
spdlog::trace("XeSSFeatureDx12::Evaluate sleeping before CAS creation for 250ms");
std::this_thread::sleep_for(std::chrono::milliseconds(250));
RCAS = std::make_unique<RCAS_Dx12>("RCAS", Device);
}
}

xess_result_t xessResult;
xess_d3d12_execute_params_t params{};

Expand Down

0 comments on commit 9814565

Please sign in to comment.