mirror of
https://github.com/MobileGL-Dev/MobileGL
synced 2026-11-16 22:43:24 +09:00
[Refactor] (P13 W3b): backends read MG_Pipe::gPipeInputs directly, MGB_CTX and its switch header are gone
This commit is contained in:
@@ -2308,7 +2308,7 @@ namespace MobileGL::MG_Remote::Client {
|
||||
//
|
||||
// WITH ONE NAMED EXCEPTION, FOUND BY ITS OWN FATAL (P5d round 3): generate_mipmap is
|
||||
// catalogued kCtxObject, but its sink is the backend's GenerateMipmap, which reads
|
||||
// MGB_CTX->GetActiveTextureUnit() and the unit's binding slot - residual inputs whose
|
||||
// gPipeInputs->GetActiveTextureUnit() and the unit's binding slot - residual inputs whose
|
||||
// freshness is the CLIENT's verb serial. Published without a wait, the record sits in
|
||||
// the ring while this thread runs the next verb's MGPipeValidateForVerb, which moves
|
||||
// that serial and withdraws the server stamp; the apply thread then reads the unit
|
||||
@@ -2317,7 +2317,7 @@ namespace MobileGL::MG_Remote::Client {
|
||||
// spin no longer read the clock). So it waits, exactly as the four stamping verbs
|
||||
// do. The rule this encodes: a record may skip its wait only if its apply reads
|
||||
// nothing the residual fill writes - the value carried in the payload is the whole
|
||||
// input. No other kCtxObject row has a backend body behind it that reads MGB_CTX
|
||||
// input. No other kCtxObject row has a backend body behind it that reads gPipeInputs
|
||||
// (set_texture_params, resource_subdata, resource_readback and get_texture_image
|
||||
// own reply slots and wait anyway; the resource_* transfers and object_death resolve
|
||||
// by handle).
|
||||
|
||||
@@ -1266,7 +1266,7 @@ namespace MobileGL::MG_Remote::Client {
|
||||
// The unit's binding is the frontend's and has just been written by the caller, so
|
||||
// the texture this record names is the one the server's SyncImageTextureBinding
|
||||
// will pull for the same unit. Read from MG_State::pGLContext and NOT through
|
||||
// MGB_CTX: on this side of a split MGB_CTX is gPipeInputs, which is the SERVER's
|
||||
// gPipeInputs: on this side of a split gPipeInputs is gPipeInputs, which is the SERVER's
|
||||
// view, and the client asking it a question is how the two halves come to disagree.
|
||||
if (MG_State::pGLContext != nullptr) {
|
||||
record.Res = PublishedTextureHandle(
|
||||
|
||||
@@ -573,7 +573,7 @@ namespace MobileGL::MG_Remote::Server {
|
||||
// Save the server-visible pack state, force neutral for the read, restore. Both go through
|
||||
// the applier's own set_pixel_pack_state entry point (MGPipeApplySetPixelPackState writes
|
||||
// gPipeInputs.m_pixelStore[0], which the backend's ReadPixels reads via
|
||||
// MGB_CTX->GetPixelStoreParameters); the read is synchronous on this thread, so the window
|
||||
// gPipeInputs->GetPixelStoreParameters); the read is synchronous on this thread, so the window
|
||||
// in which the pack state is neutral does not outlive the call.
|
||||
const MG_Pipe::PixelStoreParameters savedPack =
|
||||
MG_Pipe::gPipeInputs.GetPixelStoreParameters(/*isUnpack=*/false);
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
// session per process was a property of every file that named them. This slice gives each served
|
||||
// session its own {ServerSession, ServerLoop, PipeInputs} triple, held here, and resolves the two
|
||||
// singleton accessors through the CALLING THREAD's session - which is what makes the ~900 sites
|
||||
// that spell gPipeInputs, MGB_CTX, ServerSession::Active() or ServerLoopInstance() find the right
|
||||
// that spell gPipeInputs, gPipeInputs, ServerSession::Active() or ServerLoopInstance() find the right
|
||||
// one without one line of any of them moving.
|
||||
//
|
||||
// WHO IS A SESSION THREAD. Two threads per session, both created by the session itself:
|
||||
@@ -78,7 +78,7 @@ namespace MobileGL::MG_Remote::Server {
|
||||
void InstallSessionRuntimeHooks();
|
||||
|
||||
// THE SCOPE. Makes `runtime` the calling thread's session for as long as it lives: the
|
||||
// session/loop the singleton accessors answer with, the PipeInputs block MGB_CTX reads,
|
||||
// session/loop the singleton accessors answer with, the PipeInputs block gPipeInputs reads,
|
||||
// this session's segment resolver and this session's latch domain. Restores what was there
|
||||
// before on the way out (two nested scopes are not a shape anything uses, but a thread that
|
||||
// served one session and is then reused must not keep answering with the dead one).
|
||||
|
||||
Reference in New Issue
Block a user