mirror of
https://github.com/optiscaler/OptiScaler.git
synced 2026-08-28 09:07:11 +00:00
Clean-up small issues
This commit is contained in:
@@ -13,7 +13,7 @@ class DLSSG_Dx12 : public virtual IFGFeature_Dx12
|
||||
std::optional<bool> _haveHudless = std::nullopt;
|
||||
|
||||
sl::ViewportHandle viewport { 0 };
|
||||
sl::FrameToken* frameToken;
|
||||
sl::FrameToken* frameToken = nullptr;
|
||||
|
||||
ID3D12Fence* dlssgFence[BUFFER_COUNT] = {};
|
||||
UINT64 lastOptionFrame = 0;
|
||||
|
||||
@@ -1074,18 +1074,19 @@ HRESULT FGHooks::FGPresent(IDXGISwapChain* This, UINT SyncInterval, UINT Flags,
|
||||
LOG_TRACE("Accuired FG->Mutex: {}", fg->Mutex.getOwner());
|
||||
}
|
||||
|
||||
sl::FrameToken* frameToken = nullptr;
|
||||
sl::FrameToken* localToken = nullptr;
|
||||
sl::Result tokenResult = sl::Result::eErrorReflexAPI;
|
||||
if (willPresent && State::Instance().activeFgOutput == FGOutput::DLSSG)
|
||||
{
|
||||
((IDXGISwapChain4*) This)->GetCurrentBackBufferIndex();
|
||||
|
||||
const uint32_t frameId = State::Instance().currentFG->FrameCount();
|
||||
auto tokenResult = StreamlineProxy::GetNewFrameToken()(frameToken, &frameId);
|
||||
tokenResult = StreamlineProxy::GetNewFrameToken()(localToken, &frameId);
|
||||
|
||||
if (!ReflexHooks::gameIsSendingMarkers() ||
|
||||
if (tokenResult == sl::Result::eOk && !ReflexHooks::gameIsSendingMarkers() ||
|
||||
!Config::Instance()->FGDLSSGUseGamesReflexMarkers.value_or_default())
|
||||
{
|
||||
StreamlineProxy::PCLSetMarker()(sl::PCLMarker::ePresentStart, *frameToken);
|
||||
StreamlineProxy::PCLSetMarker()(sl::PCLMarker::ePresentStart, *localToken);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1159,22 +1160,13 @@ HRESULT FGHooks::FGPresent(IDXGISwapChain* This, UINT SyncInterval, UINT Flags,
|
||||
Util::GetDeviceRemovedReason(State::Instance().currentD3D12Device);
|
||||
}
|
||||
|
||||
if (result == S_OK)
|
||||
{
|
||||
LOG_DEBUG("Result: {:X}", result);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (result == DXGI_ERROR_DEVICE_REMOVED && State::Instance().currentD3D12Device != nullptr)
|
||||
Util::GetDeviceRemovedReason(State::Instance().currentD3D12Device);
|
||||
}
|
||||
|
||||
if ((!ReflexHooks::gameIsSendingMarkers() ||
|
||||
if (tokenResult == sl::Result::eOk && localToken != nullptr &&
|
||||
(!ReflexHooks::gameIsSendingMarkers() ||
|
||||
!Config::Instance()->FGDLSSGUseGamesReflexMarkers.value_or_default()) &&
|
||||
willPresent && State::Instance().activeFgOutput == FGOutput::DLSSG && frameToken != nullptr)
|
||||
willPresent && State::Instance().activeFgOutput == FGOutput::DLSSG)
|
||||
{
|
||||
StreamlineProxy::PCLSetMarker()(sl::PCLMarker::ePresentEnd, *frameToken);
|
||||
StreamlineProxy::ReflexSleep()(*frameToken);
|
||||
StreamlineProxy::PCLSetMarker()(sl::PCLMarker::ePresentEnd, *localToken);
|
||||
StreamlineProxy::ReflexSleep()(*localToken);
|
||||
}
|
||||
|
||||
Hudfix_Dx12::PresentEnd();
|
||||
|
||||
@@ -322,6 +322,9 @@ sl::Result StreamlineHooks::hkslSetD3DDevice(void* d3dDevice)
|
||||
|
||||
void StreamlineHooks::streamlineLogCallback_sl1(sl1::LogType type, const char* msg)
|
||||
{
|
||||
if (msg == nullptr)
|
||||
return;
|
||||
|
||||
char* trimmed_msg = trimStreamlineLog(msg);
|
||||
|
||||
switch (type)
|
||||
|
||||
@@ -217,7 +217,7 @@ class StreamlineProxy
|
||||
static bool HookStreamlinePCL()
|
||||
{
|
||||
// if already hooked
|
||||
if (_slReflexGetState != nullptr)
|
||||
if (_slPCLSetMarker != nullptr)
|
||||
return true;
|
||||
|
||||
spdlog::info("");
|
||||
@@ -331,7 +331,7 @@ class StreamlineProxy
|
||||
StreamlineProxy::HookStreamlineReflex();
|
||||
StreamlineProxy::HookStreamlineDLSSG();
|
||||
|
||||
State::Instance().optiSlInterposer = KernelBaseProxy::GetModuleHandleW_()(L"sl.inderposer.dll");
|
||||
State::Instance().optiSlInterposer = KernelBaseProxy::GetModuleHandleW_()(L"sl.interposer.dll");
|
||||
State::Instance().optiSlCommon = KernelBaseProxy::GetModuleHandleW_()(L"sl.common.dll");
|
||||
State::Instance().optiSlDLSSG = KernelBaseProxy::GetModuleHandleW_()(L"sl.dlss_g.dll");
|
||||
State::Instance().optiSlReflex = KernelBaseProxy::GetModuleHandleW_()(L"sl.reflex.dll");
|
||||
|
||||
Reference in New Issue
Block a user