mirror of
https://github.com/optiscaler/OptiScaler.git
synced 2026-08-28 17:16:46 +00:00
Merge branch 'release/0.9' of https://github.com/optiscaler/OptiScaler into release/0.9
This commit is contained in:
@@ -1129,7 +1129,7 @@ void FSRFG_Dx12::Deactivate()
|
||||
_uiCommandListResetted[fIndex] = false;
|
||||
}
|
||||
|
||||
ffxReturnCode_t result = FFX_API_RETURN_OK;
|
||||
ffxReturnCode_t result = FFX_API_RETURN_ERROR;
|
||||
|
||||
if (_fgContext != nullptr)
|
||||
{
|
||||
@@ -1140,13 +1140,14 @@ void FSRFG_Dx12::Deactivate()
|
||||
fgConfig.presentCallback = nullptr;
|
||||
fgConfig.HUDLessColor = FfxApiResource({});
|
||||
|
||||
auto result = FfxApiProxy::D3D12_Configure(&_fgContext, &fgConfig.header);
|
||||
result = FfxApiProxy::D3D12_Configure(&_fgContext, &fgConfig.header);
|
||||
|
||||
if (result == FFX_API_RETURN_OK)
|
||||
_isActive = false;
|
||||
}
|
||||
else
|
||||
{
|
||||
LOG_DEBUG("No context to deactivate, just set active to false");
|
||||
_isActive = false;
|
||||
}
|
||||
|
||||
|
||||
@@ -117,7 +117,7 @@ static HRESULT hkD3D11On12CreateDevice(IUnknown* pDevice, UINT Flags, const D3D_
|
||||
ID3D11Device** ppDevice, ID3D11DeviceContext** ppImmediateContext,
|
||||
D3D_FEATURE_LEVEL* pChosenFeatureLevel)
|
||||
{
|
||||
LOG_DEBUG("Caller: {}", Util::WhoIsTheCaller(_ReturnAddress()));
|
||||
LOG_DEBUG("Caller: {}, Device: {:X}", Util::WhoIsTheCaller(_ReturnAddress()), (UINT64) pDevice);
|
||||
|
||||
#ifdef ENABLE_DEBUG_LAYER_DX11
|
||||
Flags |= D3D11_CREATE_DEVICE_DEBUG;
|
||||
|
||||
@@ -892,6 +892,10 @@ HRESULT FGHooks::hkResizeBuffers1(IDXGISwapChain* This, UINT BufferCount, UINT W
|
||||
|
||||
HRESULT result;
|
||||
|
||||
// Release menu render targets
|
||||
if (Config::Instance()->OverlayMenu.value_or_default())
|
||||
MenuOverlayDx::CleanupRenderTarget(false, NULL);
|
||||
|
||||
// Release swapchain backbuffers to prevent errors when resizing
|
||||
if (State::Instance().activeFgOutput == FGOutput::XeFG)
|
||||
{
|
||||
@@ -1133,7 +1137,7 @@ HRESULT FGHooks::FGPresent(void* This, UINT SyncInterval, UINT Flags, const DXGI
|
||||
|
||||
auto fg = State::Instance().currentFG;
|
||||
bool mutexUsed = false;
|
||||
if (willPresent && fg != nullptr && fg->IsActive() &&
|
||||
if (willPresent && fg != nullptr && fg->IsActive() && !fg->IsPaused() &&
|
||||
Config::Instance()->FGUseMutexForSwapchain.value_or_default() && fg->Mutex.getOwner() != 2)
|
||||
{
|
||||
LOG_TRACE("Waiting FG->Mutex 2, current: {}", fg->Mutex.getOwner());
|
||||
@@ -1216,7 +1220,9 @@ HRESULT FGHooks::FGPresent(void* This, UINT SyncInterval, UINT Flags, const DXGI
|
||||
|
||||
if (willPresent && !State::Instance().reflexLimitsFps && State::Instance().activeFgOutput != FGOutput::NoFG &&
|
||||
!State::Instance().isRunningOnDXVK)
|
||||
FrameLimit::sleep(fg != nullptr ? fg->IsActive() : false);
|
||||
{
|
||||
FrameLimit::sleep(fg != nullptr ? fg->IsActive() && !fg->IsPaused() : false);
|
||||
}
|
||||
|
||||
if (mutexUsed && fg != nullptr)
|
||||
{
|
||||
@@ -1224,6 +1230,8 @@ HRESULT FGHooks::FGPresent(void* This, UINT SyncInterval, UINT Flags, const DXGI
|
||||
fg->Mutex.unlockThis(2);
|
||||
}
|
||||
|
||||
LOG_DEBUG("Present finished");
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user