diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/core/hle/service/nvdrv/devices/nvdisp_disp0.cpp | 2 | ||||
| -rw-r--r-- | src/core/hle/service/nvdrv/devices/nvhost_gpu.cpp | 14 | ||||
| -rw-r--r-- | src/core/hle/service/nvflinger/nvflinger.cpp | 2 | ||||
| -rw-r--r-- | src/video_core/gpu.cpp | 10 | ||||
| -rw-r--r-- | src/video_core/gpu.h | 15 |
5 files changed, 26 insertions, 17 deletions
diff --git a/src/core/hle/service/nvdrv/devices/nvdisp_disp0.cpp b/src/core/hle/service/nvdrv/devices/nvdisp_disp0.cpp index dbe7ee6e8..20c7c39aa 100644 --- a/src/core/hle/service/nvdrv/devices/nvdisp_disp0.cpp +++ b/src/core/hle/service/nvdrv/devices/nvdisp_disp0.cpp | |||
| @@ -36,7 +36,7 @@ void nvdisp_disp0::flip(u32 buffer_handle, u32 offset, u32 format, u32 width, u3 | |||
| 36 | 36 | ||
| 37 | auto& instance = Core::System::GetInstance(); | 37 | auto& instance = Core::System::GetInstance(); |
| 38 | instance.GetPerfStats().EndGameFrame(); | 38 | instance.GetPerfStats().EndGameFrame(); |
| 39 | instance.Renderer().SwapBuffers(framebuffer); | 39 | instance.GPU().SwapBuffers(framebuffer); |
| 40 | } | 40 | } |
| 41 | 41 | ||
| 42 | } // namespace Service::Nvidia::Devices | 42 | } // namespace Service::Nvidia::Devices |
diff --git a/src/core/hle/service/nvdrv/devices/nvhost_gpu.cpp b/src/core/hle/service/nvdrv/devices/nvhost_gpu.cpp index 0a650f36c..8ce7bc7a5 100644 --- a/src/core/hle/service/nvdrv/devices/nvhost_gpu.cpp +++ b/src/core/hle/service/nvdrv/devices/nvhost_gpu.cpp | |||
| @@ -136,16 +136,6 @@ u32 nvhost_gpu::AllocateObjectContext(const std::vector<u8>& input, std::vector< | |||
| 136 | return 0; | 136 | return 0; |
| 137 | } | 137 | } |
| 138 | 138 | ||
| 139 | static void PushGPUEntries(Tegra::CommandList&& entries) { | ||
| 140 | if (entries.empty()) { | ||
| 141 | return; | ||
| 142 | } | ||
| 143 | |||
| 144 | auto& dma_pusher{Core::System::GetInstance().GPU().DmaPusher()}; | ||
| 145 | dma_pusher.Push(std::move(entries)); | ||
| 146 | dma_pusher.DispatchCalls(); | ||
| 147 | } | ||
| 148 | |||
| 149 | 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) { |
| 150 | if (input.size() < sizeof(IoctlSubmitGpfifo)) { | 140 | if (input.size() < sizeof(IoctlSubmitGpfifo)) { |
| 151 | UNIMPLEMENTED(); | 141 | UNIMPLEMENTED(); |
| @@ -163,7 +153,7 @@ u32 nvhost_gpu::SubmitGPFIFO(const std::vector<u8>& input, std::vector<u8>& outp | |||
| 163 | std::memcpy(entries.data(), &input[sizeof(IoctlSubmitGpfifo)], | 153 | std::memcpy(entries.data(), &input[sizeof(IoctlSubmitGpfifo)], |
| 164 | params.num_entries * sizeof(Tegra::CommandListHeader)); | 154 | params.num_entries * sizeof(Tegra::CommandListHeader)); |
| 165 | 155 | ||
| 166 | PushGPUEntries(std::move(entries)); | 156 | Core::System::GetInstance().GPU().PushGPUEntries(std::move(entries)); |
| 167 | 157 | ||
| 168 | params.fence_out.id = 0; | 158 | params.fence_out.id = 0; |
| 169 | params.fence_out.value = 0; | 159 | params.fence_out.value = 0; |
| @@ -184,7 +174,7 @@ u32 nvhost_gpu::KickoffPB(const std::vector<u8>& input, std::vector<u8>& output) | |||
| 184 | Memory::ReadBlock(params.address, entries.data(), | 174 | Memory::ReadBlock(params.address, entries.data(), |
| 185 | params.num_entries * sizeof(Tegra::CommandListHeader)); | 175 | params.num_entries * sizeof(Tegra::CommandListHeader)); |
| 186 | 176 | ||
| 187 | PushGPUEntries(std::move(entries)); | 177 | Core::System::GetInstance().GPU().PushGPUEntries(std::move(entries)); |
| 188 | 178 | ||
| 189 | params.fence_out.id = 0; | 179 | params.fence_out.id = 0; |
| 190 | params.fence_out.value = 0; | 180 | params.fence_out.value = 0; |
diff --git a/src/core/hle/service/nvflinger/nvflinger.cpp b/src/core/hle/service/nvflinger/nvflinger.cpp index 56f31e2ac..fc496b654 100644 --- a/src/core/hle/service/nvflinger/nvflinger.cpp +++ b/src/core/hle/service/nvflinger/nvflinger.cpp | |||
| @@ -186,7 +186,7 @@ void NVFlinger::Compose() { | |||
| 186 | 186 | ||
| 187 | // There was no queued buffer to draw, render previous frame | 187 | // There was no queued buffer to draw, render previous frame |
| 188 | system_instance.GetPerfStats().EndGameFrame(); | 188 | system_instance.GetPerfStats().EndGameFrame(); |
| 189 | system_instance.Renderer().SwapBuffers({}); | 189 | system_instance.GPU().SwapBuffers({}); |
| 190 | continue; | 190 | continue; |
| 191 | } | 191 | } |
| 192 | 192 | ||
diff --git a/src/video_core/gpu.cpp b/src/video_core/gpu.cpp index 08abf8ac9..b0f3310e5 100644 --- a/src/video_core/gpu.cpp +++ b/src/video_core/gpu.cpp | |||
| @@ -65,6 +65,16 @@ const DmaPusher& GPU::DmaPusher() const { | |||
| 65 | return *dma_pusher; | 65 | return *dma_pusher; |
| 66 | } | 66 | } |
| 67 | 67 | ||
| 68 | void GPU::PushGPUEntries(Tegra::CommandList&& entries) { | ||
| 69 | dma_pusher->Push(std::move(entries)); | ||
| 70 | dma_pusher->DispatchCalls(); | ||
| 71 | } | ||
| 72 | |||
| 73 | void GPU::SwapBuffers( | ||
| 74 | std::optional<std::reference_wrapper<const Tegra::FramebufferConfig>> framebuffer) { | ||
| 75 | renderer.SwapBuffers(std::move(framebuffer)); | ||
| 76 | } | ||
| 77 | |||
| 68 | u32 RenderTargetBytesPerPixel(RenderTargetFormat format) { | 78 | u32 RenderTargetBytesPerPixel(RenderTargetFormat format) { |
| 69 | ASSERT(format != RenderTargetFormat::NONE); | 79 | ASSERT(format != RenderTargetFormat::NONE); |
| 70 | 80 | ||
diff --git a/src/video_core/gpu.h b/src/video_core/gpu.h index ac7aec6a4..62649bd6e 100644 --- a/src/video_core/gpu.h +++ b/src/video_core/gpu.h | |||
| @@ -200,6 +200,13 @@ public: | |||
| 200 | std::array<u32, NUM_REGS> reg_array; | 200 | std::array<u32, NUM_REGS> reg_array; |
| 201 | }; | 201 | }; |
| 202 | } regs{}; | 202 | } regs{}; |
| 203 | |||
| 204 | /// Push GPU command entries to be processed | ||
| 205 | void PushGPUEntries(Tegra::CommandList&& entries); | ||
| 206 | |||
| 207 | /// Swap buffers (render frame) | ||
| 208 | void SwapBuffers( | ||
| 209 | std::optional<std::reference_wrapper<const Tegra::FramebufferConfig>> framebuffer); | ||
| 203 | 210 | ||
| 204 | private: | 211 | private: |
| 205 | void ProcessBindMethod(const MethodCall& method_call); | 212 | void ProcessBindMethod(const MethodCall& method_call); |
| @@ -207,11 +214,13 @@ private: | |||
| 207 | void ProcessSemaphoreRelease(); | 214 | void ProcessSemaphoreRelease(); |
| 208 | void ProcessSemaphoreAcquire(); | 215 | void ProcessSemaphoreAcquire(); |
| 209 | 216 | ||
| 210 | // Calls a GPU puller method. | 217 | /// Calls a GPU puller method. |
| 211 | void CallPullerMethod(const MethodCall& method_call); | 218 | void CallPullerMethod(const MethodCall& method_call); |
| 212 | // Calls a GPU engine method. | 219 | |
| 220 | /// Calls a GPU engine method. | ||
| 213 | void CallEngineMethod(const MethodCall& method_call); | 221 | void CallEngineMethod(const MethodCall& method_call); |
| 214 | // Determines where the method should be executed. | 222 | |
| 223 | /// Determines where the method should be executed. | ||
| 215 | bool ExecuteMethodOnEngine(const MethodCall& method_call); | 224 | bool ExecuteMethodOnEngine(const MethodCall& method_call); |
| 216 | 225 | ||
| 217 | private: | 226 | private: |