mirror of
				https://git.suyu.dev/suyu/suyu
				synced 2025-10-31 07:59:02 -05:00 
			
		
		
		
	gpu: Rewrite GPU command list processing with DmaPusher class.
- More accurate impl., fixes Undertale (among other games).
This commit is contained in:
		| @@ -8,7 +8,6 @@ | ||||
| #include "core/core.h" | ||||
| #include "core/hle/service/nvdrv/devices/nvhost_gpu.h" | ||||
| #include "core/memory.h" | ||||
| #include "video_core/command_processor.h" | ||||
| #include "video_core/gpu.h" | ||||
| #include "video_core/memory_manager.h" | ||||
|  | ||||
| @@ -129,6 +128,14 @@ u32 nvhost_gpu::AllocateObjectContext(const std::vector<u8>& input, std::vector< | ||||
|     return 0; | ||||
| } | ||||
|  | ||||
| static void PushGPUEntries(const std::vector<Tegra::CommandListHeader>& entries) { | ||||
|     auto& dma_pusher{Core::System::GetInstance().GPU().DmaPusher()}; | ||||
|     for (const auto& entry : entries) { | ||||
|         dma_pusher.Push(entry); | ||||
|     } | ||||
|     dma_pusher.DispatchCalls(); | ||||
| } | ||||
|  | ||||
| u32 nvhost_gpu::SubmitGPFIFO(const std::vector<u8>& input, std::vector<u8>& output) { | ||||
|     if (input.size() < sizeof(IoctlSubmitGpfifo)) { | ||||
|         UNIMPLEMENTED(); | ||||
| @@ -146,7 +153,7 @@ u32 nvhost_gpu::SubmitGPFIFO(const std::vector<u8>& input, std::vector<u8>& outp | ||||
|     std::memcpy(entries.data(), &input[sizeof(IoctlSubmitGpfifo)], | ||||
|                 params.num_entries * sizeof(Tegra::CommandListHeader)); | ||||
|  | ||||
|     Core::System::GetInstance().GPU().ProcessCommandLists(entries); | ||||
|     PushGPUEntries(entries); | ||||
|  | ||||
|     params.fence_out.id = 0; | ||||
|     params.fence_out.value = 0; | ||||
| @@ -167,7 +174,7 @@ u32 nvhost_gpu::KickoffPB(const std::vector<u8>& input, std::vector<u8>& output) | ||||
|     Memory::ReadBlock(params.address, entries.data(), | ||||
|                       params.num_entries * sizeof(Tegra::CommandListHeader)); | ||||
|  | ||||
|     Core::System::GetInstance().GPU().ProcessCommandLists(entries); | ||||
|     PushGPUEntries(entries); | ||||
|  | ||||
|     params.fence_out.id = 0; | ||||
|     params.fence_out.value = 0; | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 bunnei
					bunnei