summaryrefslogtreecommitdiff
path: root/src/video_core/gpu_asynch.cpp
diff options
context:
space:
mode:
authorGravatar James Rowe2020-03-24 20:58:49 -0600
committerGravatar James Rowe2020-03-24 21:03:42 -0600
commit282adfc70b5d7d958d564bfda0227bb3fbd8d110 (patch)
tree2a98e3bedec2e7fdb33478814a73be664661aecc /src/video_core/gpu_asynch.cpp
parentUse the correct directory for Qt Plugins (diff)
downloadyuzu-282adfc70b5d7d958d564bfda0227bb3fbd8d110.tar.gz
yuzu-282adfc70b5d7d958d564bfda0227bb3fbd8d110.tar.xz
yuzu-282adfc70b5d7d958d564bfda0227bb3fbd8d110.zip
Frontend/GPU: Refactor context management
Changes the GraphicsContext to be managed by the GPU core. This eliminates the need for the frontends to fool around with tricky MakeCurrent/DoneCurrent calls that are dependent on the settings (such as async gpu option). This also refactors out the need to use QWidget::fromWindowContainer as that caused issues with focus and input handling. Now we use a regular QWidget and just access the native windowHandle() directly. Another change is removing the debug tool setting in FrameMailbox. Instead of trying to block the frontend until a new frame is ready, the core will now take over presentation and draw directly to the window if the renderer detects that its hooked by NSight or RenderDoc Lastly, since it was in the way, I removed ScopeAcquireWindowContext and replaced it with a simple subclass in GraphicsContext that achieves the same result
Diffstat (limited to 'src/video_core/gpu_asynch.cpp')
-rw-r--r--src/video_core/gpu_asynch.cpp9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/video_core/gpu_asynch.cpp b/src/video_core/gpu_asynch.cpp
index 04222d060..925be8d7b 100644
--- a/src/video_core/gpu_asynch.cpp
+++ b/src/video_core/gpu_asynch.cpp
@@ -10,13 +10,16 @@
10 10
11namespace VideoCommon { 11namespace VideoCommon {
12 12
13GPUAsynch::GPUAsynch(Core::System& system, VideoCore::RendererBase& renderer) 13GPUAsynch::GPUAsynch(Core::System& system, std::unique_ptr<VideoCore::RendererBase>&& renderer_,
14 : GPU(system, renderer, true), gpu_thread{system} {} 14 std::unique_ptr<Core::Frontend::GraphicsContext>&& context)
15 : GPU(system, std::move(renderer_), true), gpu_thread{system}, gpu_context(std::move(context)),
16 cpu_context(renderer->GetRenderWindow().CreateSharedContext()) {}
15 17
16GPUAsynch::~GPUAsynch() = default; 18GPUAsynch::~GPUAsynch() = default;
17 19
18void GPUAsynch::Start() { 20void GPUAsynch::Start() {
19 gpu_thread.StartThread(renderer, *dma_pusher); 21 cpu_context->MakeCurrent();
22 gpu_thread.StartThread(*renderer, *gpu_context, *dma_pusher);
20} 23}
21 24
22void GPUAsynch::PushGPUEntries(Tegra::CommandList&& entries) { 25void GPUAsynch::PushGPUEntries(Tegra::CommandList&& entries) {