diff --git a/CyberXeSS/backends/fsr2/FSR2Feature_Dx11.cpp b/CyberXeSS/backends/fsr2/FSR2Feature_Dx11.cpp index 8029e464..3b880d71 100644 --- a/CyberXeSS/backends/fsr2/FSR2Feature_Dx11.cpp +++ b/CyberXeSS/backends/fsr2/FSR2Feature_Dx11.cpp @@ -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; diff --git a/CyberXeSS/backends/fsr2/FSR2Feature_Dx11On12.cpp b/CyberXeSS/backends/fsr2/FSR2Feature_Dx11On12.cpp index 23a56849..cdb057e2 100644 --- a/CyberXeSS/backends/fsr2/FSR2Feature_Dx11On12.cpp +++ b/CyberXeSS/backends/fsr2/FSR2Feature_Dx11On12.cpp @@ -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; - } \ No newline at end of file +} \ No newline at end of file diff --git a/CyberXeSS/backends/fsr2/FSR2Feature_Dx12.cpp b/CyberXeSS/backends/fsr2/FSR2Feature_Dx12.cpp index 64346056..6bdede8b 100644 --- a/CyberXeSS/backends/fsr2/FSR2Feature_Dx12.cpp +++ b/CyberXeSS/backends/fsr2/FSR2Feature_Dx12.cpp @@ -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; diff --git a/CyberXeSS/backends/fsr2_212/FSR2Feature_Dx11On12_212.cpp b/CyberXeSS/backends/fsr2_212/FSR2Feature_Dx11On12_212.cpp index 6da2d922..ecf3db70 100644 --- a/CyberXeSS/backends/fsr2_212/FSR2Feature_Dx11On12_212.cpp +++ b/CyberXeSS/backends/fsr2_212/FSR2Feature_Dx11On12_212.cpp @@ -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)) diff --git a/CyberXeSS/backends/fsr2_212/FSR2Feature_Dx12_212.cpp b/CyberXeSS/backends/fsr2_212/FSR2Feature_Dx12_212.cpp index 6b213a2c..d269b34d 100644 --- a/CyberXeSS/backends/fsr2_212/FSR2Feature_Dx12_212.cpp +++ b/CyberXeSS/backends/fsr2_212/FSR2Feature_Dx12_212.cpp @@ -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; diff --git a/CyberXeSS/backends/xess/XeSSFeature_Dx11.cpp b/CyberXeSS/backends/xess/XeSSFeature_Dx11.cpp index 225fa779..ee2b4b57 100644 --- a/CyberXeSS/backends/xess/XeSSFeature_Dx11.cpp +++ b/CyberXeSS/backends/xess/XeSSFeature_Dx11.cpp @@ -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; diff --git a/CyberXeSS/backends/xess/XeSSFeature_Dx12.cpp b/CyberXeSS/backends/xess/XeSSFeature_Dx12.cpp index 530e50f2..eb828bac 100644 --- a/CyberXeSS/backends/xess/XeSSFeature_Dx12.cpp +++ b/CyberXeSS/backends/xess/XeSSFeature_Dx12.cpp @@ -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;