summaryrefslogtreecommitdiff
path: root/src/video_core/gpu_thread.h
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_thread.h
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_thread.h')
-rw-r--r--src/video_core/gpu_thread.h7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/video_core/gpu_thread.h b/src/video_core/gpu_thread.h
index 882e2d9c7..be36c580e 100644
--- a/src/video_core/gpu_thread.h
+++ b/src/video_core/gpu_thread.h
@@ -10,7 +10,6 @@
10#include <optional> 10#include <optional>
11#include <thread> 11#include <thread>
12#include <variant> 12#include <variant>
13
14#include "common/threadsafe_queue.h" 13#include "common/threadsafe_queue.h"
15#include "video_core/gpu.h" 14#include "video_core/gpu.h"
16 15
@@ -20,6 +19,9 @@ class DmaPusher;
20} // namespace Tegra 19} // namespace Tegra
21 20
22namespace Core { 21namespace Core {
22namespace Frontend {
23class GraphicsContext;
24}
23class System; 25class System;
24} // namespace Core 26} // namespace Core
25 27
@@ -99,7 +101,8 @@ public:
99 ~ThreadManager(); 101 ~ThreadManager();
100 102
101 /// Creates and starts the GPU thread. 103 /// Creates and starts the GPU thread.
102 void StartThread(VideoCore::RendererBase& renderer, Tegra::DmaPusher& dma_pusher); 104 void StartThread(VideoCore::RendererBase& renderer, Core::Frontend::GraphicsContext& context,
105 Tegra::DmaPusher& dma_pusher);
103 106
104 /// Push GPU command entries to be processed 107 /// Push GPU command entries to be processed
105 void SubmitList(Tegra::CommandList&& entries); 108 void SubmitList(Tegra::CommandList&& entries);