diff options
| author | 2019-02-08 23:21:53 -0500 | |
|---|---|---|
| committer | 2019-03-06 21:48:57 -0500 | |
| commit | aaa373585cd55bd03fcc589d2ad9f749e2cb99d4 (patch) | |
| tree | 1da617fd05d84d59910d585a6b01af2c89f3ed36 /src/video_core/gpu.h | |
| parent | gpu: Move command processing to another thread. (diff) | |
| download | yuzu-aaa373585cd55bd03fcc589d2ad9f749e2cb99d4.tar.gz yuzu-aaa373585cd55bd03fcc589d2ad9f749e2cb99d4.tar.xz yuzu-aaa373585cd55bd03fcc589d2ad9f749e2cb99d4.zip | |
gpu: Refactor a/synchronous implementations into their own classes.
Diffstat (limited to 'src/video_core/gpu.h')
| -rw-r--r-- | src/video_core/gpu.h | 26 |
1 files changed, 11 insertions, 15 deletions
diff --git a/src/video_core/gpu.h b/src/video_core/gpu.h index 3f3098bf1..14a421cc1 100644 --- a/src/video_core/gpu.h +++ b/src/video_core/gpu.h | |||
| @@ -19,10 +19,6 @@ namespace VideoCore { | |||
| 19 | class RendererBase; | 19 | class RendererBase; |
| 20 | } // namespace VideoCore | 20 | } // namespace VideoCore |
| 21 | 21 | ||
| 22 | namespace VideoCommon::GPUThread { | ||
| 23 | class ThreadManager; | ||
| 24 | } // namespace VideoCommon::GPUThread | ||
| 25 | |||
| 26 | namespace Tegra { | 22 | namespace Tegra { |
| 27 | 23 | ||
| 28 | enum class RenderTargetFormat : u32 { | 24 | enum class RenderTargetFormat : u32 { |
| @@ -123,7 +119,7 @@ enum class EngineID { | |||
| 123 | MAXWELL_DMA_COPY_A = 0xB0B5, | 119 | MAXWELL_DMA_COPY_A = 0xB0B5, |
| 124 | }; | 120 | }; |
| 125 | 121 | ||
| 126 | class GPU final { | 122 | class GPU { |
| 127 | public: | 123 | public: |
| 128 | explicit GPU(Core::System& system, VideoCore::RendererBase& renderer); | 124 | explicit GPU(Core::System& system, VideoCore::RendererBase& renderer); |
| 129 | 125 | ||
| @@ -206,20 +202,20 @@ public: | |||
| 206 | } regs{}; | 202 | } regs{}; |
| 207 | 203 | ||
| 208 | /// Push GPU command entries to be processed | 204 | /// Push GPU command entries to be processed |
| 209 | void PushGPUEntries(Tegra::CommandList&& entries); | 205 | virtual void PushGPUEntries(Tegra::CommandList&& entries) = 0; |
| 210 | 206 | ||
| 211 | /// Swap buffers (render frame) | 207 | /// Swap buffers (render frame) |
| 212 | void SwapBuffers( | 208 | virtual void SwapBuffers( |
| 213 | std::optional<std::reference_wrapper<const Tegra::FramebufferConfig>> framebuffer); | 209 | std::optional<std::reference_wrapper<const Tegra::FramebufferConfig>> framebuffer) = 0; |
| 214 | 210 | ||
| 215 | /// Notify rasterizer that any caches of the specified region should be flushed to Switch memory | 211 | /// Notify rasterizer that any caches of the specified region should be flushed to Switch memory |
| 216 | void FlushRegion(VAddr addr, u64 size); | 212 | virtual void FlushRegion(VAddr addr, u64 size) = 0; |
| 217 | 213 | ||
| 218 | /// Notify rasterizer that any caches of the specified region should be invalidated | 214 | /// Notify rasterizer that any caches of the specified region should be invalidated |
| 219 | void InvalidateRegion(VAddr addr, u64 size); | 215 | virtual void InvalidateRegion(VAddr addr, u64 size) = 0; |
| 220 | 216 | ||
| 221 | /// Notify rasterizer that any caches of the specified region should be flushed and invalidated | 217 | /// Notify rasterizer that any caches of the specified region should be flushed and invalidated |
| 222 | void FlushAndInvalidateRegion(VAddr addr, u64 size); | 218 | virtual void FlushAndInvalidateRegion(VAddr addr, u64 size) = 0; |
| 223 | 219 | ||
| 224 | private: | 220 | private: |
| 225 | void ProcessBindMethod(const MethodCall& method_call); | 221 | void ProcessBindMethod(const MethodCall& method_call); |
| @@ -236,13 +232,13 @@ private: | |||
| 236 | /// Determines where the method should be executed. | 232 | /// Determines where the method should be executed. |
| 237 | bool ExecuteMethodOnEngine(const MethodCall& method_call); | 233 | bool ExecuteMethodOnEngine(const MethodCall& method_call); |
| 238 | 234 | ||
| 239 | private: | 235 | protected: |
| 240 | std::unique_ptr<Tegra::DmaPusher> dma_pusher; | 236 | std::unique_ptr<Tegra::DmaPusher> dma_pusher; |
| 241 | std::unique_ptr<Tegra::MemoryManager> memory_manager; | ||
| 242 | std::unique_ptr<VideoCommon::GPUThread::ThreadManager> gpu_thread; | ||
| 243 | |||
| 244 | VideoCore::RendererBase& renderer; | 237 | VideoCore::RendererBase& renderer; |
| 245 | 238 | ||
| 239 | private: | ||
| 240 | std::unique_ptr<Tegra::MemoryManager> memory_manager; | ||
| 241 | |||
| 246 | /// Mapping of command subchannels to their bound engine ids. | 242 | /// Mapping of command subchannels to their bound engine ids. |
| 247 | std::array<EngineID, 8> bound_engines = {}; | 243 | std::array<EngineID, 8> bound_engines = {}; |
| 248 | 244 | ||