summaryrefslogtreecommitdiff
path: root/src/video_core/gpu_thread.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/video_core/gpu_thread.cpp')
-rw-r--r--src/video_core/gpu_thread.cpp15
1 files changed, 9 insertions, 6 deletions
diff --git a/src/video_core/gpu_thread.cpp b/src/video_core/gpu_thread.cpp
index b1088af3d..270c7ae0d 100644
--- a/src/video_core/gpu_thread.cpp
+++ b/src/video_core/gpu_thread.cpp
@@ -5,7 +5,7 @@
5#include "common/assert.h" 5#include "common/assert.h"
6#include "common/microprofile.h" 6#include "common/microprofile.h"
7#include "core/core.h" 7#include "core/core.h"
8#include "core/frontend/scope_acquire_context.h" 8#include "core/frontend/emu_window.h"
9#include "video_core/dma_pusher.h" 9#include "video_core/dma_pusher.h"
10#include "video_core/gpu.h" 10#include "video_core/gpu.h"
11#include "video_core/gpu_thread.h" 11#include "video_core/gpu_thread.h"
@@ -14,8 +14,8 @@
14namespace VideoCommon::GPUThread { 14namespace VideoCommon::GPUThread {
15 15
16/// Runs the GPU thread 16/// Runs the GPU thread
17static void RunThread(VideoCore::RendererBase& renderer, Tegra::DmaPusher& dma_pusher, 17static void RunThread(VideoCore::RendererBase& renderer, Core::Frontend::GraphicsContext& context,
18 SynchState& state) { 18 Tegra::DmaPusher& dma_pusher, SynchState& state) {
19 MicroProfileOnThreadCreate("GpuThread"); 19 MicroProfileOnThreadCreate("GpuThread");
20 20
21 // Wait for first GPU command before acquiring the window context 21 // Wait for first GPU command before acquiring the window context
@@ -27,7 +27,7 @@ static void RunThread(VideoCore::RendererBase& renderer, Tegra::DmaPusher& dma_p
27 return; 27 return;
28 } 28 }
29 29
30 Core::Frontend::ScopeAcquireContext acquire_context{renderer.GetRenderWindow()}; 30 auto current_context = context.Acquire();
31 31
32 CommandDataContainer next; 32 CommandDataContainer next;
33 while (state.is_running) { 33 while (state.is_running) {
@@ -62,8 +62,11 @@ ThreadManager::~ThreadManager() {
62 thread.join(); 62 thread.join();
63} 63}
64 64
65void ThreadManager::StartThread(VideoCore::RendererBase& renderer, Tegra::DmaPusher& dma_pusher) { 65void ThreadManager::StartThread(VideoCore::RendererBase& renderer,
66 thread = std::thread{RunThread, std::ref(renderer), std::ref(dma_pusher), std::ref(state)}; 66 Core::Frontend::GraphicsContext& context,
67 Tegra::DmaPusher& dma_pusher) {
68 thread = std::thread{RunThread, std::ref(renderer), std::ref(context), std::ref(dma_pusher),
69 std::ref(state)};
67} 70}
68 71
69void ThreadManager::SubmitList(Tegra::CommandList&& entries) { 72void ThreadManager::SubmitList(Tegra::CommandList&& entries) {