diff options
| author | 2021-10-01 00:57:02 -0400 | |
|---|---|---|
| committer | 2021-10-03 00:35:57 -0400 | |
| commit | 427bf76e621cf0833bc1bbec7d8be891297223e7 (patch) | |
| tree | 5cc146d21972e1a7c424219482ef3393787afe6a /src/core | |
| parent | Merge pull request #7061 from ameerj/dma-buffer-misc (diff) | |
| download | yuzu-427bf76e621cf0833bc1bbec7d8be891297223e7.tar.gz yuzu-427bf76e621cf0833bc1bbec7d8be891297223e7.tar.xz yuzu-427bf76e621cf0833bc1bbec7d8be891297223e7.zip | |
gpu: Migrate implementation to the cpp file
Diffstat (limited to 'src/core')
| -rw-r--r-- | src/core/hle/service/nvdrv/devices/nvdisp_disp0.cpp | 5 | ||||
| -rw-r--r-- | src/core/hle/service/nvdrv/devices/nvhost_gpu.cpp | 13 |
2 files changed, 13 insertions, 5 deletions
diff --git a/src/core/hle/service/nvdrv/devices/nvdisp_disp0.cpp b/src/core/hle/service/nvdrv/devices/nvdisp_disp0.cpp index 789000294..4ee8c5733 100644 --- a/src/core/hle/service/nvdrv/devices/nvdisp_disp0.cpp +++ b/src/core/hle/service/nvdrv/devices/nvdisp_disp0.cpp | |||
| @@ -48,8 +48,9 @@ void nvdisp_disp0::flip(u32 buffer_handle, u32 offset, u32 format, u32 width, u3 | |||
| 48 | addr, offset, width, height, stride, format); | 48 | addr, offset, width, height, stride, format); |
| 49 | 49 | ||
| 50 | const auto pixel_format = static_cast<Tegra::FramebufferConfig::PixelFormat>(format); | 50 | const auto pixel_format = static_cast<Tegra::FramebufferConfig::PixelFormat>(format); |
| 51 | const Tegra::FramebufferConfig framebuffer{addr, offset, width, height, | 51 | const auto transform_flags = static_cast<Tegra::FramebufferConfig::TransformFlags>(transform); |
| 52 | stride, pixel_format, transform, crop_rect}; | 52 | const Tegra::FramebufferConfig framebuffer{addr, offset, width, height, |
| 53 | stride, pixel_format, transform_flags, crop_rect}; | ||
| 53 | 54 | ||
| 54 | system.GetPerfStats().EndSystemFrame(); | 55 | system.GetPerfStats().EndSystemFrame(); |
| 55 | system.GPU().SwapBuffers(&framebuffer); | 56 | system.GPU().SwapBuffers(&framebuffer); |
diff --git a/src/core/hle/service/nvdrv/devices/nvhost_gpu.cpp b/src/core/hle/service/nvdrv/devices/nvhost_gpu.cpp index c0a380088..54ac105d5 100644 --- a/src/core/hle/service/nvdrv/devices/nvhost_gpu.cpp +++ b/src/core/hle/service/nvdrv/devices/nvhost_gpu.cpp | |||
| @@ -13,6 +13,14 @@ | |||
| 13 | #include "video_core/memory_manager.h" | 13 | #include "video_core/memory_manager.h" |
| 14 | 14 | ||
| 15 | namespace Service::Nvidia::Devices { | 15 | namespace Service::Nvidia::Devices { |
| 16 | namespace { | ||
| 17 | Tegra::CommandHeader BuildFenceAction(Tegra::GPU::FenceOperation op, u32 syncpoint_id) { | ||
| 18 | Tegra::GPU::FenceAction result{}; | ||
| 19 | result.op.Assign(op); | ||
| 20 | result.syncpoint_id.Assign(syncpoint_id); | ||
| 21 | return {result.raw}; | ||
| 22 | } | ||
| 23 | } // namespace | ||
| 16 | 24 | ||
| 17 | nvhost_gpu::nvhost_gpu(Core::System& system_, std::shared_ptr<nvmap> nvmap_dev_, | 25 | nvhost_gpu::nvhost_gpu(Core::System& system_, std::shared_ptr<nvmap> nvmap_dev_, |
| 18 | SyncpointManager& syncpoint_manager_) | 26 | SyncpointManager& syncpoint_manager_) |
| @@ -187,7 +195,7 @@ static std::vector<Tegra::CommandHeader> BuildWaitCommandList(Fence fence) { | |||
| 187 | {fence.value}, | 195 | {fence.value}, |
| 188 | Tegra::BuildCommandHeader(Tegra::BufferMethods::FenceAction, 1, | 196 | Tegra::BuildCommandHeader(Tegra::BufferMethods::FenceAction, 1, |
| 189 | Tegra::SubmissionMode::Increasing), | 197 | Tegra::SubmissionMode::Increasing), |
| 190 | Tegra::GPU::FenceAction::Build(Tegra::GPU::FenceOperation::Acquire, fence.id), | 198 | BuildFenceAction(Tegra::GPU::FenceOperation::Acquire, fence.id), |
| 191 | }; | 199 | }; |
| 192 | } | 200 | } |
| 193 | 201 | ||
| @@ -200,8 +208,7 @@ static std::vector<Tegra::CommandHeader> BuildIncrementCommandList(Fence fence, | |||
| 200 | for (u32 count = 0; count < add_increment; ++count) { | 208 | for (u32 count = 0; count < add_increment; ++count) { |
| 201 | result.emplace_back(Tegra::BuildCommandHeader(Tegra::BufferMethods::FenceAction, 1, | 209 | result.emplace_back(Tegra::BuildCommandHeader(Tegra::BufferMethods::FenceAction, 1, |
| 202 | Tegra::SubmissionMode::Increasing)); | 210 | Tegra::SubmissionMode::Increasing)); |
| 203 | result.emplace_back( | 211 | result.emplace_back(BuildFenceAction(Tegra::GPU::FenceOperation::Increment, fence.id)); |
| 204 | Tegra::GPU::FenceAction::Build(Tegra::GPU::FenceOperation::Increment, fence.id)); | ||
| 205 | } | 212 | } |
| 206 | 213 | ||
| 207 | return result; | 214 | return result; |