more scale < 1.0 fixes

This commit is contained in:
cdozdil
2024-07-31 01:26:10 +03:00
parent 4a15cba9d9
commit 57b7482d6f
8 changed files with 37 additions and 31 deletions
@@ -656,6 +656,8 @@ bool FSR2FeatureDx11on12::InitFSR2(const NVSDK_NGX_Parameter* InParameters)
_contextDesc.maxRenderSize.width = RenderWidth();
_contextDesc.maxRenderSize.height = RenderHeight();
Config::Instance()->OutputScalingMultiplier = 1.0f;
// if output scaling active let it to handle downsampling
if (Config::Instance()->OutputScalingEnabled.value_or(false) && !Config::Instance()->DisplayResolution.value_or(false))
{
@@ -663,8 +665,8 @@ bool FSR2FeatureDx11on12::InitFSR2(const NVSDK_NGX_Parameter* InParameters)
_contextDesc.displaySize.height = _contextDesc.maxRenderSize.height;
// update target res
_targetWidth = _contextDesc.displaySize.width;
_targetHeight = _contextDesc.displaySize.height;
_targetWidth = _contextDesc.maxRenderSize.width;
_targetHeight = _contextDesc.maxRenderSize.height;
}
else
{
@@ -27,7 +27,7 @@ bool FSR2FeatureDx12::Init(ID3D12Device* InDevice, ID3D12GraphicsCommandList* In
return false;
}
bool FSR2FeatureDx12::Evaluate(ID3D12GraphicsCommandList* InCommandList, NVSDK_NGX_Parameter* InParameters)
{
LOG_FUNC();
@@ -256,7 +256,7 @@ bool FSR2FeatureDx12::Evaluate(ID3D12GraphicsCommandList* InCommandList, NVSDK_N
if (Config::Instance()->FsrUseMaskForTransparency.value_or(true))
params.transparencyAndComposition = ffxGetResourceDX12(&_context, paramReactiveMask, (wchar_t*)L"FSR2_Transparency", FFX_RESOURCE_STATE_COMPUTE_READ);
if (Config::Instance()->DlssReactiveMaskBias.value_or(0.45f) > 0.0f &&
if (Config::Instance()->DlssReactiveMaskBias.value_or(0.45f) > 0.0f &&
Bias->IsInit() && Bias->CreateBufferResource(Device, paramReactiveMask, D3D12_RESOURCE_STATE_UNORDERED_ACCESS) && Bias->CanRender())
{
Bias->SetBufferState(InCommandList, D3D12_RESOURCE_STATE_UNORDERED_ACCESS);
@@ -597,15 +597,18 @@ bool FSR2FeatureDx12::InitFSR2(const NVSDK_NGX_Parameter* InParameters)
_contextDesc.maxRenderSize.width = RenderWidth();
_contextDesc.maxRenderSize.height = RenderHeight();
Config::Instance()->OutputScalingMultiplier = 1.0f;
// if output scaling active let it to handle downsampling
if (Config::Instance()->OutputScalingEnabled.value_or(false) && !Config::Instance()->DisplayResolution.value_or(false))
{
_contextDesc.displaySize.width = _contextDesc.maxRenderSize.width;
_contextDesc.displaySize.height = _contextDesc.maxRenderSize.height;
// update target res
_targetWidth = _contextDesc.displaySize.width;
_targetHeight = _contextDesc.displaySize.height;
_targetWidth = _contextDesc.maxRenderSize.width;
_targetHeight = _contextDesc.maxRenderSize.height;
}
else
{
@@ -621,9 +624,6 @@ bool FSR2FeatureDx12::InitFSR2(const NVSDK_NGX_Parameter* InParameters)
_contextDesc.displaySize.height = TargetHeight();
}
_contextDesc.displaySize.width = TargetWidth();
_contextDesc.displaySize.height = TargetHeight();
#if _DEBUG
_contextDesc.flags |= FFX_FSR2_ENABLE_DEBUG_CHECKING;
_contextDesc.fpMessage = FfxLogCallback;
@@ -231,7 +231,7 @@ bool FSR2FeatureDx11on12_212::Evaluate(ID3D11DeviceContext* InDeviceContext, NVS
{
Bias->SetBufferState(Dx12CommandList, D3D12_RESOURCE_STATE_UNORDERED_ACCESS);
if (Config::Instance()->DlssReactiveMaskBias.value_or(0.45f) > 0.0f &&
if (Config::Instance()->DlssReactiveMaskBias.value_or(0.45f) > 0.0f &&
Bias->Dispatch(Dx12Device, Dx12CommandList, dx11Reactive.Dx12Resource, Config::Instance()->DlssReactiveMaskBias.value_or(0.45f), Bias->Buffer()))
{
Bias->SetBufferState(Dx12CommandList, D3D12_RESOURCE_STATE_NON_PIXEL_SHADER_RESOURCE);
@@ -661,6 +661,8 @@ bool FSR2FeatureDx11on12_212::InitFSR2(const NVSDK_NGX_Parameter* InParameters)
_contextDesc.maxRenderSize.width = RenderWidth();
_contextDesc.maxRenderSize.height = RenderHeight();
Config::Instance()->OutputScalingMultiplier = 1.0f;
// if output scaling active let it to handle downsampling
if (Config::Instance()->OutputScalingEnabled.value_or(false) && !Config::Instance()->DisplayResolution.value_or(false))
{
@@ -668,8 +670,8 @@ bool FSR2FeatureDx11on12_212::InitFSR2(const NVSDK_NGX_Parameter* InParameters)
_contextDesc.displaySize.height = _contextDesc.maxRenderSize.height;
// update target res
_targetWidth = _contextDesc.displaySize.width;
_targetHeight = _contextDesc.displaySize.height;
_targetWidth = _contextDesc.maxRenderSize.width;
_targetHeight = _contextDesc.maxRenderSize.height;
}
else
{
@@ -685,9 +687,6 @@ bool FSR2FeatureDx11on12_212::InitFSR2(const NVSDK_NGX_Parameter* InParameters)
_contextDesc.displaySize.height = TargetHeight();
}
_contextDesc.displaySize.width = TargetWidth();
_contextDesc.displaySize.height = TargetHeight();
LOG_DEBUG("ffxFsr2ContextCreate!");
auto ret = Fsr212::ffxFsr2ContextCreate212(&_context, &_contextDesc);
@@ -579,6 +579,8 @@ bool FSR2FeatureDx12_212::InitFSR2(const NVSDK_NGX_Parameter* InParameters)
_contextDesc.maxRenderSize.width = RenderWidth();
_contextDesc.maxRenderSize.height = RenderHeight();
Config::Instance()->OutputScalingMultiplier = 1.0f;
// if output scaling active let it to handle downsampling
if (Config::Instance()->OutputScalingEnabled.value_or(false) && !Config::Instance()->DisplayResolution.value_or(false))
{
@@ -586,8 +588,8 @@ bool FSR2FeatureDx12_212::InitFSR2(const NVSDK_NGX_Parameter* InParameters)
_contextDesc.displaySize.height = _contextDesc.maxRenderSize.height;
// update target res
_targetWidth = _contextDesc.displaySize.width;
_targetHeight = _contextDesc.displaySize.height;
_targetWidth = _contextDesc.maxRenderSize.width;
_targetHeight = _contextDesc.maxRenderSize.height;
}
else
{
@@ -603,9 +605,6 @@ bool FSR2FeatureDx12_212::InitFSR2(const NVSDK_NGX_Parameter* InParameters)
_contextDesc.displaySize.height = TargetHeight();
}
_contextDesc.displaySize.width = TargetWidth();
_contextDesc.displaySize.height = TargetHeight();
LOG_DEBUG("ffxFsr2ContextCreate!");
auto ret = Fsr212::ffxFsr2ContextCreate212(&_context, &_contextDesc);
@@ -267,7 +267,7 @@ bool FSR31FeatureDx11on12::Evaluate(ID3D11DeviceContext* InDeviceContext, NVSDK_
if (Config::Instance()->FsrUseMaskForTransparency.value_or(true))
params.transparencyAndComposition = ffxApiGetResourceDX12(dx11Reactive.Dx12Resource, FFX_API_RESOURCE_STATE_COMPUTE_READ);
if (Config::Instance()->DlssReactiveMaskBias.value_or(0.45f) > 0.0f &&
if (Config::Instance()->DlssReactiveMaskBias.value_or(0.45f) > 0.0f &&
Bias->IsInit() && Bias->CreateBufferResource(Dx12Device, dx11Reactive.Dx12Resource, D3D12_RESOURCE_STATE_UNORDERED_ACCESS) && Bias->CanRender())
{
Bias->SetBufferState(Dx12CommandList, D3D12_RESOURCE_STATE_UNORDERED_ACCESS);
@@ -712,6 +712,8 @@ bool FSR31FeatureDx11on12::InitFSR3(const NVSDK_NGX_Parameter* InParameters)
_contextDesc.maxRenderSize.width = RenderWidth();
_contextDesc.maxRenderSize.height = RenderHeight();
Config::Instance()->OutputScalingMultiplier = 1.0f;
// if output scaling active let it to handle downsampling
if (Config::Instance()->OutputScalingEnabled.value_or(false) && !Config::Instance()->DisplayResolution.value_or(false))
{
@@ -719,8 +721,9 @@ bool FSR31FeatureDx11on12::InitFSR3(const NVSDK_NGX_Parameter* InParameters)
_contextDesc.maxUpscaleSize.height = _contextDesc.maxRenderSize.height;
// update target res
_targetWidth = _contextDesc.maxUpscaleSize.width;
_targetHeight = _contextDesc.maxUpscaleSize.height;
_targetWidth = _contextDesc.maxRenderSize.width;
_targetHeight = _contextDesc.maxRenderSize.height;
}
else
{
@@ -631,6 +631,8 @@ bool FSR31FeatureDx12::InitFSR3(const NVSDK_NGX_Parameter* InParameters)
_contextDesc.maxRenderSize.width = RenderWidth();
_contextDesc.maxRenderSize.height = RenderHeight();
Config::Instance()->OutputScalingMultiplier = 1.0f;
// if output scaling active let it to handle downsampling
if (Config::Instance()->OutputScalingEnabled.value_or(false) && !Config::Instance()->DisplayResolution.value_or(false))
{
@@ -638,8 +640,9 @@ bool FSR31FeatureDx12::InitFSR3(const NVSDK_NGX_Parameter* InParameters)
_contextDesc.maxUpscaleSize.height = _contextDesc.maxRenderSize.height;
// update target res
_targetWidth = _contextDesc.maxUpscaleSize.width;
_targetHeight = _contextDesc.maxUpscaleSize.height;
_targetWidth = _contextDesc.maxRenderSize.width;
_targetHeight = _contextDesc.maxRenderSize.height;
}
else
{
+1 -3
View File
@@ -1418,9 +1418,7 @@ public:
}
ImGui::EndDisabled();
ImGui::BeginDisabled(!_ssEnabled ||
((currentBackend == "xess" || currentBackend == "dlss") &&
Config::Instance()->CurrentFeature->RenderWidth() > Config::Instance()->CurrentFeature->DisplayWidth()));
ImGui::BeginDisabled(!_ssEnabled || Config::Instance()->CurrentFeature->RenderWidth() > Config::Instance()->CurrentFeature->DisplayWidth());
ImGui::SliderFloat("Ratio", &_ssRatio, 0.5f, 3.0f, "%.2f");
ImGui::EndDisabled();
+5 -3
View File
@@ -193,7 +193,9 @@ bool OS_Dx12::Dispatch(ID3D12Device* InDevice, ID3D12GraphicsCommandList* InCmdL
UpscaleShaderConstants constants{};
FsrEasuCon(constants.const0, constants.const1, constants.const2, constants.const3,
inDesc.Width, inDesc.Height, inDesc.Width, inDesc.Height, outDesc.Width, outDesc.Height);
inDesc.Width, inDesc.Height,
Config::Instance()->CurrentFeature->TargetWidth(), Config::Instance()->CurrentFeature->TargetHeight(),
Config::Instance()->CurrentFeature->DisplayWidth(), Config::Instance()->CurrentFeature->DisplayHeight());
// Copy the updated constant buffer data to the constant buffer resource
UINT8* pCBDataBegin;
@@ -210,8 +212,8 @@ bool OS_Dx12::Dispatch(ID3D12Device* InDevice, ID3D12GraphicsCommandList* InCmdL
Constants constants{};
constants.srcWidth = static_cast<uint32_t>(inDesc.Width);
constants.srcHeight = inDesc.Height;
constants.destWidth = static_cast<uint32_t>(outDesc.Width);
constants.destHeight = outDesc.Height;
constants.destWidth = Config::Instance()->CurrentFeature->DisplayWidth(); // static_cast<uint32_t>(outDesc.Width);
constants.destHeight = Config::Instance()->CurrentFeature->DisplayHeight(); // outDesc.Height;
// Copy the updated constant buffer data to the constant buffer resource
UINT8* pCBDataBegin;