mirror of
https://github.com/MobileGL-Dev/MobileGL
synced 2026-11-20 16:31:57 +09:00
[Refactor] (P13): Espryt's frontend-keyed slot-table entries and the apply-thread refusals go, death notices release twins by handle, and the link ratchet refuses any '# P13' line (49 -> 36 symbols).
This commit is contained in:
@@ -781,6 +781,18 @@ namespace MobileGL::MG_Pipe {
|
||||
return (appliers.fetch_add(1, std::memory_order_relaxed) + 1) << 40;
|
||||
}
|
||||
|
||||
namespace {
|
||||
std::atomic<MGPipeCompileEnvChangedHook> g_compileEnvChangedHook{nullptr};
|
||||
}
|
||||
|
||||
void MGPipeSetCompileEnvChangedHook(MGPipeCompileEnvChangedHook hook) {
|
||||
g_compileEnvChangedHook.store(hook, std::memory_order_release);
|
||||
}
|
||||
|
||||
void MGPipeNotifyCompileEnvChanged() {
|
||||
if (const auto hook = g_compileEnvChangedHook.load(std::memory_order_acquire)) hook();
|
||||
}
|
||||
|
||||
MGPipeApplierState& MGPipeApplier() {
|
||||
const MGPipeApplierKeyResolver resolve = g_applierKeyResolver;
|
||||
if (resolve == nullptr) return g_defaultApplier;
|
||||
|
||||
@@ -1019,6 +1019,16 @@ namespace MobileGL::MG_Pipe {
|
||||
// is byte-for-byte the old behaviour.
|
||||
MGPipeApplierState& MGPipeApplier();
|
||||
|
||||
// P13 W6: the backend's "my capabilities changed" notice, without naming the frontend. A
|
||||
// backend whose advertised limits / extensions move after a context exists (Magma's caps
|
||||
// re-query) calls MGPipeNotifyCompileEnvChanged(); the frontend registers the hook that
|
||||
// invalidates its shader compile environment (PipeFill.cpp, static registration). Under a
|
||||
// transport no hook is registered on the server side and the client invalidates on the caps
|
||||
// re-publication instead (CONTRACT-P5C §4.2), so the notice is a no-op there.
|
||||
using MGPipeCompileEnvChangedHook = void (*)();
|
||||
void MGPipeSetCompileEnvChangedHook(MGPipeCompileEnvChangedHook hook);
|
||||
void MGPipeNotifyCompileEnvChanged();
|
||||
|
||||
// =====================================================================================
|
||||
// P14 S5 (docs/Disaggregated/design/11-state-ownership.md): WHOSE APPLIER IS IT?
|
||||
// =====================================================================================
|
||||
|
||||
Reference in New Issue
Block a user