IPC code gen improvements (#6352)

* HipcGenerator: skip do-nothing call to MemoryMarshal.Cast<byte, byte>() in generated code

* HipcGenerator: fix method name typos

* HipcGenerator: make generated methods use stackalloc for `isBufferMapAlias` bool array

* HipcGenerator: make generated GetCommandHandlers() method return a FrozenDictionary<int, CommandHandler>

* HipcGenerator: return `FrozenDictionary<,>.Empty` when there are no command implementations, otherwise create `FrozenDictionary` from a `IEnumerable<KeyValuePair<,>>`` instead of a `Dictionary<,>``
This commit is contained in:
jhorv
2024-02-23 19:12:24 -05:00
committed by GitHub
parent d4d0a48bfe
commit 08384ee5a8
2 changed files with 54 additions and 42 deletions

View File

@ -127,7 +127,7 @@ namespace Ryujinx.Horizon.Sdk.Sf
return _bufferRanges[argIndex];
}
public Result ProcessBuffers(ref ServiceDispatchContext context, bool[] isBufferMapAlias, ServerMessageRuntimeMetadata runtimeMetadata)
public Result ProcessBuffers(ref ServiceDispatchContext context, scoped Span<bool> isBufferMapAlias, ServerMessageRuntimeMetadata runtimeMetadata)
{
bool mapAliasBuffersValid = true;
@ -246,7 +246,7 @@ namespace Ryujinx.Horizon.Sdk.Sf
return mode == HipcBufferMode.Normal;
}
public void SetOutBuffers(HipcMessageData response, bool[] isBufferMapAlias)
public void SetOutBuffers(HipcMessageData response, ReadOnlySpan<bool> isBufferMapAlias)
{
int recvPointerIndex = 0;