[client/idd] input: reduce network latency

Route input through a dedicated high-priority stream, send pointer
motion as cumulative datagrams, and recover suspected loss reliably.

Reduce downstream input queuing with age-aware coalescing and input
thread scheduling.
This commit is contained in:
Geoffrey McRae
2026-10-08 20:34:04 +11:00
parent e30afaca2d
commit 1af2f13440
17 changed files with 3359 additions and 759 deletions

View File

@@ -51,6 +51,8 @@ typedef void (*NetworkConnectionStateFn)(void * opaque, bool connected,
LG_TransportStatus reason);
typedef void (*NetworkSendReadyFn)(void * opaque, LGNetService service,
NetworkPacketDelivery delivery);
typedef void (*NetworkDatagramLostFn)(void * opaque, LGNetService service,
uint64_t componentEpoch, uint64_t applicationSequence);
typedef struct NetworkConnectionParams
{
@@ -63,6 +65,7 @@ typedef struct NetworkConnectionParams
NetworkPacketFn packet;
NetworkConnectionStateFn state;
NetworkSendReadyFn sendReady;
NetworkDatagramLostFn datagramLost;
const LGNetCapability * capabilities;
uint32_t capabilityCount;
void * opaque;
@@ -92,7 +95,8 @@ LG_TransportStatus networkConnectionSendDatagram(
NetworkConnection * connection, LGNetService service,
uint16_t messageType, uint16_t serviceVersion,
LGNetEnvelopeFlags flags, uint64_t componentEpoch, uint64_t requestID,
const void * payload, uint32_t payloadLength, bool discardIfBlocked);
const void * payload, uint32_t payloadLength,
uint64_t applicationSequence, bool discardIfBlocked);
LG_TransportStatus networkConnectionSendBulk(NetworkConnection * connection,
LGNetService service, uint16_t messageType, uint16_t serviceVersion,
LGNetEnvelopeFlags flags, uint64_t componentEpoch, uint64_t requestID,