VERY experimental Nintendo Switch 2 emulator
C++
fixup! hle service: nvdrv: nvhost_gpu: Update to use SyncpointManager and other improvements.
bunneif8b764dbf242
diff --git a/src/core/hle/service/nvdrv/devices/nvhost_gpu.cpp b/src/core/hle/service/nvdrv/devices/nvhost_gpu.cppindex 2b9a8722cc..1520195481 100644--- a/src/core/hle/service/nvdrv/devices/nvhost_gpu.cpp+++ b/src/core/hle/service/nvdrv/devices/nvhost_gpu.cpp@@ -16,7 +16,10 @@ namespace Service::Nvidia::Devices {nvhost_gpu::nvhost_gpu(Core::System& system, std::shared_ptr<nvmap> nvmap_dev,SyncpointManager& syncpoint_manager)- : nvdevice(system), nvmap_dev(std::move(nvmap_dev)), syncpoint_manager{syncpoint_manager} {}+ : nvdevice(system), nvmap_dev(std::move(nvmap_dev)), syncpoint_manager{syncpoint_manager} {+ channel_fence.id = syncpoint_manager.AllocateSyncpoint();+ channel_fence.value = system.GPU().GetSyncpointValue(channel_fence.id);+}nvhost_gpu::~nvhost_gpu() = default;@@ -129,8 +132,9 @@ u32 nvhost_gpu::AllocGPFIFOEx2(const std::vector<u8>& input, std::vector<u8>& ouparams.num_entries, params.flags, params.unk0, params.unk1, params.unk2,params.unk3);- params.fence_out.id = syncpoint_manager.AllocateSyncpoint();- params.fence_out.value = syncpoint_manager.RefreshSyncpoint(params.fence_out.id);+ channel_fence.value = system.GPU().GetSyncpointValue(channel_fence.id);++ params.fence_out = channel_fence;std::memcpy(output.data(), ¶ms, output.size());return 0;@@ -194,6 +198,9 @@ u32 nvhost_gpu::SubmitGPFIFOImpl(IoctlSubmitGpfifo& params, std::vector<u8>& outparams.num_entries, params.flags.raw);auto& gpu = system.GPU();++ params.fence_out.id = channel_fence.id;+if (params.flags.add_wait.Value() &&!syncpoint_manager.IsSyncpointExpired(params.fence_out.id, params.fence_out.value)) {gpu.PushGPUEntries(Tegra::CommandList{BuildWaitCommandList(params.fence_out)});diff --git a/src/core/hle/service/nvdrv/devices/nvhost_gpu.h b/src/core/hle/service/nvdrv/devices/nvhost_gpu.hindex 80054510f0..a252fc06d1 100644--- a/src/core/hle/service/nvdrv/devices/nvhost_gpu.h+++ b/src/core/hle/service/nvdrv/devices/nvhost_gpu.h@@ -212,6 +212,7 @@ private:std::shared_ptr<nvmap> nvmap_dev;SyncpointManager& syncpoint_manager;+ Fence channel_fence;};} // namespace Service::Nvidia::Devices