mirror of
https://github.com/MobileGL-Dev/MobileGL
synced 2026-11-18 07:23:24 +09:00
[MG_Backend, MG_State, MG_Remote] (Disaggregated): P5e tx2 - the texture family by handle, the unit window, and the guard that notices
- SyncTextureToBackendByHandle and SyncMipmapsToBackendByHandle get their bodies
(the c0e seams): record first, twin by GetOrCreateByHandle, three syncs from the
record, no frontend touch and no allocator probe on the path.
- BackendTextureObject carries m_pushedSyncHandle (CONTRACT-P5E §4.1's m_handle), which
is what the three sync prologues read instead of probing the client allocator with
HandleOf, and what selects the by-handle arm inside them.
- IsDrawSyncCleanByRecord replaces IsDrawSyncClean(frontend) on the memo-hit path: the
same conjunction over the record's serials and the twin's own, with BOTH halves of each
resync pair read and neither clearing the other's (D-E2, scout R4).
- The unit work list is built from st.BoundSamplerViews[] and keyed on
(ContextSerial, SamplerViewsSerial, window, backend context generation); PairingsIntact
is not carried on it, because a {slot, gen} has no stale-pairing hazard to catch.
- ResolveAndBindUnitTextures is one pass over the window with the target from the view
CSO, then an unbind driven by g_boundTexturesCache; the alias arbiter dies (the client
arbitrated, SamplerEmit.h).
- BindCurrentTextures' memo key is ruling 6's both halves, entry selection included.
- The sampler pass reads BoundSamplerStates / the built-in sampler CSO / the view's
InternalFormat; the apply-thread mint and ResolveUnitSamplerBackend become a named
refusal under a transport (§4.2).
- GenerateMipmap resolves VerbMipRes and never the active unit; the detach sweep is keyed
by the texture handle over the applier's framebuffer records. The row is NOT flipped to
kWaitNone: the RGB16F/RGB32F CPU filter still reaches the client's level shadows, so
ruling 14's escape applies and the flip is trailing.
- RequireImageBindableStorage gets a by-handle entry whose re-dirty is
Fatal{UnmigratedEmulation, "image-bindable-redirty"} at the entry rather than three
frames deep at a MarkStorageDirty guard.
- The buffer-texture arm resolves scout R5 with Desc.BufferForTexBuffer / BufOffset /
BufSize and EnsureBufferResourceForHandle(nullptr, h) - that function is client-free
under an active transport (kimi audit row 29).
- CheckUnitWindows(st) at draw and dispatch makes the §5.3 window promise checkable and
checked: narrower than [0, MaxTouchedTextureUnit] is
Fatal{ProtocolCorruption, "SetSamplerViews.Count"} / "BindSamplerStates.Count".
- MipmapStorage's guard list gains the read-only shape accessors P5c deliberately
exempted, now that nothing on the draw path reads them.
This commit is contained in:
@@ -36,6 +36,21 @@ namespace MobileGL {
|
||||
// The message names the TEXTURE-side method, not this storage's: the pinned
|
||||
// surface list (MG_Test/Wire/RemoteClientTest.cpp's RemoteGuards) is written
|
||||
// in TextureObjectMipmap's vocabulary.
|
||||
//
|
||||
// P5e (tx2): THE READ-ONLY SHAPE ACCESSORS JOIN THE LIST. P5c guarded the
|
||||
// MUTATORS and deliberately exempted the shape reads, with the reason written
|
||||
// into RemoteClientTest: "the per-draw binding walk reads them every draw", so
|
||||
// guarding them would have aborted a lane that was still correct. P5e is the
|
||||
// commit that makes that untrue - the unit work list, the clean gate and the
|
||||
// three sync bodies read the resource RECORD and the server's staged-texture
|
||||
// store, and nothing on the draw path asks the frontend object for a level count,
|
||||
// a level extent, a level byte size or a compressed level again. So the exemption
|
||||
// becomes a guard, and reverting any handle arm aborts here BY ACCESSOR NAME
|
||||
// instead of rendering from client memory.
|
||||
//
|
||||
// A client-thread caller is unaffected (this is the frontend's own state, and the
|
||||
// guard returns unless ServerLoop::OnApplyThread()); Magma's texture sync keeps
|
||||
// its named scope exemption; the pull build compiles none of it.
|
||||
void RefuseLegacyTextureArmFromApplyThread(const char* surface) {
|
||||
if (MG_Config::Transport == MG_Config::TransportMode::Monolith) return;
|
||||
if (!MG_Remote::Server::ServerLoop::OnApplyThread()) return;
|
||||
@@ -97,6 +112,9 @@ namespace MobileGL {
|
||||
#endif
|
||||
|
||||
SizeT MipmapStorage::GetLevelCount() const {
|
||||
#if MOBILEGL_BUILD_DISAGGREGATED
|
||||
RefuseLegacyTextureArmFromApplyThread("GetMipmapLevelCount");
|
||||
#endif
|
||||
return m_data.size();
|
||||
}
|
||||
|
||||
@@ -171,16 +189,25 @@ namespace MobileGL {
|
||||
}
|
||||
|
||||
GLenum MipmapStorage::GetCompressedFormat(Uint level) const {
|
||||
#if MOBILEGL_BUILD_DISAGGREGATED
|
||||
RefuseLegacyTextureArmFromApplyThread("GetCompressedFormat");
|
||||
#endif
|
||||
if (level >= m_compressedFormats.size()) return GL_NONE;
|
||||
return m_compressedFormats[level];
|
||||
}
|
||||
|
||||
SizeT MipmapStorage::GetCompressedByteSize(Uint level) const {
|
||||
#if MOBILEGL_BUILD_DISAGGREGATED
|
||||
RefuseLegacyTextureArmFromApplyThread("GetCompressedByteSize");
|
||||
#endif
|
||||
if (level >= m_compressedData.size()) return 0;
|
||||
return m_compressedData[level].size();
|
||||
}
|
||||
|
||||
const void* MipmapStorage::MapCompressedData(Uint level) const {
|
||||
#if MOBILEGL_BUILD_DISAGGREGATED
|
||||
RefuseLegacyTextureArmFromApplyThread("MapCompressedMipmapData");
|
||||
#endif
|
||||
if (level >= m_compressedData.size()) return nullptr;
|
||||
return m_compressedData[level].data();
|
||||
}
|
||||
@@ -191,6 +218,9 @@ namespace MobileGL {
|
||||
}
|
||||
|
||||
GLenum MipmapStorage::GetRequestedCompressedFormat(Uint level) const {
|
||||
#if MOBILEGL_BUILD_DISAGGREGATED
|
||||
RefuseLegacyTextureArmFromApplyThread("GetRequestedCompressedFormat");
|
||||
#endif
|
||||
if (level >= m_requestedCompressedFormats.size()) return GL_NONE;
|
||||
return m_requestedCompressedFormats[level];
|
||||
}
|
||||
@@ -239,12 +269,18 @@ namespace MobileGL {
|
||||
}
|
||||
|
||||
IntVec3 MipmapStorage::GetTexelSize(Uint level) const {
|
||||
#if MOBILEGL_BUILD_DISAGGREGATED
|
||||
RefuseLegacyTextureArmFromApplyThread("GetMipmapTexelSize");
|
||||
#endif
|
||||
auto& targetTexelSizes = m_texelSizes;
|
||||
if (level >= targetTexelSizes.size()) return {0, 0, 0};
|
||||
return targetTexelSizes[level];
|
||||
}
|
||||
|
||||
SizeT MipmapStorage::GetByteSize(Uint level) const {
|
||||
#if MOBILEGL_BUILD_DISAGGREGATED
|
||||
RefuseLegacyTextureArmFromApplyThread("GetMipmapByteSize");
|
||||
#endif
|
||||
if (level >= m_data.size()) return 0;
|
||||
return m_data[level].size();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user