diff options
| author | 2020-08-04 18:45:11 -0400 | |
|---|---|---|
| committer | 2020-08-04 18:45:11 -0400 | |
| commit | ba9ed7b1fe9f372594dff3b8d1bc5317f975d879 (patch) | |
| tree | 05147797d96dccf6b57bbc3287ba0a557ba3cb81 | |
| parent | Merge pull request #4430 from bunnei/new-gpu-vmm (diff) | |
| parent | vi: IApplicationDisplayService:GetIndirectLayerImageRequiredMemoryInfo (diff) | |
| download | yuzu-ba9ed7b1fe9f372594dff3b8d1bc5317f975d879.tar.gz yuzu-ba9ed7b1fe9f372594dff3b8d1bc5317f975d879.tar.xz yuzu-ba9ed7b1fe9f372594dff3b8d1bc5317f975d879.zip | |
Merge pull request #4401 from ogniK5377/GetIndirectLayerImageRequiredMemoryInfo
vi: IApplicationDisplayService:GetIndirectLayerImageRequiredMemoryInfo
Diffstat (limited to '')
| -rw-r--r-- | src/core/hle/service/vi/vi.cpp | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/src/core/hle/service/vi/vi.cpp b/src/core/hle/service/vi/vi.cpp index 988d253f9..480d34725 100644 --- a/src/core/hle/service/vi/vi.cpp +++ b/src/core/hle/service/vi/vi.cpp | |||
| @@ -1199,6 +1199,23 @@ private: | |||
| 1199 | } | 1199 | } |
| 1200 | } | 1200 | } |
| 1201 | 1201 | ||
| 1202 | void GetIndirectLayerImageRequiredMemoryInfo(Kernel::HLERequestContext& ctx) { | ||
| 1203 | IPC::RequestParser rp{ctx}; | ||
| 1204 | const auto width = rp.Pop<u64>(); | ||
| 1205 | const auto height = rp.Pop<u64>(); | ||
| 1206 | LOG_DEBUG(Service_VI, "called width={}, height={}", width, height); | ||
| 1207 | |||
| 1208 | constexpr std::size_t base_size = 0x20000; | ||
| 1209 | constexpr std::size_t alignment = 0x1000; | ||
| 1210 | const auto texture_size = width * height * 4; | ||
| 1211 | const auto out_size = (texture_size + base_size - 1) / base_size * base_size; | ||
| 1212 | |||
| 1213 | IPC::ResponseBuilder rb{ctx, 6}; | ||
| 1214 | rb.Push(RESULT_SUCCESS); | ||
| 1215 | rb.Push(out_size); | ||
| 1216 | rb.Push(alignment); | ||
| 1217 | } | ||
| 1218 | |||
| 1202 | static ResultVal<ConvertedScaleMode> ConvertScalingModeImpl(NintendoScaleMode mode) { | 1219 | static ResultVal<ConvertedScaleMode> ConvertScalingModeImpl(NintendoScaleMode mode) { |
| 1203 | switch (mode) { | 1220 | switch (mode) { |
| 1204 | case NintendoScaleMode::None: | 1221 | case NintendoScaleMode::None: |
| @@ -1243,7 +1260,8 @@ IApplicationDisplayService::IApplicationDisplayService( | |||
| 1243 | {2102, &IApplicationDisplayService::ConvertScalingMode, "ConvertScalingMode"}, | 1260 | {2102, &IApplicationDisplayService::ConvertScalingMode, "ConvertScalingMode"}, |
| 1244 | {2450, nullptr, "GetIndirectLayerImageMap"}, | 1261 | {2450, nullptr, "GetIndirectLayerImageMap"}, |
| 1245 | {2451, nullptr, "GetIndirectLayerImageCropMap"}, | 1262 | {2451, nullptr, "GetIndirectLayerImageCropMap"}, |
| 1246 | {2460, nullptr, "GetIndirectLayerImageRequiredMemoryInfo"}, | 1263 | {2460, &IApplicationDisplayService::GetIndirectLayerImageRequiredMemoryInfo, |
| 1264 | "GetIndirectLayerImageRequiredMemoryInfo"}, | ||
| 1247 | {5202, &IApplicationDisplayService::GetDisplayVsyncEvent, "GetDisplayVsyncEvent"}, | 1265 | {5202, &IApplicationDisplayService::GetDisplayVsyncEvent, "GetDisplayVsyncEvent"}, |
| 1248 | {5203, nullptr, "GetDisplayVsyncEventForDebug"}, | 1266 | {5203, nullptr, "GetDisplayVsyncEventForDebug"}, |
| 1249 | }; | 1267 | }; |