From 9466f593273c2fab1a44edb0c9b1f038dcd1bb31 Mon Sep 17 00:00:00 2001 From: Maximilian Seidler <78690852+PaideiaDilemma@users.noreply.github.com> Date: Wed, 13 Mar 2024 22:23:21 +0100 Subject: [PATCH] asyncResourceGatherer: skip processing screenshot paths and remove initThread (#189) * asyncResourceGatherer: skip processing screenshot paths * asyncResourceGatherer: remove initThread --- src/renderer/AsyncResourceGatherer.cpp | 11 +++++------ src/renderer/AsyncResourceGatherer.hpp | 1 - 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/src/renderer/AsyncResourceGatherer.cpp b/src/renderer/AsyncResourceGatherer.cpp index d104f0b..b37331b 100644 --- a/src/renderer/AsyncResourceGatherer.cpp +++ b/src/renderer/AsyncResourceGatherer.cpp @@ -10,12 +10,11 @@ std::mutex cvmtx; CAsyncResourceGatherer::CAsyncResourceGatherer() { - initThread = std::thread([this]() { - this->gather(); - this->asyncLoopThread = std::thread([this]() { this->asyncAssetSpinLock(); }); - this->asyncLoopThread.detach(); + asyncLoopThread = std::thread([this]() { + this->gather(); /* inital gather */ + this->asyncAssetSpinLock(); }); - initThread.detach(); + asyncLoopThread.detach(); // some things can't be done async :( // gather background textures when needed @@ -128,7 +127,7 @@ void CAsyncResourceGatherer::gather() { std::string path = std::any_cast(c.values.at("path")); - if (path.empty()) + if (path.empty() || path == "screenshot") continue; std::string id = std::string{"background:"} + path; diff --git a/src/renderer/AsyncResourceGatherer.hpp b/src/renderer/AsyncResourceGatherer.hpp index ff734a4..b6dab11 100644 --- a/src/renderer/AsyncResourceGatherer.hpp +++ b/src/renderer/AsyncResourceGatherer.hpp @@ -52,7 +52,6 @@ class CAsyncResourceGatherer { void recheckDMAFramesFor(COutput* output); private: - std::thread initThread; std::thread asyncLoopThread; void asyncAssetSpinLock();