Prepo: Fix SaveSystemReport* IPC definitions (#4278)

* Prepo: Fix SaveSystemReport IPC definitions

* Follow original code

* Fix args index in HipcGenerator

* Addresses feedback

* oops
This commit is contained in:
Ac_K 2023-01-13 01:50:14 +01:00 committed by GitHub
parent 8fa248ceb4
commit 4d2c8e2a44
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 78 additions and 17 deletions

View file

@ -267,6 +267,8 @@ namespace Ryujinx.Horizon.Generators.Hipc
}
int index = 0;
int inArgIndex = 0;
int outArgIndex = 0;
int inCopyHandleIndex = 0;
int inMoveHandleIndex = 0;
int inObjectIndex = 0;
@ -284,7 +286,7 @@ namespace Ryujinx.Horizon.Generators.Hipc
{
if (IsNonSpanOutBuffer(compilation, parameter))
{
generator.AppendLine($"using var {argName} = CommandSerialization.GetWritableRegion(processor.GetBufferRange({index}));");
generator.AppendLine($"using var {argName} = CommandSerialization.GetWritableRegion(processor.GetBufferRange({outArgIndex++}));");
argName = $"out {GenerateSpanCastElement0(canonicalTypeName, $"{argName}.Memory.Span")}";
}
@ -302,7 +304,7 @@ namespace Ryujinx.Horizon.Generators.Hipc
switch (argType)
{
case CommandArgType.InArgument:
value = $"CommandSerialization.DeserializeArg<{canonicalTypeName}>(inRawData, processor.GetInArgOffset({index}))";
value = $"CommandSerialization.DeserializeArg<{canonicalTypeName}>(inRawData, processor.GetInArgOffset({inArgIndex++}))";
break;
case CommandArgType.InCopyHandle:
value = $"CommandSerialization.DeserializeCopyHandle(ref context, {inCopyHandleIndex++})";