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;