[AGC] Emit event and flip packets with one write

This commit is contained in:
ParantezTech 2026-10-11 01:42:12 +03:00
parent 8f8737e2d1
commit cd51a9ea2e
1 changed files with 3 additions and 18 deletions

View File

@ -69,9 +69,7 @@ public static partial class AgcExports
return ReturnPointer(ctx, 0);
}
if (!TryAllocateCommandDwords(ctx, commandBufferAddress, 2, out var commandAddress) ||
!TryWriteUInt32(ctx, commandAddress, Pm4(2, ItEventWrite, 0)) ||
!TryWriteUInt32(ctx, commandAddress + 4, eventType))
if (!TryEmitCommandDwords(ctx, commandBufferAddress, out var commandAddress, Pm4(2, ItEventWrite, 0), eventType))
{
return ReturnPointer(ctx, 0);
}
@ -95,14 +93,7 @@ public static partial class AgcExports
return ReturnPointer(ctx, 0);
}
if (!TryAllocateCommandDwords(ctx, commandBufferAddress, 7, out var commandAddress) ||
!TryWriteUInt32(ctx, commandAddress, Pm4(7, ItNop, RWaitFlipDone)) ||
!TryWriteUInt32(ctx, commandAddress + 4, videoOutHandle) ||
!TryWriteUInt32(ctx, commandAddress + 8, displayBufferIndex) ||
!TryWriteUInt32(ctx, commandAddress + 12, 0) ||
!TryWriteUInt32(ctx, commandAddress + 16, 0) ||
!TryWriteUInt32(ctx, commandAddress + 20, 0) ||
!TryWriteUInt32(ctx, commandAddress + 24, 0))
if (!TryEmitCommandDwords(ctx, commandBufferAddress, out var commandAddress, Pm4(7, ItNop, RWaitFlipDone), videoOutHandle, displayBufferIndex, 0, 0, 0, 0))
{
return ReturnPointer(ctx, 0);
}
@ -128,13 +119,7 @@ public static partial class AgcExports
return ReturnPointer(ctx, 0);
}
if (!TryAllocateCommandDwords(ctx, commandBufferAddress, 6, out var commandAddress) ||
!TryWriteUInt32(ctx, commandAddress, Pm4(6, ItNop, RFlip)) ||
!TryWriteUInt32(ctx, commandAddress + 4, videoOutHandle) ||
!TryWriteUInt32(ctx, commandAddress + 8, unchecked((uint)displayBufferIndex)) ||
!TryWriteUInt32(ctx, commandAddress + 12, flipMode) ||
!TryWriteUInt32(ctx, commandAddress + 16, (uint)(flipArg & 0xFFFF_FFFFUL)) ||
!TryWriteUInt32(ctx, commandAddress + 20, (uint)(flipArg >> 32)))
if (!TryEmitCommandDwords(ctx, commandBufferAddress, out var commandAddress, Pm4(6, ItNop, RFlip), videoOutHandle, unchecked((uint)displayBufferIndex), flipMode, (uint)(flipArg & 0xFFFF_FFFFUL), (uint)(flipArg >> 32)))
{
return ReturnPointer(ctx, 0);
}