[MG_Remote] (Disaggregated): carry native query results and complete XFB object deletion

This commit is contained in:
2026-09-20 11:52:13 -04:00
parent c0b40ff508
commit 70df57bb23
21 changed files with 686 additions and 71 deletions
@@ -292,12 +292,21 @@ constexpr MGPipeVerb MGPipeVerbForWireOp(MGPWireOp op) {
case MGPWireOp::FenceWait: return MGPipeVerb::ClientWaitSync;
case MGPWireOp::FenceDestroy: return MGPipeVerb::DeleteSync;
case MGPWireOp::FenceWaitServer: return MGPipeVerb::WaitSync;
case MGPWireOp::QueryCreate: return MGPipeVerb::BeginXfbPrimitivesQuery;
case MGPWireOp::QueryBegin: return MGPipeVerb::BeginXfbPrimitivesQuery;
case MGPWireOp::QueryEnd: return MGPipeVerb::EndXfbPrimitivesQuery;
case MGPWireOp::QueryAvailable: return MGPipeVerb::IsQueryResultAvailable;
case MGPWireOp::QueryResult: return MGPipeVerb::GetQueryResult64;
case MGPWireOp::QueryDestroy: return MGPipeVerb::DeleteBackendQuery;
case MGPWireOp::QueryCounter: return MGPipeVerb::QueryCounterTimestamp;
case MGPWireOp::QueryTimestamp: return MGPipeVerb::GetGpuTimestampNs;
case MGPWireOp::DeleteStreamOutput: return MGPipeVerb::DeleteTransformFeedback;
default:
return MGPipeVerb::kVerbCount;
}
}
inline constexpr SizeT kMGPipeVerbBoundaryOpCount = 23;
inline constexpr SizeT kMGPipeVerbBoundaryOpCount = 32;
inline constexpr SizeT kMGPipeVerbBoundaryExemptCount = 3;
// ---- THE §7 ALLOWLIST, DERIVED RATHER THAN WRITTEN (ID-116) --------------------------
+4 -3
View File
@@ -29,7 +29,7 @@ struct MGPipeScreen {
void (*ApplierReset)(const MGPApplierReset* payload);
};
// context: 68 calls. A null entry means the backend does not implement this
// context: 69 calls. A null entry means the backend does not implement this
// call and the frontend keeps its own path (plan B section 4.1).
struct MGPipeContext {
void (*QueryCreate)(const MGPQueryDesc* payload);
@@ -100,11 +100,12 @@ struct MGPipeContext {
void (*ObjectDeath)(const MGPHandleOnly* payload);
void (*SetContextValues)(const MGPContextValues* payload);
void (*SetProgramBindings)(const MGPProgramBindings* payload, const void* varTail, Uint32 varTailCount);
void (*DeleteStreamOutput)(const MGPStreamOutputBind* payload);
};
inline constexpr SizeT kMGPipeScreenCallCount = 12;
inline constexpr SizeT kMGPipeContextCallCount = 68;
inline constexpr SizeT kMGPipeCallCount = 80;
inline constexpr SizeT kMGPipeContextCallCount = 69;
inline constexpr SizeT kMGPipeCallCount = 81;
// A table that is not exactly its call count of function pointers has grown a
// member that no generator knows about.
@@ -336,3 +336,7 @@ inline void MGP_SetContextValues(const MGPContextValues* payload) {
inline void MGP_SetProgramBindings(const MGPProgramBindings* payload, const void* varTail, Uint32 varTailCount) {
gMGPipeContext.SetProgramBindings(payload, varTail, varTailCount);
}
inline void MGP_DeleteStreamOutput(const MGPStreamOutputBind* payload) {
gMGPipeContext.DeleteStreamOutput(payload);
}
+16 -1
View File
@@ -150,7 +150,8 @@ enum class MGPWireOp : Uint16 {
ObjectDeath = 78,
SetContextValues = 79,
SetProgramBindings = 80,
kOpCount = 81,
DeleteStreamOutput = 81,
kOpCount = 82,
};
// THE FLAGS, EXPORTED ONCE, INDEXED BY OPCODE (P5 R-13.4). MGPWireRecHeader::Flags is
@@ -252,6 +253,7 @@ inline constexpr Uint32 kMGPipeCallFlags[static_cast<SizeT>(MGPWireOp::kOpCount)
/* 78 ObjectDeath */ static_cast<Uint32>(kNone),
/* 79 SetContextValues */ static_cast<Uint32>(kNone),
/* 80 SetProgramBindings */ static_cast<Uint32>(kVarTail | kHostSpan),
/* 81 DeleteStreamOutput */ static_cast<Uint32>(kNone),
};
static_assert(sizeof(kMGPipeCallFlags) / sizeof(kMGPipeCallFlags[0]) ==
static_cast<SizeT>(MGPWireOp::kOpCount),
@@ -352,6 +354,7 @@ inline constexpr Uint8 kMGPipeCallClasses[static_cast<SizeT>(MGPWireOp::kOpCount
/* 78 ObjectDeath */ static_cast<Uint8>(kCtxObject),
/* 79 SetContextValues */ static_cast<Uint8>(kCtxState),
/* 80 SetProgramBindings */ static_cast<Uint8>(kCtxState),
/* 81 DeleteStreamOutput */ static_cast<Uint8>(kCtxVerb),
};
static_assert(sizeof(kMGPipeCallClasses) / sizeof(kMGPipeCallClasses[0]) ==
static_cast<SizeT>(MGPWireOp::kOpCount),
@@ -456,6 +459,7 @@ inline constexpr Uint8 kMGPipeWaitClasses[static_cast<SizeT>(MGPWireOp::kOpCount
/* 78 ObjectDeath */ static_cast<Uint8>(kWaitNone),
/* 79 SetContextValues */ static_cast<Uint8>(kWaitNone),
/* 80 SetProgramBindings */ static_cast<Uint8>(kWaitNone),
/* 81 DeleteStreamOutput */ static_cast<Uint8>(kWaitNone),
};
static_assert(sizeof(kMGPipeWaitClasses) / sizeof(kMGPipeWaitClasses[0]) ==
static_cast<SizeT>(MGPWireOp::kOpCount),
@@ -1162,6 +1166,14 @@ static_assert(sizeof(MGPWireRec_SetProgramBindings) ==
((sizeof(MGPWireRecHeader) + sizeof(MGPProgramBindings) + 7u) & ~SizeT(7u)),
"MGPWireRec_SetProgramBindings gained padding; the wire format moved");
struct alignas(8) MGPWireRec_DeleteStreamOutput {
MGPWireRecHeader Header;
MGPStreamOutputBind Payload;
};
static_assert(sizeof(MGPWireRec_DeleteStreamOutput) ==
((sizeof(MGPWireRecHeader) + sizeof(MGPStreamOutputBind) + 7u) & ~SizeT(7u)),
"MGPWireRec_DeleteStreamOutput gained padding; the wire format moved");
[[noreturn]] inline void MGPipeWireProtocolFatal(const char* call, Uint64 size, Uint64 remaining) {
MGLOG_F("MGPipe: protocol corruption applying %s: size=%llu remaining=%llu", call,
static_cast<unsigned long long>(size), static_cast<unsigned long long>(remaining));
@@ -1451,6 +1463,9 @@ inline Bool MGPipeApplyWireRecord(MGPWireOp op, const void* record, Uint64 size,
case MGPWireOp::SetProgramBindings:
MGP_WIRE_CHECK_BOUNDS(MGPWireRec_SetProgramBindings, "SetProgramBindings");
break;
case MGPWireOp::DeleteStreamOutput:
MGP_WIRE_CHECK_BOUNDS(MGPWireRec_DeleteStreamOutput, "DeleteStreamOutput");
break;
case MGPWireOp::kInvalid:
case MGPWireOp::kOpCount:
default: