Pipe: fire-and-forget is async - mipmap, copies, XFB span and storage-block rows to kWaitNone, inproc creates and PBO readbacks stop waiting, and the default dual block lets a barriered verb cost one wait (FCL BSL: ~40 sync points/frame).

This commit is contained in:
2026-10-08 19:49:04 -04:00
parent 1771381057
commit 2fbcc22410
18 changed files with 234 additions and 64 deletions
+9 -9
View File
@@ -265,8 +265,8 @@
/* (kBlitOrCopy), same shape, a wait that is already carried in this lane. THE COST IS */ \
/* MEASURED, NOT ASSUMED: glCopyImageSubData is zero per frame in the Minecraft 26.3-rc-3 */ \
/* scene (~849 draws/frame), so the wait is not on any per-frame path. */ \
X(ResourceCopyRegion, MGPCopyRegion, kCtxObject, kNone, kWaitApplied) \
X(GenerateMipmap, MGPMipPlan, kCtxObject, kNone, kWaitApplied) \
X(ResourceCopyRegion, MGPCopyRegion, kCtxObject, kNone, kWaitNone) \
X(GenerateMipmap, MGPMipPlan, kCtxObject, kNone, kWaitNone) \
X(GetTextureImage, MGPReadbackInfo, kCtxObject, kReplySlot, kWaitReply) \
/* ---- context: transfer calls that read whole-context state, and the commands ---- */ \
X(Blit, MGPBlit, kCtxVerb, kNone, kWaitNone) \
@@ -275,10 +275,10 @@
X(DrawVbo, MGPDrawInfo, kCtxVerb, kHostSpan|kVarTail, kWaitNone) \
X(LaunchGrid, MGPGridInfo, kCtxVerb, kNone, kWaitNone) \
X(MemoryBarrier, MGPMemoryBarrier, kCtxVerb, kNone, kWaitNone) \
X(BeginStreamOutput, MGPStreamOutputBegin, kCtxVerb, kNone, kWaitApplied) \
X(EndStreamOutput, MGPXfbAccounting, kCtxVerb, kNone, kWaitApplied) \
X(PauseStreamOutput, MGPStreamOutputControl, kCtxVerb, kNone, kWaitApplied) \
X(ResumeStreamOutput, MGPStreamOutputControl, kCtxVerb, kNone, kWaitApplied) \
X(BeginStreamOutput, MGPStreamOutputBegin, kCtxVerb, kNone, kWaitNone) \
X(EndStreamOutput, MGPXfbAccounting, kCtxVerb, kNone, kWaitNone) \
X(PauseStreamOutput, MGPStreamOutputControl, kCtxVerb, kNone, kWaitNone) \
X(ResumeStreamOutput, MGPStreamOutputControl, kCtxVerb, kNone, kWaitNone) \
X(Flush, MGPFlush, kCtxVerb, kNone, kWaitNone) \
X(Present, MGPPresent, kCtxVerb, kNone, kWaitPresent) \
X(SetSwapInterval, MGPSwapInterval, kCtxVerb, kOptional, kWaitNone) \
@@ -305,13 +305,13 @@
X(PatchParameter, MGPPatchParameter, kCtxVerb, kNone, kWaitNone) \
/* glBindTransformFeedback - the driver object rebind and the capture-binding shadow */ \
/* invalidation happen at the call; the XFB namespace has no wire lifetime. */ \
X(BindStreamOutput, MGPStreamOutputBind, kCtxVerb, kNone, kWaitApplied) \
X(BindStreamOutput, MGPStreamOutputBind, kCtxVerb, kNone, kWaitNone) \
/* glShaderStorageBlockBinding - the block NAME is the coordinate all three sides share */ \
/* (BackendObject.h), and a name is bytes: kHasBlob, staged whole in SEG_STAGE, NUL included. */ \
X(SetStorageBlockBinding, MGPStorageBlockBinding, kCtxVerb, kHasBlob, kWaitApplied) \
X(SetStorageBlockBinding, MGPStorageBlockBinding, kCtxVerb, kHasBlob, kWaitNone) \
/* glCopyTexImage2D / glCopyTexSubImage2D - a copy whose SOURCE is the read framebuffer, */ \
/* which resource_copy_region (resource -> resource) cannot express. */ \
X(CopyFramebufferToTexture, MGPCopyFromFramebuffer, kCtxVerb, kNone, kWaitApplied) \
X(CopyFramebufferToTexture, MGPCopyFromFramebuffer, kCtxVerb, kNone, kWaitNone) \
/* ---- APPENDED BY P5c (MG_Remote/CONTRACT-P5C.md §5): the two control records. Opcodes ---- */ \
/* ---- 77..78. Neither has an MGPipeApply* entry point and neither gains one: both reach ---- */ \
/* ---- WireVerbSink, and under monolith neither has a producer - the reset is a direct ---- */ \
+9 -9
View File
@@ -443,8 +443,8 @@ inline constexpr Uint8 kMGPipeWaitClasses[static_cast<SizeT>(MGPWireOp::kOpCount
/* 50 ResourceSubDataComplete */ static_cast<Uint8>(kWaitNone),
/* 51 ResourceFlushRange */ static_cast<Uint8>(kWaitNone),
/* 52 ResourceReadback */ static_cast<Uint8>(kWaitReply),
/* 53 ResourceCopyRegion */ static_cast<Uint8>(kWaitApplied),
/* 54 GenerateMipmap */ static_cast<Uint8>(kWaitApplied),
/* 53 ResourceCopyRegion */ static_cast<Uint8>(kWaitNone),
/* 54 GenerateMipmap */ static_cast<Uint8>(kWaitNone),
/* 55 GetTextureImage */ static_cast<Uint8>(kWaitReply),
/* 56 Blit */ static_cast<Uint8>(kWaitNone),
/* 57 Clear */ static_cast<Uint8>(kWaitNone),
@@ -452,10 +452,10 @@ inline constexpr Uint8 kMGPipeWaitClasses[static_cast<SizeT>(MGPWireOp::kOpCount
/* 59 DrawVbo */ static_cast<Uint8>(kWaitNone),
/* 60 LaunchGrid */ static_cast<Uint8>(kWaitNone),
/* 61 MemoryBarrier */ static_cast<Uint8>(kWaitNone),
/* 62 BeginStreamOutput */ static_cast<Uint8>(kWaitApplied),
/* 63 EndStreamOutput */ static_cast<Uint8>(kWaitApplied),
/* 64 PauseStreamOutput */ static_cast<Uint8>(kWaitApplied),
/* 65 ResumeStreamOutput */ static_cast<Uint8>(kWaitApplied),
/* 62 BeginStreamOutput */ static_cast<Uint8>(kWaitNone),
/* 63 EndStreamOutput */ static_cast<Uint8>(kWaitNone),
/* 64 PauseStreamOutput */ static_cast<Uint8>(kWaitNone),
/* 65 ResumeStreamOutput */ static_cast<Uint8>(kWaitNone),
/* 66 Flush */ static_cast<Uint8>(kWaitNone),
/* 67 Present */ static_cast<Uint8>(kWaitPresent),
/* 68 SetSwapInterval */ static_cast<Uint8>(kWaitNone),
@@ -464,9 +464,9 @@ inline constexpr Uint8 kMGPipeWaitClasses[static_cast<SizeT>(MGPWireOp::kOpCount
/* 71 FenceWaitServer */ static_cast<Uint8>(kWaitNone),
/* 72 BindShaderImage */ static_cast<Uint8>(kWaitNone),
/* 73 PatchParameter */ static_cast<Uint8>(kWaitNone),
/* 74 BindStreamOutput */ static_cast<Uint8>(kWaitApplied),
/* 75 SetStorageBlockBinding */ static_cast<Uint8>(kWaitApplied),
/* 76 CopyFramebufferToTexture*/ static_cast<Uint8>(kWaitApplied),
/* 74 BindStreamOutput */ static_cast<Uint8>(kWaitNone),
/* 75 SetStorageBlockBinding */ static_cast<Uint8>(kWaitNone),
/* 76 CopyFramebufferToTexture*/ static_cast<Uint8>(kWaitNone),
/* 77 ApplierReset */ static_cast<Uint8>(kWaitApplied),
/* 78 ObjectDeath */ static_cast<Uint8>(kWaitNone),
/* 79 SetContextValues */ static_cast<Uint8>(kWaitNone),
@@ -743,8 +743,8 @@ inline constexpr WireCallLayout kMGPipeWireCallLayouts[] = {
{"ResourceSubDataComplete", "MGPSubDataComplete", static_cast<Uint64>(MGPWireOp::ResourceSubDataComplete), static_cast<Uint64>(kNone), static_cast<Uint64>(kWaitNone)},
{"ResourceFlushRange", "MGPFlushRange", static_cast<Uint64>(MGPWireOp::ResourceFlushRange), static_cast<Uint64>(kNone), static_cast<Uint64>(kWaitNone)},
{"ResourceReadback", "MGPReadback", static_cast<Uint64>(MGPWireOp::ResourceReadback), static_cast<Uint64>(kReplySlot), static_cast<Uint64>(kWaitReply)},
{"ResourceCopyRegion", "MGPCopyRegion", static_cast<Uint64>(MGPWireOp::ResourceCopyRegion), static_cast<Uint64>(kNone), static_cast<Uint64>(kWaitApplied)},
{"GenerateMipmap", "MGPMipPlan", static_cast<Uint64>(MGPWireOp::GenerateMipmap), static_cast<Uint64>(kNone), static_cast<Uint64>(kWaitApplied)},
{"ResourceCopyRegion", "MGPCopyRegion", static_cast<Uint64>(MGPWireOp::ResourceCopyRegion), static_cast<Uint64>(kNone), static_cast<Uint64>(kWaitNone)},
{"GenerateMipmap", "MGPMipPlan", static_cast<Uint64>(MGPWireOp::GenerateMipmap), static_cast<Uint64>(kNone), static_cast<Uint64>(kWaitNone)},
{"GetTextureImage", "MGPReadbackInfo", static_cast<Uint64>(MGPWireOp::GetTextureImage), static_cast<Uint64>(kReplySlot), static_cast<Uint64>(kWaitReply)},
{"Blit", "MGPBlit", static_cast<Uint64>(MGPWireOp::Blit), static_cast<Uint64>(kNone), static_cast<Uint64>(kWaitNone)},
{"Clear", "MGPClear", static_cast<Uint64>(MGPWireOp::Clear), static_cast<Uint64>(kNone), static_cast<Uint64>(kWaitNone)},
@@ -752,10 +752,10 @@ inline constexpr WireCallLayout kMGPipeWireCallLayouts[] = {
{"DrawVbo", "MGPDrawInfo", static_cast<Uint64>(MGPWireOp::DrawVbo), static_cast<Uint64>(kHostSpan | kVarTail), static_cast<Uint64>(kWaitNone)},
{"LaunchGrid", "MGPGridInfo", static_cast<Uint64>(MGPWireOp::LaunchGrid), static_cast<Uint64>(kNone), static_cast<Uint64>(kWaitNone)},
{"MemoryBarrier", "MGPMemoryBarrier", static_cast<Uint64>(MGPWireOp::MemoryBarrier), static_cast<Uint64>(kNone), static_cast<Uint64>(kWaitNone)},
{"BeginStreamOutput", "MGPStreamOutputBegin", static_cast<Uint64>(MGPWireOp::BeginStreamOutput), static_cast<Uint64>(kNone), static_cast<Uint64>(kWaitApplied)},
{"EndStreamOutput", "MGPXfbAccounting", static_cast<Uint64>(MGPWireOp::EndStreamOutput), static_cast<Uint64>(kNone), static_cast<Uint64>(kWaitApplied)},
{"PauseStreamOutput", "MGPStreamOutputControl", static_cast<Uint64>(MGPWireOp::PauseStreamOutput), static_cast<Uint64>(kNone), static_cast<Uint64>(kWaitApplied)},
{"ResumeStreamOutput", "MGPStreamOutputControl", static_cast<Uint64>(MGPWireOp::ResumeStreamOutput), static_cast<Uint64>(kNone), static_cast<Uint64>(kWaitApplied)},
{"BeginStreamOutput", "MGPStreamOutputBegin", static_cast<Uint64>(MGPWireOp::BeginStreamOutput), static_cast<Uint64>(kNone), static_cast<Uint64>(kWaitNone)},
{"EndStreamOutput", "MGPXfbAccounting", static_cast<Uint64>(MGPWireOp::EndStreamOutput), static_cast<Uint64>(kNone), static_cast<Uint64>(kWaitNone)},
{"PauseStreamOutput", "MGPStreamOutputControl", static_cast<Uint64>(MGPWireOp::PauseStreamOutput), static_cast<Uint64>(kNone), static_cast<Uint64>(kWaitNone)},
{"ResumeStreamOutput", "MGPStreamOutputControl", static_cast<Uint64>(MGPWireOp::ResumeStreamOutput), static_cast<Uint64>(kNone), static_cast<Uint64>(kWaitNone)},
{"Flush", "MGPFlush", static_cast<Uint64>(MGPWireOp::Flush), static_cast<Uint64>(kNone), static_cast<Uint64>(kWaitNone)},
{"Present", "MGPPresent", static_cast<Uint64>(MGPWireOp::Present), static_cast<Uint64>(kNone), static_cast<Uint64>(kWaitPresent)},
{"SetSwapInterval", "MGPSwapInterval", static_cast<Uint64>(MGPWireOp::SetSwapInterval), static_cast<Uint64>(kOptional), static_cast<Uint64>(kWaitNone)},
@@ -764,9 +764,9 @@ inline constexpr WireCallLayout kMGPipeWireCallLayouts[] = {
{"FenceWaitServer", "MGPFenceWait", static_cast<Uint64>(MGPWireOp::FenceWaitServer), static_cast<Uint64>(kNone), static_cast<Uint64>(kWaitNone)},
{"BindShaderImage", "MGPImageBind", static_cast<Uint64>(MGPWireOp::BindShaderImage), static_cast<Uint64>(kNone), static_cast<Uint64>(kWaitNone)},
{"PatchParameter", "MGPPatchParameter", static_cast<Uint64>(MGPWireOp::PatchParameter), static_cast<Uint64>(kNone), static_cast<Uint64>(kWaitNone)},
{"BindStreamOutput", "MGPStreamOutputBind", static_cast<Uint64>(MGPWireOp::BindStreamOutput), static_cast<Uint64>(kNone), static_cast<Uint64>(kWaitApplied)},
{"SetStorageBlockBinding", "MGPStorageBlockBinding", static_cast<Uint64>(MGPWireOp::SetStorageBlockBinding), static_cast<Uint64>(kHasBlob), static_cast<Uint64>(kWaitApplied)},
{"CopyFramebufferToTexture", "MGPCopyFromFramebuffer", static_cast<Uint64>(MGPWireOp::CopyFramebufferToTexture), static_cast<Uint64>(kNone), static_cast<Uint64>(kWaitApplied)},
{"BindStreamOutput", "MGPStreamOutputBind", static_cast<Uint64>(MGPWireOp::BindStreamOutput), static_cast<Uint64>(kNone), static_cast<Uint64>(kWaitNone)},
{"SetStorageBlockBinding", "MGPStorageBlockBinding", static_cast<Uint64>(MGPWireOp::SetStorageBlockBinding), static_cast<Uint64>(kHasBlob), static_cast<Uint64>(kWaitNone)},
{"CopyFramebufferToTexture", "MGPCopyFromFramebuffer", static_cast<Uint64>(MGPWireOp::CopyFramebufferToTexture), static_cast<Uint64>(kNone), static_cast<Uint64>(kWaitNone)},
{"ApplierReset", "MGPApplierReset", static_cast<Uint64>(MGPWireOp::ApplierReset), static_cast<Uint64>(kNone), static_cast<Uint64>(kWaitApplied)},
{"ObjectDeath", "MGPHandleOnly", static_cast<Uint64>(MGPWireOp::ObjectDeath), static_cast<Uint64>(kNone), static_cast<Uint64>(kWaitNone)},
{"SetContextValues", "MGPContextValues", static_cast<Uint64>(MGPWireOp::SetContextValues), static_cast<Uint64>(kNone), static_cast<Uint64>(kWaitNone)},