summaryrefslogtreecommitdiff
path: root/src/video_core/gpu_synch.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_synch.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_synch.h')
-rw-r--r--src/video_core/gpu_synch.h10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/video_core/gpu_synch.h b/src/video_core/gpu_synch.h
index c71baee89..866a94c8c 100644
--- a/src/video_core/gpu_synch.h
+++ b/src/video_core/gpu_synch.h
@@ -6,6 +6,10 @@
6 6
7#include "video_core/gpu.h" 7#include "video_core/gpu.h"
8 8
9namespace Core::Frontend {
10class GraphicsContext;
11}
12
9namespace VideoCore { 13namespace VideoCore {
10class RendererBase; 14class RendererBase;
11} // namespace VideoCore 15} // namespace VideoCore
@@ -15,7 +19,8 @@ namespace VideoCommon {
15/// Implementation of GPU interface that runs the GPU synchronously 19/// Implementation of GPU interface that runs the GPU synchronously
16class GPUSynch final : public Tegra::GPU { 20class GPUSynch final : public Tegra::GPU {
17public: 21public:
18 explicit GPUSynch(Core::System& system, VideoCore::RendererBase& renderer); 22 explicit GPUSynch(Core::System& system, std::unique_ptr<VideoCore::RendererBase>&& renderer,
23 std::unique_ptr<Core::Frontend::GraphicsContext>&& context);
19 ~GPUSynch() override; 24 ~GPUSynch() override;
20 25
21 void Start() override; 26 void Start() override;
@@ -29,6 +34,9 @@ public:
29protected: 34protected:
30 void TriggerCpuInterrupt([[maybe_unused]] u32 syncpoint_id, 35 void TriggerCpuInterrupt([[maybe_unused]] u32 syncpoint_id,
31 [[maybe_unused]] u32 value) const override {} 36 [[maybe_unused]] u32 value) const override {}
37
38private:
39 std::unique_ptr<Core::Frontend::GraphicsContext> context;
32}; 40};
33 41
34} // namespace VideoCommon 42} // namespace VideoCommon