mirror of
https://github.com/yuzu-mirror/yuzu.git
synced 2024-11-03 14:39:58 +00:00
Merge pull request #4401 from ogniK5377/GetIndirectLayerImageRequiredMemoryInfo
vi: IApplicationDisplayService:GetIndirectLayerImageRequiredMemoryInfo
This commit is contained in:
commit
ba9ed7b1fe
1 changed files with 19 additions and 1 deletions
|
@ -1199,6 +1199,23 @@ private:
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void GetIndirectLayerImageRequiredMemoryInfo(Kernel::HLERequestContext& ctx) {
|
||||||
|
IPC::RequestParser rp{ctx};
|
||||||
|
const auto width = rp.Pop<u64>();
|
||||||
|
const auto height = rp.Pop<u64>();
|
||||||
|
LOG_DEBUG(Service_VI, "called width={}, height={}", width, height);
|
||||||
|
|
||||||
|
constexpr std::size_t base_size = 0x20000;
|
||||||
|
constexpr std::size_t alignment = 0x1000;
|
||||||
|
const auto texture_size = width * height * 4;
|
||||||
|
const auto out_size = (texture_size + base_size - 1) / base_size * base_size;
|
||||||
|
|
||||||
|
IPC::ResponseBuilder rb{ctx, 6};
|
||||||
|
rb.Push(RESULT_SUCCESS);
|
||||||
|
rb.Push(out_size);
|
||||||
|
rb.Push(alignment);
|
||||||
|
}
|
||||||
|
|
||||||
static ResultVal<ConvertedScaleMode> ConvertScalingModeImpl(NintendoScaleMode mode) {
|
static ResultVal<ConvertedScaleMode> ConvertScalingModeImpl(NintendoScaleMode mode) {
|
||||||
switch (mode) {
|
switch (mode) {
|
||||||
case NintendoScaleMode::None:
|
case NintendoScaleMode::None:
|
||||||
|
@ -1243,7 +1260,8 @@ IApplicationDisplayService::IApplicationDisplayService(
|
||||||
{2102, &IApplicationDisplayService::ConvertScalingMode, "ConvertScalingMode"},
|
{2102, &IApplicationDisplayService::ConvertScalingMode, "ConvertScalingMode"},
|
||||||
{2450, nullptr, "GetIndirectLayerImageMap"},
|
{2450, nullptr, "GetIndirectLayerImageMap"},
|
||||||
{2451, nullptr, "GetIndirectLayerImageCropMap"},
|
{2451, nullptr, "GetIndirectLayerImageCropMap"},
|
||||||
{2460, nullptr, "GetIndirectLayerImageRequiredMemoryInfo"},
|
{2460, &IApplicationDisplayService::GetIndirectLayerImageRequiredMemoryInfo,
|
||||||
|
"GetIndirectLayerImageRequiredMemoryInfo"},
|
||||||
{5202, &IApplicationDisplayService::GetDisplayVsyncEvent, "GetDisplayVsyncEvent"},
|
{5202, &IApplicationDisplayService::GetDisplayVsyncEvent, "GetDisplayVsyncEvent"},
|
||||||
{5203, nullptr, "GetDisplayVsyncEventForDebug"},
|
{5203, nullptr, "GetDisplayVsyncEventForDebug"},
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in a new issue