[Fix] (Pipe): the records two families keep of their own are forgotten with the session too

MGPipeForgetAllPublications cleared the publication latch, but two death helpers do not ask the
latch: vertex elements ask the vertex-input emitter's RecordIsPublished and buffers ask the
resource tracker's WasPublished.  A VAO and its buffers destroyed with the GL context after the
split roles were down still found themselves published there, and glmark2's eglTerminate stopped
on the same assertion eglinfo's did (ResolveVertexElements, then ResolveResourceIn for a buffer).

Both records are now dropped beside the latch: the emitter's latches whole, the tracker's
Published flags.
This commit is contained in:
BZLZHH
2026-10-01 10:59:06 -04:00
parent 69728a4f9b
commit 353daa265e
3 changed files with 20 additions and 1 deletions
+8 -1
View File
@@ -1897,7 +1897,14 @@ namespace MobileGL::MG_Pipe {
PublicationLatch().NoteUnpublished(kind, handle);
}
void MGPipeForgetAllPublications() { PublicationLatch().Clear(); }
void MGPipeForgetAllPublications() {
PublicationLatch().Clear();
// The two families whose death asks their own record rather than the latch: vertex
// elements (MGPipeEmitVertexElementsDestroyAndFree's RecordIsPublished) and buffers
// (MGPipeEmitResourceDestroyAndFree's WasPublished).
MGPipeVertexInputEmitterInstance().ForgetAllRecords();
MGPipeResourceTrackerInstance().ForgetAllPublished();
}
// THE GATE ITSELF, AS AN OBSERVABLE (ID-39, widened by S-3 / ID-41). Every P4a birth hook
// below and every `wants()` row in the walk resolve through FamilyIsLive /
+4
View File
@@ -340,6 +340,10 @@ namespace MobileGL::MG_Pipe {
const SizeT slot = handle.Slot;
return slot < m_bySlot.size() && m_bySlot[slot].Published;
}
// The session that held every buffer's record is gone (MGPipeForgetAllPublications).
void ForgetAllPublished() {
for (Entry& entry : m_bySlot) entry.Published = false;
}
// The sticky everBoundAs mask. Sticky exactly as MGPResourceDesc::ImageBindableHint's
// everImageBound is: ORed, never cleared, so a buffer that was an element array once
+8
View File
@@ -351,6 +351,14 @@ namespace MobileGL::MG_Pipe {
m_boundLifetimeId = 0;
}
// The session that held the records is gone (MGPipeForgetAllPublications): both halves go,
// the record half included, because no applier holds any of them any more.
void ForgetAllRecords() {
for (Latch& latch : m_latch) latch = Latch{};
m_boundHandle = kMGPipeNullHandle;
m_boundLifetimeId = 0;
}
void ResetCounters() { m_creates = m_binds = m_bufferSets = m_indexSets = 0; }
private: