summaryrefslogtreecommitdiff
path: root/src/core/hardware_interrupt_manager.cpp
diff options
context:
space:
mode:
authorGravatar bunnei2019-11-26 21:48:56 -0500
committerGravatar GitHub2019-11-26 21:48:56 -0500
commitec0ce96c568b2b610c5218efd7faa5d9a19350f8 (patch)
tree61b5133e3cc6a9edf3b45c5fe6604493689f6769 /src/core/hardware_interrupt_manager.cpp
parentMerge pull request #3164 from ReinUsesLisp/half-cast-float (diff)
downloadyuzu-ec0ce96c568b2b610c5218efd7faa5d9a19350f8.tar.gz
yuzu-ec0ce96c568b2b610c5218efd7faa5d9a19350f8.tar.xz
yuzu-ec0ce96c568b2b610c5218efd7faa5d9a19350f8.zip
core_timing: Use better reference tracking for EventType. (#3159)
* core_timing: Use better reference tracking for EventType. - Moves ownership of the event to the caller, ensuring we don't fire events for destroyed objects. - Removes need for unique names - we won't be using this for save states anyways.
Diffstat (limited to 'src/core/hardware_interrupt_manager.cpp')
-rw-r--r--src/core/hardware_interrupt_manager.cpp13
1 files changed, 6 insertions, 7 deletions
diff --git a/src/core/hardware_interrupt_manager.cpp b/src/core/hardware_interrupt_manager.cpp
index c2115db2d..c629d9fa1 100644
--- a/src/core/hardware_interrupt_manager.cpp
+++ b/src/core/hardware_interrupt_manager.cpp
@@ -11,13 +11,12 @@
11namespace Core::Hardware { 11namespace Core::Hardware {
12 12
13InterruptManager::InterruptManager(Core::System& system_in) : system(system_in) { 13InterruptManager::InterruptManager(Core::System& system_in) : system(system_in) {
14 gpu_interrupt_event = 14 gpu_interrupt_event = Core::Timing::CreateEvent("GPUInterrupt", [this](u64 message, s64) {
15 system.CoreTiming().RegisterEvent("GPUInterrupt", [this](u64 message, s64) { 15 auto nvdrv = system.ServiceManager().GetService<Service::Nvidia::NVDRV>("nvdrv");
16 auto nvdrv = system.ServiceManager().GetService<Service::Nvidia::NVDRV>("nvdrv"); 16 const u32 syncpt = static_cast<u32>(message >> 32);
17 const u32 syncpt = static_cast<u32>(message >> 32); 17 const u32 value = static_cast<u32>(message);
18 const u32 value = static_cast<u32>(message); 18 nvdrv->SignalGPUInterruptSyncpt(syncpt, value);
19 nvdrv->SignalGPUInterruptSyncpt(syncpt, value); 19 });
20 });
21} 20}
22 21
23InterruptManager::~InterruptManager() = default; 22InterruptManager::~InterruptManager() = default;