[MG_Remote] (Disaggregated): P5e vi - kDrawClientArrays on the wire, and the run-ahead refusal

- ReadDrawBindings answers ClientVertexArrays in the SAME single read of the bindings the
  rest of the draw plan is made from: an enabled attribute with no buffer behind it, which is
  exactly what EmitVertexBuffers publishes as Res == kMGPipeNullHandle.
- PlanDrawInfo sets kDrawClientArrays for every draw shape, not only the array ones - a
  glDrawElements can fetch its VERTICES from client memory too - because MGPipeBarriered is
  computed from the record on both sides and a null Res inside the window is also what a
  disabled attribute publishes.
- EmitDrawRecord and the reduced DrawArrays path refuse such a draw under run-ahead with
  Fatal{UnmigratedVerb, "DrawArrays+CLIENT_ARRAYS"} on the GL thread, before the hooks
  (ID-82 / ruling 2). LOCKSTEP IS UNCHANGED: the client is parked in WaitForApplied for that
  record, so the server's upload reads memory that is not moving (ruling 4). Staging the
  bytes as a per-attribute {BindingIndex, MGHostSpan} tail is P8's.
- The armed predicate is spelled here from the three inputs MGPipeTypes.h names for
  RunAheadArmed() rather than called, because ClientSession::RunAheadArmed is package ra's;
  it is inert until the integration commit publishes the caps bit, and ra collapses this
  body into that latch.
This commit is contained in:
2026-09-18 08:10:10 -04:00
parent a04cf05c93
commit 4fc93c1ab9
2 changed files with 104 additions and 1 deletions
+10
View File
@@ -187,6 +187,16 @@ namespace MobileGL::MG_Remote::Client {
// carried verbatim (informational in P5b: the backend reads its own barrier-pulled copy).
Bool PrimitiveRestart = false;
Uint32 RestartIndex = 0;
// P5e (vi), ID-82 / CONTRACT-P5E §5.1: TRUE when the bound VAO has at least one ENABLED
// attribute with no buffer object behind it, i.e. an array whose vertices live in the
// application's own memory. The server has no such memory: today it dereferences
// `attrib.Offset` as a raw client pointer from the apply thread
// (Managers.cpp's SyncClientSideAttributesForDrawArrays), which is legal only while the
// client is parked behind the record. It rides in MGPDrawInfo::Flags as kDrawClientArrays
// so BOTH roles can decide from the wire - the client refuses such a draw under
// run-ahead, and MGPipeBarriered's escalation (ii) keeps it barriered if one ever
// arrives anyway. Staging the bytes is P8's.
Bool ClientVertexArrays = false;
};
// 1 / 2 / 4 for the three GL index types, 0 for anything else (the frontend has already