diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/core/hle/service/nvdrv/devices/nvhost_ctrl.cpp | 5 | ||||
| -rw-r--r-- | src/video_core/gpu.cpp | 4 | ||||
| -rw-r--r-- | src/video_core/gpu.h | 8 | ||||
| -rw-r--r-- | src/video_core/gpu_asynch.cpp | 2 | ||||
| -rw-r--r-- | src/video_core/gpu_synch.cpp | 2 |
5 files changed, 16 insertions, 5 deletions
diff --git a/src/core/hle/service/nvdrv/devices/nvhost_ctrl.cpp b/src/core/hle/service/nvdrv/devices/nvhost_ctrl.cpp index 5b1253f6b..96310ed83 100644 --- a/src/core/hle/service/nvdrv/devices/nvhost_ctrl.cpp +++ b/src/core/hle/service/nvdrv/devices/nvhost_ctrl.cpp | |||
| @@ -60,6 +60,11 @@ u32 nvhost_ctrl::IocCtrlEventWait(const std::vector<u8>& input, std::vector<u8>& | |||
| 60 | } | 60 | } |
| 61 | 61 | ||
| 62 | auto& gpu = Core::System::GetInstance().GPU(); | 62 | auto& gpu = Core::System::GetInstance().GPU(); |
| 63 | // This is mostly to take into account unimplemented features. As synced | ||
| 64 | // gpu is always synced. | ||
| 65 | if (!gpu.IsAsync()) { | ||
| 66 | return NvResult::Success; | ||
| 67 | } | ||
| 63 | gpu.Guard(true); | 68 | gpu.Guard(true); |
| 64 | u32 current_syncpoint_value = gpu.GetSyncpointValue(params.syncpt_id); | 69 | u32 current_syncpoint_value = gpu.GetSyncpointValue(params.syncpt_id); |
| 65 | if (current_syncpoint_value >= params.threshold) { | 70 | if (current_syncpoint_value >= params.threshold) { |
diff --git a/src/video_core/gpu.cpp b/src/video_core/gpu.cpp index c71f0f9bf..086db0e69 100644 --- a/src/video_core/gpu.cpp +++ b/src/video_core/gpu.cpp | |||
| @@ -29,8 +29,8 @@ u32 FramebufferConfig::BytesPerPixel(PixelFormat format) { | |||
| 29 | UNREACHABLE(); | 29 | UNREACHABLE(); |
| 30 | } | 30 | } |
| 31 | 31 | ||
| 32 | GPU::GPU(Core::System& system, VideoCore::RendererBase& renderer) | 32 | GPU::GPU(Core::System& system, VideoCore::RendererBase& renderer, bool is_async) |
| 33 | : system{system}, renderer{renderer} { | 33 | : system{system}, renderer{renderer}, is_async{is_async} { |
| 34 | auto& rasterizer{renderer.Rasterizer()}; | 34 | auto& rasterizer{renderer.Rasterizer()}; |
| 35 | memory_manager = std::make_unique<Tegra::MemoryManager>(rasterizer); | 35 | memory_manager = std::make_unique<Tegra::MemoryManager>(rasterizer); |
| 36 | dma_pusher = std::make_unique<Tegra::DmaPusher>(*this); | 36 | dma_pusher = std::make_unique<Tegra::DmaPusher>(*this); |
diff --git a/src/video_core/gpu.h b/src/video_core/gpu.h index ab1a4bdd4..18ac3237e 100644 --- a/src/video_core/gpu.h +++ b/src/video_core/gpu.h | |||
| @@ -131,7 +131,7 @@ class MemoryManager; | |||
| 131 | 131 | ||
| 132 | class GPU { | 132 | class GPU { |
| 133 | public: | 133 | public: |
| 134 | explicit GPU(Core::System& system, VideoCore::RendererBase& renderer); | 134 | explicit GPU(Core::System& system, VideoCore::RendererBase& renderer, bool is_async); |
| 135 | 135 | ||
| 136 | virtual ~GPU(); | 136 | virtual ~GPU(); |
| 137 | 137 | ||
| @@ -184,6 +184,10 @@ public: | |||
| 184 | } | 184 | } |
| 185 | } | 185 | } |
| 186 | 186 | ||
| 187 | bool IsAsync() const { | ||
| 188 | return is_async; | ||
| 189 | } | ||
| 190 | |||
| 187 | /// Returns a const reference to the GPU DMA pusher. | 191 | /// Returns a const reference to the GPU DMA pusher. |
| 188 | const Tegra::DmaPusher& DmaPusher() const; | 192 | const Tegra::DmaPusher& DmaPusher() const; |
| 189 | 193 | ||
| @@ -298,6 +302,8 @@ private: | |||
| 298 | std::array<std::list<Event>, Service::Nvidia::MaxSyncPoints> events; | 302 | std::array<std::list<Event>, Service::Nvidia::MaxSyncPoints> events; |
| 299 | 303 | ||
| 300 | std::mutex sync_mutex; | 304 | std::mutex sync_mutex; |
| 305 | |||
| 306 | const bool is_async; | ||
| 301 | }; | 307 | }; |
| 302 | 308 | ||
| 303 | #define ASSERT_REG_POSITION(field_name, position) \ | 309 | #define ASSERT_REG_POSITION(field_name, position) \ |
diff --git a/src/video_core/gpu_asynch.cpp b/src/video_core/gpu_asynch.cpp index 7060f9a89..6b6f0f6ec 100644 --- a/src/video_core/gpu_asynch.cpp +++ b/src/video_core/gpu_asynch.cpp | |||
| @@ -11,7 +11,7 @@ | |||
| 11 | namespace VideoCommon { | 11 | namespace VideoCommon { |
| 12 | 12 | ||
| 13 | GPUAsynch::GPUAsynch(Core::System& system, VideoCore::RendererBase& renderer) | 13 | GPUAsynch::GPUAsynch(Core::System& system, VideoCore::RendererBase& renderer) |
| 14 | : GPU(system, renderer), gpu_thread{system} {} | 14 | : GPU(system, renderer, true), gpu_thread{system} {} |
| 15 | 15 | ||
| 16 | GPUAsynch::~GPUAsynch() = default; | 16 | GPUAsynch::~GPUAsynch() = default; |
| 17 | 17 | ||
diff --git a/src/video_core/gpu_synch.cpp b/src/video_core/gpu_synch.cpp index 45e43b1dc..d4ead9c47 100644 --- a/src/video_core/gpu_synch.cpp +++ b/src/video_core/gpu_synch.cpp | |||
| @@ -8,7 +8,7 @@ | |||
| 8 | namespace VideoCommon { | 8 | namespace VideoCommon { |
| 9 | 9 | ||
| 10 | GPUSynch::GPUSynch(Core::System& system, VideoCore::RendererBase& renderer) | 10 | GPUSynch::GPUSynch(Core::System& system, VideoCore::RendererBase& renderer) |
| 11 | : GPU(system, renderer) {} | 11 | : GPU(system, renderer, false) {} |
| 12 | 12 | ||
| 13 | GPUSynch::~GPUSynch() = default; | 13 | GPUSynch::~GPUSynch() = default; |
| 14 | 14 | ||