diff options
| author | 2018-11-23 23:20:56 -0500 | |
|---|---|---|
| committer | 2018-11-26 23:14:01 -0500 | |
| commit | abea6fa90c901d0b47487ed38d44511b18f0addf (patch) | |
| tree | 65ba9fc6ff7609ea569ea1e3d05f91caa56ffa14 /src/core | |
| parent | Merge pull request #1805 from lioncash/resource (diff) | |
| download | yuzu-abea6fa90c901d0b47487ed38d44511b18f0addf.tar.gz yuzu-abea6fa90c901d0b47487ed38d44511b18f0addf.tar.xz yuzu-abea6fa90c901d0b47487ed38d44511b18f0addf.zip | |
gpu: Rewrite GPU command list processing with DmaPusher class.
- More accurate impl., fixes Undertale (among other games).
Diffstat (limited to 'src/core')
| -rw-r--r-- | src/core/hle/service/nvdrv/devices/nvhost_gpu.cpp | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/src/core/hle/service/nvdrv/devices/nvhost_gpu.cpp b/src/core/hle/service/nvdrv/devices/nvhost_gpu.cpp index 874d5e1c3..39a58b685 100644 --- a/src/core/hle/service/nvdrv/devices/nvhost_gpu.cpp +++ b/src/core/hle/service/nvdrv/devices/nvhost_gpu.cpp | |||
| @@ -8,7 +8,6 @@ | |||
| 8 | #include "core/core.h" | 8 | #include "core/core.h" |
| 9 | #include "core/hle/service/nvdrv/devices/nvhost_gpu.h" | 9 | #include "core/hle/service/nvdrv/devices/nvhost_gpu.h" |
| 10 | #include "core/memory.h" | 10 | #include "core/memory.h" |
| 11 | #include "video_core/command_processor.h" | ||
| 12 | #include "video_core/gpu.h" | 11 | #include "video_core/gpu.h" |
| 13 | #include "video_core/memory_manager.h" | 12 | #include "video_core/memory_manager.h" |
| 14 | 13 | ||
| @@ -129,6 +128,14 @@ u32 nvhost_gpu::AllocateObjectContext(const std::vector<u8>& input, std::vector< | |||
| 129 | return 0; | 128 | return 0; |
| 130 | } | 129 | } |
| 131 | 130 | ||
| 131 | static void PushGPUEntries(const std::vector<Tegra::CommandListHeader>& entries) { | ||
| 132 | auto& dma_pusher{Core::System::GetInstance().GPU().DmaPusher()}; | ||
| 133 | for (const auto& entry : entries) { | ||
| 134 | dma_pusher.Push(entry); | ||
| 135 | } | ||
| 136 | dma_pusher.DispatchCalls(); | ||
| 137 | } | ||
| 138 | |||
| 132 | u32 nvhost_gpu::SubmitGPFIFO(const std::vector<u8>& input, std::vector<u8>& output) { | 139 | u32 nvhost_gpu::SubmitGPFIFO(const std::vector<u8>& input, std::vector<u8>& output) { |
| 133 | if (input.size() < sizeof(IoctlSubmitGpfifo)) { | 140 | if (input.size() < sizeof(IoctlSubmitGpfifo)) { |
| 134 | UNIMPLEMENTED(); | 141 | UNIMPLEMENTED(); |
| @@ -146,7 +153,7 @@ u32 nvhost_gpu::SubmitGPFIFO(const std::vector<u8>& input, std::vector<u8>& outp | |||
| 146 | std::memcpy(entries.data(), &input[sizeof(IoctlSubmitGpfifo)], | 153 | std::memcpy(entries.data(), &input[sizeof(IoctlSubmitGpfifo)], |
| 147 | params.num_entries * sizeof(Tegra::CommandListHeader)); | 154 | params.num_entries * sizeof(Tegra::CommandListHeader)); |
| 148 | 155 | ||
| 149 | Core::System::GetInstance().GPU().ProcessCommandLists(entries); | 156 | PushGPUEntries(entries); |
| 150 | 157 | ||
| 151 | params.fence_out.id = 0; | 158 | params.fence_out.id = 0; |
| 152 | params.fence_out.value = 0; | 159 | params.fence_out.value = 0; |
| @@ -167,7 +174,7 @@ u32 nvhost_gpu::KickoffPB(const std::vector<u8>& input, std::vector<u8>& output) | |||
| 167 | Memory::ReadBlock(params.address, entries.data(), | 174 | Memory::ReadBlock(params.address, entries.data(), |
| 168 | params.num_entries * sizeof(Tegra::CommandListHeader)); | 175 | params.num_entries * sizeof(Tegra::CommandListHeader)); |
| 169 | 176 | ||
| 170 | Core::System::GetInstance().GPU().ProcessCommandLists(entries); | 177 | PushGPUEntries(entries); |
| 171 | 178 | ||
| 172 | params.fence_out.id = 0; | 179 | params.fence_out.id = 0; |
| 173 | params.fence_out.value = 0; | 180 | params.fence_out.value = 0; |