diff options
author | Fernando Sahmkow <fsahmkow27@gmail.com> | 2019-06-10 14:19:27 +0200 |
---|---|---|
committer | FernandoS27 <fsahmkow27@gmail.com> | 2019-07-05 21:49:20 +0200 |
commit | 0706d633bf7764455082cfdfdc35c14507cb6897 (patch) | |
tree | 00f07387d43df3cf85d786af7d9a35233bf2c9d5 | |
parent | Async GPU: do invalidate as synced operation (diff) | |
download | yuzu-0706d633bf7764455082cfdfdc35c14507cb6897.tar yuzu-0706d633bf7764455082cfdfdc35c14507cb6897.tar.gz yuzu-0706d633bf7764455082cfdfdc35c14507cb6897.tar.bz2 yuzu-0706d633bf7764455082cfdfdc35c14507cb6897.tar.lz yuzu-0706d633bf7764455082cfdfdc35c14507cb6897.tar.xz yuzu-0706d633bf7764455082cfdfdc35c14507cb6897.tar.zst yuzu-0706d633bf7764455082cfdfdc35c14507cb6897.zip |
-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>& } auto& gpu = Core::System::GetInstance().GPU(); + // This is mostly to take into account unimplemented features. As synced + // gpu is always synced. + if (!gpu.IsAsync()) { + return NvResult::Success; + } gpu.Guard(true); u32 current_syncpoint_value = gpu.GetSyncpointValue(params.syncpt_id); 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) { UNREACHABLE(); } -GPU::GPU(Core::System& system, VideoCore::RendererBase& renderer) - : system{system}, renderer{renderer} { +GPU::GPU(Core::System& system, VideoCore::RendererBase& renderer, bool is_async) + : system{system}, renderer{renderer}, is_async{is_async} { auto& rasterizer{renderer.Rasterizer()}; memory_manager = std::make_unique<Tegra::MemoryManager>(rasterizer); 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; class GPU { public: - explicit GPU(Core::System& system, VideoCore::RendererBase& renderer); + explicit GPU(Core::System& system, VideoCore::RendererBase& renderer, bool is_async); virtual ~GPU(); @@ -184,6 +184,10 @@ public: } } + bool IsAsync() const { + return is_async; + } + /// Returns a const reference to the GPU DMA pusher. const Tegra::DmaPusher& DmaPusher() const; @@ -298,6 +302,8 @@ private: std::array<std::list<Event>, Service::Nvidia::MaxSyncPoints> events; std::mutex sync_mutex; + + const bool is_async; }; #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 @@ namespace VideoCommon { GPUAsynch::GPUAsynch(Core::System& system, VideoCore::RendererBase& renderer) - : GPU(system, renderer), gpu_thread{system} {} + : GPU(system, renderer, true), gpu_thread{system} {} GPUAsynch::~GPUAsynch() = default; 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 @@ namespace VideoCommon { GPUSynch::GPUSynch(Core::System& system, VideoCore::RendererBase& renderer) - : GPU(system, renderer) {} + : GPU(system, renderer, false) {} GPUSynch::~GPUSynch() = default; |