Notify about some upscaler issues

This commit is contained in:
FakeMichau
2026-03-11 00:30:35 +01:00
parent 4cf1549aa6
commit b29425efea
13 changed files with 79 additions and 18 deletions
+1 -1
View File
@@ -652,7 +652,7 @@ NVSDK_NGX_API NVSDK_NGX_Result NVSDK_NGX_D3D11_EvaluateFeature(ID3D11DeviceConte
if (!upscaleResult)
{
ImGui::InsertNotification({ ImGuiToastType::Warning, 10000, "Upscaler failed to run!" });
ImGui::InsertNotification({ ImGuiToastType::Error, 10000, "Upscaler failed to run!" });
}
if (!upscaleResult && !deviceContext->IsInited() &&
+2 -1
View File
@@ -799,6 +799,7 @@ NVSDK_NGX_API NVSDK_NGX_Result NVSDK_NGX_D3D12_EvaluateFeature(ID3D12GraphicsCom
if (!deviceContext->feature->IsInited() && Config::Instance()->Dx12Upscaler.value_or_default() != "fsr21")
{
LOG_WARN("InCmdList {0} is not inited, falling back to FSR 2.1.2", deviceContext->feature->Name());
ImGui::InsertNotification({ ImGuiToastType::Warning, 10000, "Falling back to FSR 2.1.2" });
State::Instance().newBackend = "fsr21";
State::Instance().changeBackend[handleId] = true;
return NVSDK_NGX_Result_Success;
@@ -842,7 +843,7 @@ NVSDK_NGX_API NVSDK_NGX_Result NVSDK_NGX_D3D12_EvaluateFeature(ID3D12GraphicsCom
}
else
{
ImGui::InsertNotification({ ImGuiToastType::Warning, 10000, "Upscaler failed to run!" });
ImGui::InsertNotification({ ImGuiToastType::Error, 10000, "Upscaler failed to run!" });
}
// Root signature restore
+1 -1
View File
@@ -916,7 +916,7 @@ NVSDK_NGX_API NVSDK_NGX_Result NVSDK_NGX_VULKAN_EvaluateFeature(VkCommandBuffer
auto upscaleResult = deviceContext->Evaluate(InCmdList, InParameters);
if (!upscaleResult)
ImGui::InsertNotification({ ImGuiToastType::Warning, 10000, "Upscaler failed to run!" });
ImGui::InsertNotification({ ImGuiToastType::Error, 10000, "Upscaler failed to run!" });
if ((!upscaleResult || !deviceContext->IsInited()) &&
Config::Instance()->VulkanUpscaler.value_or_default() != "fsr22")
+18 -8
View File
@@ -1390,13 +1390,13 @@ static void MenuSizeCheck(ImGuiIO io)
{
if (!Config::Instance()->MenuScale.has_value())
{
float y = State::Instance().screenHeight;
float screenHeight = State::Instance().screenHeight;
if (io.DisplaySize.y != 0)
y = (float) io.DisplaySize.y;
screenHeight = io.DisplaySize.y;
// 1000p is minimum for 1.0 menu ratio
Config::Instance()->MenuScale = (float) ((int) (y / 100.0f)) / 10.0f;
Config::Instance()->MenuScale = (float) ((int) (screenHeight / 100.0f)) / 10.0f;
if (Config::Instance()->MenuScale.value() > 1.0f || Config::Instance()->MenuScale.value() <= 0.0f)
Config::Instance()->MenuScale.value() = 1.0f;
@@ -1776,11 +1776,19 @@ bool MenuCommon::RenderMenu()
(!Config::Instance()->OverlayMenu.value_or_default() &&
State::Instance().currentFeature != nullptr && State::Instance().currentFeature->IsHdr());
float notificationScale = 2.0f;
float screenHeight = State::Instance().screenHeight;
if (io.DisplaySize.y != 0)
screenHeight = io.DisplaySize.y;
// Map resolution height to scale, 0.5 for 480p, 2.0 for 1440p
constexpr float slope = (2.0f - 0.5f) / (1440.f - 480.f);
float notificationScale = 0.5f + slope * (screenHeight - 480.f);
notificationScale = std::clamp(notificationScale, 0.5f, 2.0f);
if (config->UseHQFont.value_or_default())
ImGui::PushFontSize(std::round(notificationScale * fontSize));
else
ImGui::SetWindowFontScale(notificationScale);
// No fallback font, SetWindowFontScale needs to be called after Begin()
ImGui::RenderNotifications(ImGuiToastPos::TopCenter, notificationScale, tonemapRequired);
@@ -4408,10 +4416,12 @@ bool MenuCommon::RenderMenu()
}
if (ImGui::Button("S"))
ImGui::InsertNotification({ ImGuiToastType::Success, 10000, "Test Success Test Success Test Success Test Success" });
ImGui::InsertNotification(
{ ImGuiToastType::Success, 10000, "Test Success Test Success Test Success Test Success" });
ImGui::SameLine(0.0f, 16.0f);
if (ImGui::Button("W"))
ImGui::InsertNotification({ ImGuiToastType::Warning, 10000, "Test warning Test warning Test warning" });
ImGui::InsertNotification(
{ ImGuiToastType::Warning, 10000, "Test warning Test warning Test warning" });
ImGui::SameLine(0.0f, 16.0f);
if (ImGui::Button("E"))
ImGui::InsertNotification({ ImGuiToastType::Error, 10000, "Test error Test error" });
+22 -2
View File
@@ -33,6 +33,7 @@
#define FFX_API_CONFIGURE_FG_SWAPCHAIN_KEY_FRAMEPACINGTUNING FFX_API_CONFIGURE_FG_SWAPCHAIN_KEY_FRAMEPACINGTUNING_VK
#include <vk/ffx_api_vk.h>
#include <imgui/ImGuiNotify.hpp>
#undef FFX_API_CONFIGURE_FG_SWAPCHAIN_KEY_WAITCALLBACK
#undef FFX_API_CONFIGURE_FG_SWAPCHAIN_KEY_FRAMEPACINGTUNING
@@ -112,8 +113,27 @@ class FfxApiProxy
static HMODULE Dx12Module_SR() { return upscaling_dx12.dll; }
static HMODULE Dx12Module_FG() { return fg_dx12.dll; }
static bool IsFGReady() { return (main_dx12.dll && !main_dx12.isLoader) || fg_dx12.dll != nullptr; }
static bool IsSRReady() { return (main_dx12.dll && !main_dx12.isLoader) || upscaling_dx12.dll != nullptr; }
static bool IsFGReady()
{
bool result = (main_dx12.dll && !main_dx12.isLoader) || fg_dx12.dll != nullptr;
if (!result)
ImGui::InsertNotification({ ImGuiToastType::Error, 10000,
"Can't load amd_fidelityfx_dx12\nDid you forget to extract that dll?" });
return result;
}
static bool IsSRReady()
{
bool result = (main_dx12.dll && !main_dx12.isLoader) || upscaling_dx12.dll != nullptr;
if (!result)
ImGui::InsertNotification({ ImGuiToastType::Error, 10000,
"Can't load amd_fidelityfx_dx12\nDid you forget to extract that dll?" });
return result;
}
static FFXStructType GetType(ffxStructType_t type)
{
@@ -199,6 +199,7 @@ bool FeatureProvider_Dx11::ChangeFeature(std::string upscalerName, ID3D11Device*
{
State::Instance().newBackend = "fsr22";
State::Instance().changeBackend[handleId] = true;
ImGui::InsertNotification({ ImGuiToastType::Error, 10000, "Falling back to FSR 2.2" });
}
else
{
@@ -200,10 +200,16 @@ bool FeatureProvider_Dx12::ChangeFeature(std::string upscalerName, ID3D12Device*
if (State::Instance().newBackend != "dlssd")
{
if (Config::Instance()->Dx12Upscaler == "dlss")
if (Config::Instance()->VulkanUpscaler == "dlss")
{
State::Instance().newBackend = "xess";
ImGui::InsertNotification({ ImGuiToastType::Error, 10000, "Falling back to XeSS" });
}
else
{
State::Instance().newBackend = "fsr21";
ImGui::InsertNotification({ ImGuiToastType::Error, 10000, "Falling back to FSR 2.1" });
}
}
else
{
@@ -200,10 +200,12 @@ bool FeatureProvider_Vk::ChangeFeature(std::string upscalerName, VkInstance inst
if (Config::Instance()->VulkanUpscaler == "dlss")
{
State::Instance().newBackend = "xess";
ImGui::InsertNotification({ ImGuiToastType::Error, 10000, "Falling back to XeSS" });
}
else
{
State::Instance().newBackend = "fsr21";
ImGui::InsertNotification({ ImGuiToastType::Error, 10000, "Falling back to FSR 2.1" });
}
}
else
@@ -13,6 +13,7 @@
#include <detours/detours.h>
#include <magic_enum.hpp>
#include <imgui/ImGuiNotify.hpp>
// Used Nukem's VKToDX as a base
// https://github.com/Nukem9/dlssg-to-fsr3/blob/eca4a79b4d23339a1dcf02e30b9f3bafe7901513/source/maindll/FFFrameInterpolatorVKToDX.cpp
@@ -691,6 +692,11 @@ bool IFeature_VkwDx12::CopyTextureFromVkToDx12(VkCommandBuffer InCmdBuffer, NVSD
if (!CreateSharedTexture(imageCreateInfo, OutResource->VkSharedImage, OutResource->VkSharedMemory,
OutResource->Dx12Resource, !InCopy))
{
if (State::Instance().isRunningOnLinux)
ImGui::InsertNotification(
{ ImGuiToastType::Warning, 10000,
"Failed to create a shared texture\nMake sure you are using at least Wine/Proton 11" });
LOG_ERROR("Failed to create shared texture!");
return false;
}
@@ -102,7 +102,7 @@ bool FSR31FeatureDx11on12::Evaluate(ID3D11DeviceContext* InDeviceContext, NVSDK_
if (!InitFSR3(InParameters))
{
LOG_ERROR("InitFSR2 fail!");
LOG_ERROR("InitFSR3 fail!");
return false;
}
+7 -1
View File
@@ -6,6 +6,7 @@
#include <include/detours/detours.h>
#include <include/d3dx/d3dx12.h>
#include <imgui/ImGuiNotify.hpp>
inline void XeSSLogCallback(const char* Message, xess_logging_level_t Level)
{
@@ -19,6 +20,8 @@ bool XeSSFeature::InitXeSS(ID3D12Device* device, const NVSDK_NGX_Parameter* InPa
if (!_moduleLoaded)
{
ImGui::InsertNotification(
{ ImGuiToastType::Warning, 10000, "Couldn't load libxess.dll\nCheck if the dll is present" });
LOG_ERROR("libxess.dll not loaded!");
return false;
}
@@ -39,7 +42,10 @@ bool XeSSFeature::InitXeSS(ID3D12Device* device, const NVSDK_NGX_Parameter* InPa
if (ret != XESS_RESULT_SUCCESS)
{
LOG_ERROR("xessD3D12CreateContext error: {0}", ResultToString(ret));
auto str = ResultToString(ret);
ImGui::InsertNotification(
{ ImGuiToastType::Error, 10000, std::format("Couldn't create XeSS context\n{}", str).c_str() });
LOG_ERROR("xessD3D12CreateContext error: {0}", str);
return false;
}
@@ -1,5 +1,6 @@
#include <pch.h>
#include "XeSSFeature_Dx11.h"
#include <imgui/ImGuiNotify.hpp>
static std::string ResultToString(xess_result_t result)
{
@@ -51,7 +52,9 @@ bool XeSSFeature_Dx11::Init(ID3D11Device* InDevice, ID3D11DeviceContext* InConte
if (!_moduleLoaded)
{
LOG_ERROR("libxess.dll not loaded!");
ImGui::InsertNotification(
{ ImGuiToastType::Warning, 10000, "Couldn't load libxess_dx11.dll\nCheck if the dll is present" });
LOG_ERROR("libxess_dx11.dll not loaded!");
return false;
}
@@ -80,7 +83,10 @@ bool XeSSFeature_Dx11::Init(ID3D11Device* InDevice, ID3D11DeviceContext* InConte
if (ret != XESS_RESULT_SUCCESS)
{
LOG_ERROR("xessD3D12CreateContext error: {0}", ResultToString(ret));
auto str = ResultToString(ret);
ImGui::InsertNotification(
{ ImGuiToastType::Error, 10000, std::format("Couldn't create XeSS context\n{}", str).c_str() });
LOG_ERROR("xessD3D11CreateContext error: {0}", str);
return false;
}
@@ -1,6 +1,7 @@
#include <pch.h>
#include "XeSSFeature_Vk.h"
#include <nvsdk_ngx_vk.h>
#include <imgui/ImGuiNotify.hpp>
static std::string ResultToString(xess_result_t result)
{
@@ -70,6 +71,8 @@ bool XeSSFeature_Vk::Init(VkInstance InInstance, VkPhysicalDevice InPD, VkDevice
if (!_moduleLoaded)
{
ImGui::InsertNotification(
{ ImGuiToastType::Warning, 10000, "Couldn't load libxess.dll\nCheck if the dll is present" });
LOG_ERROR("libxess.dll not loaded!");
return false;
}