and even more automv fixes

This commit is contained in:
cdozdil
2024-04-11 12:05:34 +03:00
parent 463ea7065e
commit 4e4e04069c
7 changed files with 42 additions and 29 deletions
+4 -3
View File
@@ -281,15 +281,16 @@ bool FSR2FeatureDx11::Evaluate(ID3D11DeviceContext* InContext, const NVSDK_NGX_P
D3D11_TEXTURE2D_DESC desc;
((ID3D11Texture2D*)paramVelocity)->GetDesc(&desc);
bool lowResMV = desc.Width < DisplayWidth();
if (Config::Instance()->DisplayResolution.value_or(false) && lowResMV)
bool displaySizeEnabled = (GetFeatureFlags() | FFX_FSR2_ENABLE_DISPLAY_RESOLUTION_MOTION_VECTORS) > 0;
if (displaySizeEnabled && lowResMV)
{
spdlog::warn("FSR2FeatureDx11::Evaluate MotionVectors size and feature init config not matching!!");
Config::Instance()->DisplayResolution = false;
Config::Instance()->changeBackend = true;
return true;
}
else if (!Config::Instance()->DisplayResolution.value_or(false) && !lowResMV)
else if (!displaySizeEnabled && !lowResMV)
{
spdlog::warn("FSR2FeatureDx11::Evaluate MotionVectors size and feature init config not matching!!");
Config::Instance()->DisplayResolution = true;
@@ -31,17 +31,20 @@ bool FSR2FeatureDx11on12::Evaluate(ID3D11DeviceContext* InDeviceContext, const N
if (paramVelocity && !Config::Instance()->DisplayResolution.has_value())
{
D3D11_TEXTURE2D_DESC desc;
((ID3D11Texture2D*)paramVelocity)->GetDesc(&desc);
ID3D11Texture2D* pvTexture;
paramVelocity->QueryInterface(IID_PPV_ARGS(&pvTexture));
pvTexture->GetDesc(&desc);
bool lowResMV = desc.Width < DisplayWidth();
bool displaySizeEnabled = (GetFeatureFlags() | FFX_FSR2_ENABLE_DISPLAY_RESOLUTION_MOTION_VECTORS) > 0;
if (Config::Instance()->DisplayResolution.value_or(false) && lowResMV)
if (displaySizeEnabled && lowResMV)
{
spdlog::warn("FSR2FeatureDx11on12::Evaluate MotionVectors size and feature init config not matching!!");
Config::Instance()->DisplayResolution = false;
Config::Instance()->changeBackend = true;
return true;
}
else if (!Config::Instance()->DisplayResolution.value_or(false) && !lowResMV)
else if (!displaySizeEnabled && !lowResMV)
{
spdlog::warn("FSR2FeatureDx11on12::Evaluate MotionVectors size and feature init config not matching!!");
Config::Instance()->DisplayResolution = true;
@@ -368,19 +371,19 @@ bool FSR2FeatureDx11on12::InitFSR2(const NVSDK_NGX_Parameter* InParameters)
{
Config::Instance()->HDR = true;
_contextDesc.flags |= FFX_FSR2_ENABLE_HIGH_DYNAMIC_RANGE;
spdlog::info("FSR2FeatureDx11on12::InitFSR2 xessParams.initFlags (HDR) {0:b}", _contextDesc.flags);
spdlog::info("FSR2FeatureDx11on12::InitFSR2 contextDesc.initFlags (HDR) {0:b}", _contextDesc.flags);
}
else
{
Config::Instance()->HDR = false;
spdlog::info("FSR2FeatureDx11on12::InitFSR2 xessParams.initFlags (!HDR) {0:b}", _contextDesc.flags);
spdlog::info("FSR2FeatureDx11on12::InitFSR2 contextDesc.initFlags (!HDR) {0:b}", _contextDesc.flags);
}
if (Config::Instance()->JitterCancellation.value_or(JitterMotion))
{
Config::Instance()->JitterCancellation = true;
_contextDesc.flags |= FFX_FSR2_ENABLE_MOTION_VECTORS_JITTER_CANCELLATION;
spdlog::info("FSR2FeatureDx11on12::InitFSR2 xessParams.initFlags (JitterCancellation) {0:b}", _contextDesc.flags);
spdlog::info("FSR2FeatureDx11on12::InitFSR2 contextDesc.initFlags (JitterCancellation) {0:b}", _contextDesc.flags);
}
else
Config::Instance()->JitterCancellation = false;
@@ -388,11 +391,11 @@ bool FSR2FeatureDx11on12::InitFSR2(const NVSDK_NGX_Parameter* InParameters)
if (Config::Instance()->DisplayResolution.value_or(!LowRes))
{
_contextDesc.flags |= FFX_FSR2_ENABLE_DISPLAY_RESOLUTION_MOTION_VECTORS;
spdlog::info("FSR2FeatureDx11on12::InitFSR2 xessParams.initFlags (!LowResMV) {0:b}", _contextDesc.flags);
spdlog::info("FSR2FeatureDx11on12::InitFSR2 contextDesc.initFlags (!LowResMV) {0:b}", _contextDesc.flags);
}
else
{
spdlog::info("FSR2FeatureDx11on12::InitFSR2 xessParams.initFlags (LowResMV) {0:b}", _contextDesc.flags);
spdlog::info("FSR2FeatureDx11on12::InitFSR2 contextDesc.initFlags (LowResMV) {0:b}", _contextDesc.flags);
}
if (Config::Instance()->SuperSamplingEnabled.value_or(false) && !Config::Instance()->DisplayResolution.value_or(false))
@@ -429,4 +432,4 @@ bool FSR2FeatureDx11on12::InitFSR2(const NVSDK_NGX_Parameter* InParameters)
SetInit(true);
return true;
}
}
+3 -2
View File
@@ -108,15 +108,16 @@ bool FSR2FeatureDx12::Evaluate(ID3D12GraphicsCommandList* InCommandList, const N
{
auto desc = paramVelocity->GetDesc();
bool lowResMV = desc.Width < DisplayWidth();
bool displaySizeEnabled = (GetFeatureFlags() | FFX_FSR2_ENABLE_DISPLAY_RESOLUTION_MOTION_VECTORS) > 0;
if (Config::Instance()->DisplayResolution.value_or(false) && lowResMV)
if (displaySizeEnabled && lowResMV)
{
spdlog::warn("FSR2FeatureDx12::Evaluate MotionVectors size and feature init config not matching!!");
Config::Instance()->DisplayResolution = false;
Config::Instance()->changeBackend = true;
return true;
}
else if (!Config::Instance()->DisplayResolution.value_or(false) && !lowResMV)
else if (!displaySizeEnabled && !lowResMV)
{
spdlog::warn("FSR2FeatureDx12::Evaluate MotionVectors size and feature init config not matching!!");
Config::Instance()->DisplayResolution = true;
@@ -31,17 +31,20 @@ bool FSR2FeatureDx11on12_212::Evaluate(ID3D11DeviceContext* InDeviceContext, con
if (paramVelocity && !Config::Instance()->DisplayResolution.has_value())
{
D3D11_TEXTURE2D_DESC desc;
((ID3D11Texture2D*)paramVelocity)->GetDesc(&desc);
ID3D11Texture2D* pvTexture;
paramVelocity->QueryInterface(IID_PPV_ARGS(&pvTexture));
pvTexture->GetDesc(&desc);
bool lowResMV = desc.Width < DisplayWidth();
bool displaySizeEnabled = (GetFeatureFlags() | Fsr212::FFX_FSR2_ENABLE_DISPLAY_RESOLUTION_MOTION_VECTORS) > 0;
if (Config::Instance()->DisplayResolution.value_or(false) && lowResMV)
if (displaySizeEnabled && lowResMV)
{
spdlog::warn("FSR2FeatureDx11on12_212::Evaluate MotionVectors size and feature init config not matching!!");
Config::Instance()->DisplayResolution = false;
Config::Instance()->changeBackend = true;
return true;
}
else if (!Config::Instance()->DisplayResolution.value_or(false) && !lowResMV)
else if (!displaySizeEnabled && !lowResMV)
{
spdlog::warn("FSR2FeatureDx11on12_212::Evaluate MotionVectors size and feature init config not matching!!");
Config::Instance()->DisplayResolution = true;
@@ -364,19 +367,19 @@ bool FSR2FeatureDx11on12_212::InitFSR2(const NVSDK_NGX_Parameter* InParameters)
{
Config::Instance()->HDR = true;
_contextDesc.flags |= Fsr212::FFX_FSR2_ENABLE_HIGH_DYNAMIC_RANGE;
spdlog::info("FSR2FeatureDx11on12_212::InitFSR2 xessParams.initFlags (HDR) {0:b}", _contextDesc.flags);
spdlog::info("FSR2FeatureDx11on12_212::InitFSR2 contextDesc.initFlags (HDR) {0:b}", _contextDesc.flags);
}
else
{
Config::Instance()->HDR = false;
spdlog::info("FSR2FeatureDx11on12_212::InitFSR2 xessParams.initFlags (!HDR) {0:b}", _contextDesc.flags);
spdlog::info("FSR2FeatureDx11on12_212::InitFSR2 contextDesc.initFlags (!HDR) {0:b}", _contextDesc.flags);
}
if (Config::Instance()->JitterCancellation.value_or(JitterMotion))
{
Config::Instance()->JitterCancellation = true;
_contextDesc.flags |= Fsr212::FFX_FSR2_ENABLE_MOTION_VECTORS_JITTER_CANCELLATION;
spdlog::info("FSR2FeatureDx11on12_212::InitFSR2 xessParams.initFlags (JitterCancellation) {0:b}", _contextDesc.flags);
spdlog::info("FSR2FeatureDx11on12_212::InitFSR2 contextDesc.initFlags (JitterCancellation) {0:b}", _contextDesc.flags);
}
else
Config::Instance()->JitterCancellation = false;
@@ -384,11 +387,11 @@ bool FSR2FeatureDx11on12_212::InitFSR2(const NVSDK_NGX_Parameter* InParameters)
if (Config::Instance()->DisplayResolution.value_or(!LowRes))
{
_contextDesc.flags |= Fsr212::FFX_FSR2_ENABLE_DISPLAY_RESOLUTION_MOTION_VECTORS;
spdlog::info("FSR2FeatureDx11on12_212::InitFSR2 xessParams.initFlags (!LowResMV) {0:b}", _contextDesc.flags);
spdlog::info("FSR2FeatureDx11on12_212::InitFSR2 contextDesc.initFlags (!LowResMV) {0:b}", _contextDesc.flags);
}
else
{
spdlog::info("FSR2FeatureDx11on12_212::InitFSR2 xessParams.initFlags (LowResMV) {0:b}", _contextDesc.flags);
spdlog::info("FSR2FeatureDx11on12_212::InitFSR2 contextDesc.initFlags (LowResMV) {0:b}", _contextDesc.flags);
}
if (Config::Instance()->SuperSamplingEnabled.value_or(false) && !Config::Instance()->DisplayResolution.value_or(false))
@@ -102,15 +102,16 @@ bool FSR2FeatureDx12_212::Evaluate(ID3D12GraphicsCommandList* InCommandList, con
{
auto desc = paramVelocity->GetDesc();
bool lowResMV = desc.Width < DisplayWidth();
bool displaySizeEnabled = (GetFeatureFlags() | Fsr212::FFX_FSR2_ENABLE_DISPLAY_RESOLUTION_MOTION_VECTORS) > 0;
if (Config::Instance()->DisplayResolution.value_or(false) && lowResMV)
if (displaySizeEnabled && lowResMV)
{
spdlog::warn("FSR2FeatureDx12_212::Evaluate MotionVectors size and feature init config not matching!!");
Config::Instance()->DisplayResolution = false;
Config::Instance()->changeBackend = true;
return true;
}
else if (!Config::Instance()->DisplayResolution.value_or(false) && !lowResMV)
else if (!displaySizeEnabled && !lowResMV)
{
spdlog::warn("FSR2FeatureDx12_212::Evaluate MotionVectors size and feature init config not matching!!");
Config::Instance()->DisplayResolution = true;
+6 -3
View File
@@ -39,17 +39,20 @@ bool XeSSFeatureDx11::Evaluate(ID3D11DeviceContext* InDeviceContext, const NVSDK
if (paramVelocity && !Config::Instance()->DisplayResolution.has_value())
{
D3D11_TEXTURE2D_DESC desc;
((ID3D11Texture2D*)paramVelocity)->GetDesc(&desc);
ID3D11Texture2D* pvTexture;
paramVelocity->QueryInterface(IID_PPV_ARGS(&pvTexture));
pvTexture->GetDesc(&desc);
bool lowResMV = desc.Width < DisplayWidth();
bool displaySizeEnabled = (GetFeatureFlags() | XESS_INIT_FLAG_HIGH_RES_MV) > 0;
if (Config::Instance()->DisplayResolution.value_or(false) && lowResMV)
if (displaySizeEnabled && lowResMV)
{
spdlog::warn("XeSSFeatureDx11::Evaluate MotionVectors size and feature init config not matching!!");
Config::Instance()->DisplayResolution = false;
Config::Instance()->changeBackend = true;
return true;
}
else if (!Config::Instance()->DisplayResolution.value_or(false) && !lowResMV)
else if (!displaySizeEnabled && !lowResMV)
{
spdlog::warn("XeSSFeatureDx11::Evaluate MotionVectors size and feature init config not matching!!");
Config::Instance()->DisplayResolution = true;
+3 -2
View File
@@ -147,15 +147,16 @@ bool XeSSFeatureDx12::Evaluate(ID3D12GraphicsCommandList* InCommandList, const N
{
auto desc = params.pVelocityTexture->GetDesc();
bool lowResMV = desc.Width < DisplayWidth();
bool displaySizeEnabled = (GetFeatureFlags() | XESS_INIT_FLAG_HIGH_RES_MV) > 0;
if (Config::Instance()->DisplayResolution.value_or(false) && lowResMV)
if (displaySizeEnabled && lowResMV)
{
spdlog::warn("XeSSFeatureDx12::Evaluate MotionVectors size and feature init config not matching!!");
Config::Instance()->DisplayResolution = false;
Config::Instance()->changeBackend = true;
return true;
}
else if (!Config::Instance()->DisplayResolution.value_or(false) && !lowResMV)
else if (!displaySizeEnabled && !lowResMV)
{
spdlog::warn("XeSSFeatureDx12::Evaluate MotionVectors size and feature init config not matching!!");
Config::Instance()->DisplayResolution = true;