mirror of
https://github.com/optiscaler/OptiScaler.git
synced 2026-10-07 20:42:35 +00:00
Try to fix missing hudless in some cases
Slopped. CheckForFrame can get called in the middle of resource tagging and that would trigger hudless to be assigned to an incorrect frame
This commit is contained in:
1 parent
1818c2af2e
commit
7f0bbb7e97
2 files changed
+8
-8
No files matched your search
@@ -463,9 +463,10 @@ NVSDK_NGX_Result Nvngx_FFX::D3D12_EvaluateFeature(ID3D12GraphicsCommandList* InC
|
||||
createFg.backBufferFormat = ffxApiGetSurfaceFormatDX12(backbuffer->GetDesc().Format);
|
||||
createFg.header.pNext = &backendDesc.header;
|
||||
|
||||
ffxCreateContextDescFrameGenerationHudless hudlessFormat {};
|
||||
|
||||
if (hudlessFormatFfx != 0 && backbufferFormatFfx != hudlessFormatFfx)
|
||||
{
|
||||
ffxCreateContextDescFrameGenerationHudless hudlessFormat {};
|
||||
hudlessFormat.header.type = FFX_API_CREATE_CONTEXT_DESC_TYPE_FRAMEGENERATION_HUDLESS;
|
||||
hudlessFormat.hudlessBackBufferFormat = hudlessFormatFfx;
|
||||
|
||||
|
||||
@@ -8,7 +8,11 @@ void Sl_Inputs_Dx12::CheckForFrame(IFGFeature_Dx12* fg, uint32_t frameId)
|
||||
{
|
||||
std::scoped_lock lock(_frameBoundaryMutex);
|
||||
|
||||
if (_isFrameFinished && _lastPresentFrameId == _currentFrameId && frameId == 0 && frameId != _currentFrameId)
|
||||
const bool presentMarked = _isFrameFinished && _lastPresentFrameId == _currentFrameId;
|
||||
const bool fgDispatched =
|
||||
fg->IsActive() && !fg->IsPaused() && fg->IsDispatched() && fg->FrameCount() == _currentFrameId;
|
||||
|
||||
if ((presentMarked || fgDispatched) && frameId == 0 && _currentFrameId != 0)
|
||||
{
|
||||
LOG_DEBUG("1> CheckForFrame: frameId={}, currentFrameId={}, lastPresentFrameId={}, isFrameFinished={}", frameId,
|
||||
_currentFrameId, _lastPresentFrameId, _isFrameFinished);
|
||||
@@ -17,12 +21,7 @@ void Sl_Inputs_Dx12::CheckForFrame(IFGFeature_Dx12* fg, uint32_t frameId)
|
||||
|
||||
fg->StartNewFrame();
|
||||
_currentIndex = fg->GetIndex();
|
||||
|
||||
if (frameId != 0)
|
||||
_currentFrameId = frameId;
|
||||
else
|
||||
_currentFrameId = _lastPresentFrameId + 1;
|
||||
|
||||
_currentFrameId++;
|
||||
_frameIdIndex[_currentIndex] = _currentFrameId;
|
||||
}
|
||||
else if (frameId != 0 && frameId > _currentFrameId)
|
||||
|
||||
Reference in new issue
Block a user