From 1ea747ec9ffbb7a21d74c6c017a13fbb1f25ebde Mon Sep 17 00:00:00 2001 From: FakeMichau <49685661+FakeMichau@users.noreply.github.com> Date: Fri, 22 Aug 2025 14:54:23 +0200 Subject: [PATCH] Mutex up SL's report resource --- OptiScaler/inputs/FG/Streamline_Inputs_Dx12.cpp | 2 ++ OptiScaler/inputs/FG/Streamline_Inputs_Dx12.h | 1 + 2 files changed, 3 insertions(+) diff --git a/OptiScaler/inputs/FG/Streamline_Inputs_Dx12.cpp b/OptiScaler/inputs/FG/Streamline_Inputs_Dx12.cpp index 23eaf74f..2fdc3a4f 100644 --- a/OptiScaler/inputs/FG/Streamline_Inputs_Dx12.cpp +++ b/OptiScaler/inputs/FG/Streamline_Inputs_Dx12.cpp @@ -148,6 +148,8 @@ bool Sl_Inputs_Dx12::evaluateState(ID3D12Device* device) bool Sl_Inputs_Dx12::reportResource(const sl::ResourceTag& tag, ID3D12GraphicsCommandList* cmdBuffer, uint32_t frameId) { + std::scoped_lock lock(reportResourceMutex); + if (!cmdBuffer) LOG_TRACE("cmdBuffer is null"); diff --git a/OptiScaler/inputs/FG/Streamline_Inputs_Dx12.h b/OptiScaler/inputs/FG/Streamline_Inputs_Dx12.h index 6ed65bf4..d4ef70b2 100644 --- a/OptiScaler/inputs/FG/Streamline_Inputs_Dx12.h +++ b/OptiScaler/inputs/FG/Streamline_Inputs_Dx12.h @@ -22,6 +22,7 @@ class Sl_Inputs_Dx12 bool distortionFieldRequired = false; bool dispatched = false; + std::mutex reportResourceMutex {}; uint32_t lastConstantsFrameId = UINT32_MAX; uint32_t lastPresentFrameId = 0;