summaryrefslogtreecommitdiffstats
path: root/src/core
diff options
context:
space:
mode:
authorLiam <byteslice@airmail.cc>2022-06-17 05:42:39 +0200
committerLiam <byteslice@airmail.cc>2022-06-17 05:43:35 +0200
commita6371fb69dc87a65b766a2a274e6cf25459b8975 (patch)
tree5da9f8475543baf027cb0885bb35f06258c48d06 /src/core
parentMerge pull request #8472 from german77/tace (diff)
downloadyuzu-a6371fb69dc87a65b766a2a274e6cf25459b8975.tar
yuzu-a6371fb69dc87a65b766a2a274e6cf25459b8975.tar.gz
yuzu-a6371fb69dc87a65b766a2a274e6cf25459b8975.tar.bz2
yuzu-a6371fb69dc87a65b766a2a274e6cf25459b8975.tar.lz
yuzu-a6371fb69dc87a65b766a2a274e6cf25459b8975.tar.xz
yuzu-a6371fb69dc87a65b766a2a274e6cf25459b8975.tar.zst
yuzu-a6371fb69dc87a65b766a2a274e6cf25459b8975.zip
Diffstat (limited to 'src/core')
-rw-r--r--src/core/cpu_manager.cpp3
-rw-r--r--src/core/cpu_manager.h5
2 files changed, 8 insertions, 0 deletions
diff --git a/src/core/cpu_manager.cpp b/src/core/cpu_manager.cpp
index 1c07dc90e..d69b2602a 100644
--- a/src/core/cpu_manager.cpp
+++ b/src/core/cpu_manager.cpp
@@ -26,6 +26,7 @@ void CpuManager::ThreadStart(std::stop_token stop_token, CpuManager& cpu_manager
void CpuManager::Initialize() {
num_cores = is_multicore ? Core::Hardware::NUM_CPU_CORES : 1;
+ gpu_barrier = std::make_unique<Common::Barrier>(num_cores + 1);
for (std::size_t core = 0; core < num_cores; core++) {
core_data[core].host_thread = std::jthread(ThreadStart, std::ref(*this), core);
@@ -230,6 +231,8 @@ void CpuManager::RunThread(std::size_t core) {
});
// Running
+ gpu_barrier->Sync();
+
if (!is_async_gpu && !is_multicore) {
system.GPU().ObtainContext();
}
diff --git a/src/core/cpu_manager.h b/src/core/cpu_manager.h
index 681bdaf19..f0751fc58 100644
--- a/src/core/cpu_manager.h
+++ b/src/core/cpu_manager.h
@@ -43,6 +43,10 @@ public:
is_async_gpu = is_async;
}
+ void OnGpuReady() {
+ gpu_barrier->Sync();
+ }
+
void Initialize();
void Shutdown();
@@ -81,6 +85,7 @@ private:
std::jthread host_thread;
};
+ std::unique_ptr<Common::Barrier> gpu_barrier{};
std::array<CoreData, Core::Hardware::NUM_CPU_CORES> core_data{};
bool is_async_gpu{};