diff options
author | liamwhite <liamwhite@users.noreply.github.com> | 2022-11-30 00:45:05 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-11-30 00:45:05 +0100 |
commit | 1a6785d296e01e5d4bed2101af62aa15f1f8c87f (patch) | |
tree | 8ebe3644daa9e42f9931e646747cff8afb1c7bf8 | |
parent | Merge pull request #9340 from lioncash/nvdrv (diff) | |
parent | host1x/syncpoint_manager: Eliminate unnecessary std::function construction (diff) | |
download | yuzu-1a6785d296e01e5d4bed2101af62aa15f1f8c87f.tar yuzu-1a6785d296e01e5d4bed2101af62aa15f1f8c87f.tar.gz yuzu-1a6785d296e01e5d4bed2101af62aa15f1f8c87f.tar.bz2 yuzu-1a6785d296e01e5d4bed2101af62aa15f1f8c87f.tar.lz yuzu-1a6785d296e01e5d4bed2101af62aa15f1f8c87f.tar.xz yuzu-1a6785d296e01e5d4bed2101af62aa15f1f8c87f.tar.zst yuzu-1a6785d296e01e5d4bed2101af62aa15f1f8c87f.zip |
-rw-r--r-- | src/video_core/host1x/syncpoint_manager.cpp | 6 | ||||
-rw-r--r-- | src/video_core/host1x/syncpoint_manager.h | 12 |
2 files changed, 8 insertions, 10 deletions
diff --git a/src/video_core/host1x/syncpoint_manager.cpp b/src/video_core/host1x/syncpoint_manager.cpp index a44fc83d3..8f23ce527 100644 --- a/src/video_core/host1x/syncpoint_manager.cpp +++ b/src/video_core/host1x/syncpoint_manager.cpp @@ -34,7 +34,7 @@ SyncpointManager::ActionHandle SyncpointManager::RegisterAction( } void SyncpointManager::DeregisterAction(std::list<RegisteredAction>& action_storage, - ActionHandle& handle) { + const ActionHandle& handle) { std::unique_lock lk(guard); // We want to ensure the iterator still exists prior to erasing it @@ -49,11 +49,11 @@ void SyncpointManager::DeregisterAction(std::list<RegisteredAction>& action_stor } } -void SyncpointManager::DeregisterGuestAction(u32 syncpoint_id, ActionHandle& handle) { +void SyncpointManager::DeregisterGuestAction(u32 syncpoint_id, const ActionHandle& handle) { DeregisterAction(guest_action_storage[syncpoint_id], handle); } -void SyncpointManager::DeregisterHostAction(u32 syncpoint_id, ActionHandle& handle) { +void SyncpointManager::DeregisterHostAction(u32 syncpoint_id, const ActionHandle& handle) { DeregisterAction(host_action_storage[syncpoint_id], handle); } diff --git a/src/video_core/host1x/syncpoint_manager.h b/src/video_core/host1x/syncpoint_manager.h index 50a264e23..847ed20c8 100644 --- a/src/video_core/host1x/syncpoint_manager.h +++ b/src/video_core/host1x/syncpoint_manager.h @@ -36,21 +36,19 @@ public: template <typename Func> ActionHandle RegisterGuestAction(u32 syncpoint_id, u32 expected_value, Func&& action) { - std::function<void()> func(action); return RegisterAction(syncpoints_guest[syncpoint_id], guest_action_storage[syncpoint_id], - expected_value, std::move(func)); + expected_value, std::move(action)); } template <typename Func> ActionHandle RegisterHostAction(u32 syncpoint_id, u32 expected_value, Func&& action) { - std::function<void()> func(action); return RegisterAction(syncpoints_host[syncpoint_id], host_action_storage[syncpoint_id], - expected_value, std::move(func)); + expected_value, std::move(action)); } - void DeregisterGuestAction(u32 syncpoint_id, ActionHandle& handle); + void DeregisterGuestAction(u32 syncpoint_id, const ActionHandle& handle); - void DeregisterHostAction(u32 syncpoint_id, ActionHandle& handle); + void DeregisterHostAction(u32 syncpoint_id, const ActionHandle& handle); void IncrementGuest(u32 syncpoint_id); @@ -76,7 +74,7 @@ private: std::list<RegisteredAction>& action_storage, u32 expected_value, std::function<void()>&& action); - void DeregisterAction(std::list<RegisteredAction>& action_storage, ActionHandle& handle); + void DeregisterAction(std::list<RegisteredAction>& action_storage, const ActionHandle& handle); void Wait(std::atomic<u32>& syncpoint, std::condition_variable& wait_cv, u32 expected_value); |