summaryrefslogtreecommitdiff
path: root/src/video_core/gpu.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.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.h')
-rw-r--r--src/video_core/gpu.h18
1 files changed, 15 insertions, 3 deletions
diff --git a/src/video_core/gpu.h b/src/video_core/gpu.h
index 64acb17df..ced9d7e28 100644
--- a/src/video_core/gpu.h
+++ b/src/video_core/gpu.h
@@ -25,8 +25,11 @@ inline u8* FromCacheAddr(CacheAddr cache_addr) {
25} 25}
26 26
27namespace Core { 27namespace Core {
28class System; 28namespace Frontend {
29class EmuWindow;
29} 30}
31class System;
32} // namespace Core
30 33
31namespace VideoCore { 34namespace VideoCore {
32class RendererBase; 35class RendererBase;
@@ -129,7 +132,8 @@ class MemoryManager;
129 132
130class GPU { 133class GPU {
131public: 134public:
132 explicit GPU(Core::System& system, VideoCore::RendererBase& renderer, bool is_async); 135 explicit GPU(Core::System& system, std::unique_ptr<VideoCore::RendererBase>&& renderer,
136 bool is_async);
133 137
134 virtual ~GPU(); 138 virtual ~GPU();
135 139
@@ -174,6 +178,14 @@ public:
174 /// Returns a reference to the GPU DMA pusher. 178 /// Returns a reference to the GPU DMA pusher.
175 Tegra::DmaPusher& DmaPusher(); 179 Tegra::DmaPusher& DmaPusher();
176 180
181 VideoCore::RendererBase& Renderer() {
182 return *renderer;
183 }
184
185 const VideoCore::RendererBase& Renderer() const {
186 return *renderer;
187 }
188
177 // Waits for the GPU to finish working 189 // Waits for the GPU to finish working
178 virtual void WaitIdle() const = 0; 190 virtual void WaitIdle() const = 0;
179 191
@@ -287,7 +299,7 @@ private:
287protected: 299protected:
288 std::unique_ptr<Tegra::DmaPusher> dma_pusher; 300 std::unique_ptr<Tegra::DmaPusher> dma_pusher;
289 Core::System& system; 301 Core::System& system;
290 VideoCore::RendererBase& renderer; 302 std::unique_ptr<VideoCore::RendererBase> renderer;
291 303
292private: 304private:
293 std::unique_ptr<Tegra::MemoryManager> memory_manager; 305 std::unique_ptr<Tegra::MemoryManager> memory_manager;