[AGC] Emit event and flip packets with one write
This commit is contained in:
parent
8f8737e2d1
commit
cd51a9ea2e
|
|
@ -69,9 +69,7 @@ public static partial class AgcExports
|
||||||
return ReturnPointer(ctx, 0);
|
return ReturnPointer(ctx, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!TryAllocateCommandDwords(ctx, commandBufferAddress, 2, out var commandAddress) ||
|
if (!TryEmitCommandDwords(ctx, commandBufferAddress, out var commandAddress, Pm4(2, ItEventWrite, 0), eventType))
|
||||||
!TryWriteUInt32(ctx, commandAddress, Pm4(2, ItEventWrite, 0)) ||
|
|
||||||
!TryWriteUInt32(ctx, commandAddress + 4, eventType))
|
|
||||||
{
|
{
|
||||||
return ReturnPointer(ctx, 0);
|
return ReturnPointer(ctx, 0);
|
||||||
}
|
}
|
||||||
|
|
@ -95,14 +93,7 @@ public static partial class AgcExports
|
||||||
return ReturnPointer(ctx, 0);
|
return ReturnPointer(ctx, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!TryAllocateCommandDwords(ctx, commandBufferAddress, 7, out var commandAddress) ||
|
if (!TryEmitCommandDwords(ctx, commandBufferAddress, out var commandAddress, Pm4(7, ItNop, RWaitFlipDone), videoOutHandle, displayBufferIndex, 0, 0, 0, 0))
|
||||||
!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))
|
|
||||||
{
|
{
|
||||||
return ReturnPointer(ctx, 0);
|
return ReturnPointer(ctx, 0);
|
||||||
}
|
}
|
||||||
|
|
@ -128,13 +119,7 @@ public static partial class AgcExports
|
||||||
return ReturnPointer(ctx, 0);
|
return ReturnPointer(ctx, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!TryAllocateCommandDwords(ctx, commandBufferAddress, 6, out var commandAddress) ||
|
if (!TryEmitCommandDwords(ctx, commandBufferAddress, out var commandAddress, Pm4(6, ItNop, RFlip), videoOutHandle, unchecked((uint)displayBufferIndex), flipMode, (uint)(flipArg & 0xFFFF_FFFFUL), (uint)(flipArg >> 32)))
|
||||||
!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)))
|
|
||||||
{
|
{
|
||||||
return ReturnPointer(ctx, 0);
|
return ReturnPointer(ctx, 0);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue