[Refactor] (P13 W5 S2): MG_Pipe's record-arm guards name MOBILEGL_BUILD_RECORD_ARM.

This commit is contained in:
2026-10-06 10:51:21 -04:00
parent b16dc20473
commit 06a4ebb645
6 changed files with 23 additions and 23 deletions
+1 -1
View File
@@ -76,7 +76,7 @@ namespace MobileGL::MG_Pipe {
// Null-initialized: a backend that installs nothing sends nothing.
inline MGPipeCallbacks gMGPipeCallbacks{};
#if MOBILEGL_BUILD_DISAGGREGATED
#if MOBILEGL_BUILD_RECORD_ARM
// HOW MUCH OF ITSELF ONE REVERSE-CHANNEL RECORD MAY BE, and it is not a tuning knob: a
// producer that ignores it kills the server process.
//
+2 -2
View File
@@ -463,7 +463,7 @@ namespace MobileGL::MG_Pipe {
desc.HasRespecifiedLevel = 1;
desc.RespecifiedUploadTarget = uploadTarget;
desc.RespecifiedLevel = level;
#if MOBILEGL_BUILD_DISAGGREGATED
#if MOBILEGL_BUILD_RECORD_ARM
// Non-buffer texture targets leave this descriptor range unused. A named-level
// respecify repurposes it as exact W/H/D; TexBuffer cannot legally name a mip level.
desc.BufOffset = (static_cast<Uint64>(width) << 32) | static_cast<Uint64>(height);
@@ -475,7 +475,7 @@ namespace MobileGL::MG_Pipe {
#endif
}
inline constexpr void MGPipeClearRespecifiedLevel(MGPResourceDesc& desc) {
#if MOBILEGL_BUILD_DISAGGREGATED
#if MOBILEGL_BUILD_RECORD_ARM
if (desc.HasRespecifiedLevel != 0 &&
desc.Target != static_cast<Uint8>(MGPipeResourceTarget::TexBuffer)) {
desc.BufOffset = 0;
+11 -11
View File
@@ -16,7 +16,7 @@
#include <MG_Backend/MGPipe/PipeInputs.h>
#if MOBILEGL_BUILD_DISAGGREGATED
#if MOBILEGL_BUILD_RECORD_ARM
// MGPipeUnmigratedEmulation's split arm reads MG_Config::Transport, which is what tells an
// emulation site whether it is running inside a server or in the monolith it was written for.
#include <Config.h>
@@ -1305,7 +1305,7 @@ namespace MobileGL::MG_Pipe {
return true;
}
#if MOBILEGL_PIPE_VERIFY && !MOBILEGL_BUILD_DISAGGREGATED
#if MOBILEGL_PIPE_VERIFY && !MOBILEGL_BUILD_RECORD_ARM
// D-A4's pin, AND P5 (b1) IS THE PHASE IT WAS WAITING FOR. It said "HasLiveHostWrites
// is always false in this phase and is written by nobody: it exists so the phase that
// pushes persistent-mapped host writes can set it with no new record kind", and a
@@ -1454,7 +1454,7 @@ namespace MobileGL::MG_Pipe {
return false;
}
PinNoLiveHostWrites(*stored, record.Res, call);
#if MOBILEGL_BUILD_DISAGGREGATED
#if MOBILEGL_BUILD_RECORD_ARM
// P5 (b1): THE PRODUCER. The record's own statement about the resource, applied
// before the serial moves so that a probe re-entered from inside the backend hook
// below already sees it. It is an assignment and not an OR: the bit is a STATE,
@@ -1608,7 +1608,7 @@ namespace MobileGL::MG_Pipe {
// record was accumulated, so the texels are the server's now, and that is the true
// this returns.
++stored->Serial;
#if MOBILEGL_BUILD_DISAGGREGATED
#if MOBILEGL_BUILD_RECORD_ARM
// P5c (tx): THE STAGED BYTES ARE ADOPTED HERE, at the last instant `bytes` is known
// alive (rule C: SEG_STAGE retires when this record does, and PendingUpload
// deliberately holds no byte pointer). The hook copies the run into the server's
@@ -1947,7 +1947,7 @@ namespace MobileGL::MG_Pipe {
MGPipeApplier().DrawProgram = kMGPipeNullHandle;
MGPipeApplier().DispatchProgram = kMGPipeNullHandle;
MGPipeApplier().BoundShaderCso = kMGPipeNullHandle;
#if MOBILEGL_BUILD_DISAGGREGATED
#if MOBILEGL_BUILD_RECORD_ARM
MGPipeApplier().BoundStreamOutputLifetimeId = 0;
// Begin is emitted once per span, not on make-current. Its immutable object
// snapshot survives with the resource/program records until End or release;
@@ -2011,7 +2011,7 @@ namespace MobileGL::MG_Pipe {
MGPipeApplier().DrawProgram = kMGPipeNullHandle;
MGPipeApplier().DispatchProgram = kMGPipeNullHandle;
MGPipeApplier().BoundShaderCso = kMGPipeNullHandle;
#if MOBILEGL_BUILD_DISAGGREGATED
#if MOBILEGL_BUILD_RECORD_ARM
MGPipeApplier().BoundStreamOutputLifetimeId = 0;
MGPipeApplier().StreamOutputSpans.clear();
#endif
@@ -2177,7 +2177,7 @@ namespace MobileGL::MG_Pipe {
// memory the rule exists to stop it reading. One store, inert until the caps bit is
// published, and it is what makes the two roles' third clause the same clause.
MGPipeApplier().IsTransformFeedbackActive = values.IsTransformFeedbackActive != 0;
#if MOBILEGL_BUILD_DISAGGREGATED
#if MOBILEGL_BUILD_RECORD_ARM
MGPipeApplier().BoundStreamOutputLifetimeId = values.BoundTransformFeedbackLifetimeId;
#endif
}
@@ -2314,7 +2314,7 @@ namespace MobileGL::MG_Pipe {
// ================================================================================
Bool MGPipeApplyResourceCreate(const MGPResourceDesc& desc) {
#if MOBILEGL_BUILD_DISAGGREGATED
#if MOBILEGL_BUILD_RECORD_ARM
if (!MGPipeRespecifyIsWholeResource(desc)) {
MGP_TRIP_WIRE_REPORT("MGPipe: Fatal{ProtocolCorruption, \"ResourceCreate.RespecifyScope\"} - "
"resource_create cannot carry a per-level respecify extent");
@@ -2415,7 +2415,7 @@ namespace MobileGL::MG_Pipe {
if (record == nullptr) return false;
PinNoLiveHostWrites(*record, desc.Resource, "resource_respecify");
PinRespecifyScopeCoversItsDeclaration(desc, level, desc.Resource, "resource_respecify");
#if MOBILEGL_BUILD_DISAGGREGATED
#if MOBILEGL_BUILD_RECORD_ARM
if (level != nullptr &&
(desc.Target == kMGPipeResourceTargetBuffer ||
desc.Target == static_cast<Uint8>(MGPipeResourceTarget::Renderbuffer) ||
@@ -2455,7 +2455,7 @@ namespace MobileGL::MG_Pipe {
level != nullptr ? "one level" : "whole resource");
record->SharedImageId = 0;
}
#if MOBILEGL_BUILD_DISAGGREGATED
#if MOBILEGL_BUILD_RECORD_ARM
if (level != nullptr && desc.Target != static_cast<Uint8>(MGPipeResourceTarget::TexBuffer)) {
// Scope and BufOffset/BufSize are transient respecify carriers, not resource state.
MGPipeClearRespecifiedLevel(record->Desc);
@@ -2523,7 +2523,7 @@ namespace MobileGL::MG_Pipe {
record->PendingUploads.clear();
}
#if MOBILEGL_BUILD_DISAGGREGATED
#if MOBILEGL_BUILD_RECORD_ARM
// P5c (tx): the staged-texture store's defined-ness and drop bookkeeping rides THE SAME
// scope rules as the pending-set drops above - a named level redefines that one
// (uploadTarget, level), a whole-resource respecify drops every level, and a metadata
+5 -5
View File
@@ -108,7 +108,7 @@ namespace MobileGL::MG_Pipe {
void (*Destroy)(MGPipeHandle res);
void* (*MapPersistent)(MGPipeHandle res, Uint64 size, const void* seedBytes);
void (*UnmapPersistent)(MGPipeHandle res);
#if MOBILEGL_BUILD_DISAGGREGATED
#if MOBILEGL_BUILD_RECORD_ARM
// P5c (tx): the TEXTURE half of the resource family, appended so every positional
// initialiser of the nine P3a members keeps its meaning. TextureSubData is called
// from ApplyTextureUpload AFTER the gate, the accumulation and the serial, while
@@ -873,7 +873,7 @@ namespace MobileGL::MG_Pipe {
Uint64 TextureShutterSerial = 0;
Uint64 ContextSerial = 0;
#if MOBILEGL_BUILD_DISAGGREGATED
#if MOBILEGL_BUILD_RECORD_ARM
// ---- P5c (hd, CONTRACT-P5C §3.2): THE CURRENT VERB'S OWN HANDLES. ----------------
//
// Server state, written by ServerVerbSink at the top of a verb's dispatch and read by
@@ -1309,7 +1309,7 @@ namespace MobileGL::MG_Pipe {
struct MGPRespecifiedLevel {
Uint16 UploadTarget = 0;
Uint16 Level = 0;
#if MOBILEGL_BUILD_DISAGGREGATED
#if MOBILEGL_BUILD_RECORD_ARM
// P7 PH-4: mutable mip dimensions do not follow from the base descriptor. These fields
// are carried by the split resource_respecify record; the pull helper remains 4 bytes.
Uint32 Width = 0;
@@ -1324,7 +1324,7 @@ namespace MobileGL::MG_Pipe {
MGPRespecifiedLevel value{};
value.UploadTarget = uploadTarget;
value.Level = level;
#if MOBILEGL_BUILD_DISAGGREGATED
#if MOBILEGL_BUILD_RECORD_ARM
value.Width = width;
value.Height = height;
value.Depth = depth;
@@ -1483,7 +1483,7 @@ namespace MobileGL::MG_Pipe {
// unmap_persistent: the donation ends. Never emitted by P3a's own paths; the call exists
// so the pair is complete and the transport has both halves.
void MGPipeApplyUnmapPersistent(const MGPHandleOnly& handle);
#if MOBILEGL_BUILD_DISAGGREGATED
#if MOBILEGL_BUILD_RECORD_ARM
// P11 B2 (T0): the split server's map_persistent for a session that runs T0. The client's
// AHardwareBuffer `ahb` (`size` bytes) becomes buffer `handle`'s resident store through the
// backend's ImportExternal. A handle that is not a live buffer of that width, or a backend
+1 -1
View File
@@ -310,7 +310,7 @@ namespace MobileGL::MG_Pipe {
// the monolith twin reads GetLinkedShaderStages() off the frontend object it is
// handed. Named and discarded rather than left out of the signature, so the two
// arms stay one row.
#if MOBILEGL_BUILD_DISAGGREGATED
#if MOBILEGL_BUILD_RECORD_ARM
// P13 W4c: MONOLITH'S RECORD ARM READS THE RECORD'S ARCHIVE (ProgramHandleArm), so it
// gets one: the link's snapshot, taken here, once per link - the same thing the wire
// decodes into the record, without the codec. A copy rather than a borrow, because the
+3 -3
View File
@@ -294,7 +294,7 @@ namespace MobileGL::MG_Pipe {
// latch clear, so every later row for that object keeps taking the real answer. The cost of
// that case is throughput, never silence.
inline Bool MGPipeResourceRespecifyWantsItsReply(const MGPResourceDesc& desc) {
#if MOBILEGL_BUILD_DISAGGREGATED
#if MOBILEGL_BUILD_RECORD_ARM
if (MGPipeInstalledArm() != MGPipeRouteArm::kClientWire) return true;
if (static_cast<MGPipeResourceTarget>(desc.Target) == MGPipeResourceTarget::Buffer)
return false;
@@ -372,7 +372,7 @@ namespace MobileGL::MG_Pipe {
// invariant MGPipeTypes.h asserts beside the packer and which the applier's own
// SubDataNamesABuffer already reads.
inline Bool MGPipeSubDataWantsItsReply(const MGPSubData& record) {
#if MOBILEGL_BUILD_DISAGGREGATED
#if MOBILEGL_BUILD_RECORD_ARM
// THE WIRE ARM ONLY. Everything above is an argument about a client talking to a server
// over SEG_CMD/SEG_STAGE; a monolith run inside a split build (every unit and
// integration-gpu lane is one) keeps the answer it always gave.
@@ -396,7 +396,7 @@ namespace MobileGL::MG_Pipe {
MGPReplySlot reply = MGPipeMintReplySlot();
MGP_ResourceSubData(&record, bytes, byteCount, regions, record.RegionCount, &reply);
const Bool accepted = MGPipeTakeReplyBool(reply, "resource_subdata");
#if MOBILEGL_BUILD_DISAGGREGATED
#if MOBILEGL_BUILD_RECORD_ARM
// A cancelled wire upload is declined even when no server reply was requested.
if (MGPipeInstalledArm() == MGPipeRouteArm::kClientWire) return accepted;
#endif