[Refactor] (P13 W5 S4c): the XFB lifetime lookup, the deferred-destroy drain and the PBO readback target build without a transport.

This commit is contained in:
2026-10-06 12:58:55 -04:00
parent 0b5e7fad82
commit ad47dc8c6f
4 changed files with 11 additions and 3 deletions
@@ -62,7 +62,11 @@
// the reply form's UploadSubData is what creates it.
MG_Pipe::MGPipeHandle PackBufferReadbackTarget(const SharedPtr<MG_State::GLState::BufferObject>& pbo,
Uint64 end) {
if (!pbo || MG_Config::Ipc.PboReadbackSync != 0) return MG_Pipe::kMGPipeNullHandle;
if (!pbo) return MG_Pipe::kMGPipeNullHandle;
#if MOBILEGL_BUILD_DISAGGREGATED
// The transport's own fallback knob (MOBILEGL_IPC_PBO_READBACK_SYNC): the reply form.
if (MG_Config::Ipc.PboReadbackSync != 0) return MG_Pipe::kMGPipeNullHandle;
#endif
if (!BufferWritebackIsReachable(*pbo) || pbo->IsMapped()) return MG_Pipe::kMGPipeNullHandle;
if (end > 0x7FFFFFFFull) return MG_Pipe::kMGPipeNullHandle;
return MG_Pipe::MGPipeSlots().FindByLifetimeId(MG_Pipe::MGPipeKind::Buffer, pbo->GetLifetimeId());
+4
View File
@@ -281,6 +281,10 @@ namespace MobileGL::MG_Pipe {
// the new session serves its first record. Objects of the ended session that are still
// alive find themselves unpublished, so their deaths put nothing on the new wire.
void MGPipeForgetEndedSession();
#else
// P13 W5: without a transport nothing applies off the GL thread, so no destroy is ever
// deferred to the next verb hook (the record arm's BeforeReadOnlyVerb still calls this).
inline void MGPipeDrainDeferredDestroys() {}
#endif
void MGPipeEmitResourceCreate(MG_State::GLState::BufferObject& buffer);
+1 -1
View File
@@ -1556,7 +1556,7 @@ namespace MobileGL::MG_State {
return it != m_transformFeedbackObjects.end() && it->second.everBound;
}
#if MOBILEGL_BUILD_DISAGGREGATED
#if MOBILEGL_BUILD_RECORD_ARM
Uint64 GLContext::GetTransformFeedbackLifetimeId(Uint index) const {
const auto found = m_transformFeedbackObjects.find(index);
return found == m_transformFeedbackObjects.end() ? 0 : found->second.lifetimeId;
+1 -1
View File
@@ -571,7 +571,7 @@ namespace MobileGL {
// Never returns 0 - the counter starts at 1 so a zero-initialised memo slot cannot
// be mistaken for a live object.
Uint64 GetBoundTransformFeedbackLifetimeId() const { return m_boundTransformFeedbackLifetimeId; }
#if MOBILEGL_BUILD_DISAGGREGATED
#if MOBILEGL_BUILD_RECORD_ARM
Uint64 GetTransformFeedbackLifetimeId(Uint index) const;
#endif
// Whether the object carrying this identity still has an OPEN capture span - one