From cb64b62b573a5065677bcb488f19eafa83af05b1 Mon Sep 17 00:00:00 2001 From: Swung0x48 Date: Sun, 20 Sep 2026 21:03:16 -0400 Subject: [PATCH] [MG_Backend] (DirectGLES): both client-snapshot wrappers are monolith-only The indexed wrapper reads the bound VAO to tell a client index array from an element-buffer offset, and the indirect one reconciles the command buffer's shadow - both frontend reads, and under a transport the entry points run on the apply thread where the client owns those bytes (Fatal{RoleViolation}, which the split lane aborted on). --- MobileGL/MG_Backend/DirectGLES/DirectGLES.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/MobileGL/MG_Backend/DirectGLES/DirectGLES.cpp b/MobileGL/MG_Backend/DirectGLES/DirectGLES.cpp index 15580071..01121a85 100644 --- a/MobileGL/MG_Backend/DirectGLES/DirectGLES.cpp +++ b/MobileGL/MG_Backend/DirectGLES/DirectGLES.cpp @@ -2528,6 +2528,7 @@ namespace MobileGL::MG_Backend::DirectGLES { Bool SyncClientSideVertexArraysForIndirectFetch(const Uint8* commandBytes, SizeT commandOffset, GLsizei stride, GLsizei index, Uint8 indexSize, const SharedPtr& commandBuffer) { + if (MG_Config::Transport != MG_Config::TransportMode::Monolith) return true; const Uint8* source = commandBytes; if (commandBuffer) { commandBuffer->SyncGpuWrites(); @@ -2556,6 +2557,9 @@ namespace MobileGL::MG_Backend::DirectGLES { Bool SyncClientSideVertexArraysForIndexedFetch(GLenum type, GLsizei count, const void* indices, GLsizei instanceCount, GLint baseVertex, GLuint baseInstance) { if (count <= 0 || instanceCount <= 0) return true; + // MONOLITH ONLY - see SyncClientSideVertexArraysForFetch; this wrapper's own read of + // the bound VAO is the frontend read that must not happen on an apply thread. + if (MG_Config::Transport != MG_Config::TransportMode::Monolith) return true; const auto& currentVAO = MGB_CTX->GetBoundVertexArray(); if (!currentVAO) return true; const Uint8 indexSize = static_cast(MG_Util::GetGLTypeSize(type));