removed overlay menu stuff

This commit is contained in:
cdozdil
2024-09-04 17:09:36 +03:00
parent b08601f61b
commit be6dce1c15
3 changed files with 8 additions and 117 deletions
+2 -38
View File
@@ -15,9 +15,6 @@
#include "backends/fsr31/FSR31Feature_Dx11On12.h"
#include "backends/xess/XeSSFeature_Dx11.h"
#include "imgui/imgui_overlay_dx11.h"
#include "imgui/imgui_overlay_dx12.h"
#include <ankerl/unordered_dense.h>
inline ID3D11Device* D3D11Device = nullptr;
@@ -179,8 +176,8 @@ NVSDK_NGX_API NVSDK_NGX_Result NVSDK_NGX_D3D11_Shutdown()
DLSSFeatureDx11::Shutdown(D3D11Device);
if (Config::Instance()->OverlayMenu.value_or(true) && ImGuiOverlayDx11::IsInitedDx11())
ImGuiOverlayDx11::ShutdownDx11();
//if (Config::Instance()->OverlayMenu.value_or(true) && ImGuiOverlayDx11::IsInitedDx11())
// ImGuiOverlayDx11::ShutdownDx11();
if (Config::Instance()->DLSSEnabled.value_or(true) && NVNGXProxy::IsDx11Inited() && NVNGXProxy::D3D11_Shutdown() != nullptr)
{
@@ -603,39 +600,6 @@ NVSDK_NGX_API NVSDK_NGX_Result NVSDK_NGX_D3D11_EvaluateFeature(ID3D11DeviceConte
Config::Instance()->DE_Available = (deAvail > 0);
}
if (Config::Instance()->OverlayMenu.value_or(true) && Config::Instance()->CurrentFeature != nullptr &&
Config::Instance()->CurrentFeature->FrameCount() > Config::Instance()->MenuInitDelay.value_or(75) &&
!ImGuiOverlayDx11::IsInitedDx11())
{
ImGuiOverlayDx12::ShutdownDx12();
auto hwnd = Util::GetProcessWindow();
HWND consoleWindow = GetConsoleWindow();
bool consoleAllocated = false;
if (consoleWindow == NULL)
{
AllocConsole();
consoleWindow = GetConsoleWindow();
consoleAllocated = true;
ShowWindow(consoleWindow, SW_HIDE);
}
SetForegroundWindow(hwnd);
SetFocus(hwnd);
ImGuiOverlayDx11::InitDx11(consoleWindow);
if (consoleAllocated)
FreeConsole();
}
// Check window recreation
HWND currentHandle = Util::GetProcessWindow();
if (ImGuiOverlayDx11::IsInitedDx11() && ImGuiOverlayDx11::Handle() != currentHandle)
ImGuiOverlayDx11::ReInitDx11(currentHandle);
if (InCallback)
LOG_INFO("callback exist");
+6 -54
View File
@@ -11,7 +11,7 @@
#include "backends/fsr31/FSR31Feature_Dx12.h"
#include "backends/xess/XeSSFeature_Dx12.h"
#include "imgui/imgui_overlay_dx12.h"
//#include "imgui/imgui_overlay_dx12.h"
#include "detours/detours.h"
#include <ankerl/unordered_dense.h>
@@ -154,8 +154,8 @@ void HookToCommandList(ID3D12GraphicsCommandList* InCmdList)
void HookToDevice(ID3D12Device* InDevice)
{
if (!ImGuiOverlayDx12::IsEarlyBind() && orgCreateSampler != nullptr || InDevice == nullptr)
return;
//if (!ImGuiOverlayDx12::IsEarlyBind() && orgCreateSampler != nullptr || InDevice == nullptr)
// return;
PVOID* pVTable = *(PVOID**)InDevice;
@@ -261,8 +261,8 @@ NVSDK_NGX_API NVSDK_NGX_Result NVSDK_NGX_D3D12_Init_Ext(unsigned long long InApp
D3D12Device = InDevice;
if (!ImGuiOverlayDx12::IsEarlyBind() && D3D12Device != nullptr)
HookToDevice(D3D12Device);
//if (!ImGuiOverlayDx12::IsEarlyBind() && D3D12Device != nullptr)
// HookToDevice(D3D12Device);
Config::Instance()->Api = NVNGX_DX12;
@@ -372,9 +372,6 @@ NVSDK_NGX_API NVSDK_NGX_Result NVSDK_NGX_D3D12_Shutdown(void)
DLSSFeatureDx12::Shutdown(D3D12Device);
if (Config::Instance()->OverlayMenu.value_or(true) && ImGuiOverlayDx12::IsInitedDx12())
ImGuiOverlayDx12::ShutdownDx12();
if (Config::Instance()->DLSSEnabled.value_or(true) && NVNGXProxy::IsDx12Inited() && NVNGXProxy::D3D12_Shutdown() != nullptr)
{
LOG_INFO("D3D12_Shutdown");
@@ -830,37 +827,6 @@ NVSDK_NGX_API NVSDK_NGX_Result NVSDK_NGX_D3D12_EvaluateFeature(ID3D12GraphicsCom
return NVSDK_NGX_Result_Fail;
}
if (Config::Instance()->OverlayMenu.value_or(true) &&
Config::Instance()->CurrentFeature != nullptr && Config::Instance()->CurrentFeature->FrameCount() > Config::Instance()->MenuInitDelay.value_or(75) &&
!ImGuiOverlayDx12::IsInitedDx12())
{
contextRendering = true;
auto hwnd = Util::GetProcessWindow();
HWND consoleWindow = GetConsoleWindow();
bool consoleAllocated = false;
if (consoleWindow == NULL)
{
AllocConsole();
consoleWindow = GetConsoleWindow();
consoleAllocated = true;
ShowWindow(consoleWindow, SW_HIDE);
}
SetForegroundWindow(hwnd);
SetFocus(hwnd);
ImGuiOverlayDx12::InitDx12(consoleWindow, D3D12Device);
if (consoleAllocated)
FreeConsole();
contextRendering = false;
}
if (handleId < 1000000)
{
if (Config::Instance()->DLSSEnabled.value_or(true) && NVNGXProxy::D3D12_EvaluateFeature() != nullptr)
@@ -882,22 +848,11 @@ NVSDK_NGX_API NVSDK_NGX_Result NVSDK_NGX_D3D12_EvaluateFeature(ID3D12GraphicsCom
if (Config::Instance()->SkipFirstFrames.has_value() && evalCounter < Config::Instance()->SkipFirstFrames.value())
return NVSDK_NGX_Result_Success;
// Check window recreation
if (Config::Instance()->OverlayMenu.value_or(true) && ImGuiOverlayDx12::IsInitedDx12())
{
contextRendering = true;
HWND currentHandle = Util::GetProcessWindow();
if (ImGuiOverlayDx12::Handle() != currentHandle)
ImGuiOverlayDx12::ReInitDx12(currentHandle);
contextRendering = false;
}
if (InCallback)
LOG_INFO("callback exist");
// DLSS Enabler
if(!Config::Instance()->DE_Available)
{
// DLSS Enabler check
int deAvail;
@@ -1218,9 +1173,6 @@ NVSDK_NGX_API NVSDK_NGX_Result NVSDK_NGX_D3D12_EvaluateFeature(ID3D12GraphicsCom
sigatureMutex.unlock();
}
if (Config::Instance()->OverlayMenu.value_or(true))
ImGuiOverlayDx12::CaptureQueue(InCmdList);
LOG_TRACE("done: {0:X}", (UINT)evalResult);
if (evalResult)
-25
View File
@@ -16,9 +16,6 @@
#include "NVNGX_Parameter.h"
#include "NVNGX_Proxy.h"
#include "imgui/imgui_overlay_vk.h"
#include "imgui/imgui_overlay_dx12.h"
VkInstance vkInstance;
VkPhysicalDevice vkPD;
VkDevice vkDevice;
@@ -732,24 +729,6 @@ NVSDK_NGX_API NVSDK_NGX_Result NVSDK_NGX_VULKAN_EvaluateFeature(VkCommandBuffer
Config::Instance()->DE_Available = (deAvail > 0);
}
if (Config::Instance()->OverlayMenu.value_or(true) && Config::Instance()->CurrentFeature != nullptr && !ImGuiOverlayVk::IsInitedVk() &&
Config::Instance()->CurrentFeature->FrameCount() > Config::Instance()->MenuInitDelay.value_or(75))
{
if (ImGuiOverlayDx12::IsInitedDx12())
ImGuiOverlayDx12::ShutdownDx12();
auto hwnd = Util::GetProcessWindow();
ImGuiOverlayVk::InitVk(hwnd, vkDevice, vkInstance, vkPD);
}
// Check window recreation
if (Config::Instance()->OverlayMenu.value_or(true))
{
HWND currentHandle = Util::GetProcessWindow();
if (ImGuiOverlayVk::IsInitedVk() && ImGuiOverlayVk::Handle() != currentHandle)
ImGuiOverlayVk::ReInitVk(currentHandle);
}
if (InCallback)
LOG_WARN("callback exist");
@@ -933,10 +912,6 @@ NVSDK_NGX_API NVSDK_NGX_Result NVSDK_NGX_VULKAN_Shutdown(void)
DLSSFeatureVk::Shutdown(vkDevice);
if (Config::Instance()->OverlayMenu.value_or(true) && ImGuiOverlayVk::IsInitedVk())
ImGuiOverlayVk::ShutdownVk();
if (Config::Instance()->DLSSEnabled.value_or(true) && NVNGXProxy::IsVulkanInited() && NVNGXProxy::VULKAN_Shutdown() != nullptr)
{
auto result = NVNGXProxy::VULKAN_Shutdown()();