A fast 2D and 3D game engine — TypeScript SDK, C++/WebAssembly core, visual editor. Ship one project to web, desktop, WeChat MiniGames, playable ads, and native Android / iOS.
TypeScript 2d-game-engine3d3d-game-engineandroidcppecsgame-editorgame-enginegamedeviostypescriptwebassemblywebglwebgpuwechat-minigame
perf(render): per-frame glGetError polling is opt-in, not a tax
esenginec892519fdba6
diff --git a/CHANGELOG.md b/CHANGELOG.mdindex ffc94fb3f..013002180 100644--- a/CHANGELOG.md+++ b/CHANGELOG.md@@ -171,6 +171,15 @@ to.and the order between a C++ system and the JS-owned registry is not guaranteed.Held by an AddressSanitizer harness that exercises both orders.+- **The renderer no longer interrogates the GPU about errors it isn't having.**+ Every frame ended with a drain of `glGetError` — a debug facility that shipped+ enabled, in every build, on every platform. Each call is a synchronous round+ trip to the GPU process; on a fast machine it hides, and on a slow or contended+ one it was the single largest item in the renderer's profile, starving the+ editor's automation surface into timeouts. Error checking is opt-in now+ (`GLDebug.enable()`), the on-demand probes still force a check, and the browser+ already reports WebGL errors to the console on its own.+- **Saves no longer live in a directory the platform may delete.** Key/valuestorage went to the host's cache directory, whose stated purpose was theregenerable bytecode cache. On iOS that is `NSCachesDirectory`, which the systemdiff --git a/desktop/scripts/editor-mcp.mjs b/desktop/scripts/editor-mcp.mjsindex 0dc8f39aa..2b2f482eb 100644--- a/desktop/scripts/editor-mcp.mjs+++ b/desktop/scripts/editor-mcp.mjs@@ -104,6 +104,12 @@ function spawnHost(mode, token) {command = createRequire(import.meta.url)('electron');args = mode === 'editor' ? ['.', '--mcp'] : [path.join(HERE, 'editor-mcp-host.mjs')];}+ // Extra Chromium/Electron switches for a diagnostic run (dev only) — e.g.+ // ESTELLA_MCP_EDITOR_ARGS='--remote-debugging-port=9333' to let a debugger+ // reach the renderer of an editor a script is driving.+ if (process.env.ESTELLA_MCP_EDITOR_ARGS) {+ args.push(...process.env.ESTELLA_MCP_EDITOR_ARGS.split(/\s+/).filter(Boolean));+ }const host = spawn(command, args, {// An installed exe needs no cwd (and the repo layout may not exist there).cwd: editorExe ? undefined : DESKTOP,diff --git a/src/esengine/bindings/EngineState.hpp b/src/esengine/bindings/EngineState.hppindex f1de375dd..813a59776 100644--- a/src/esengine/bindings/EngineState.hpp+++ b/src/esengine/bindings/EngineState.hpp@@ -11,7 +11,13 @@ struct EngineState {int webgl_context = 0;bool initialized = false;bool immediate_draw_active = false;- bool gl_error_check_enabled = true;+ // Off by default: glGetError is a SYNCHRONOUS round-trip to the GPU process,+ // and the per-frame drain (renderer_flush/renderer_end) pays it on every+ // frame of every shipped game. Under a slow or contended GPU process those+ // round-trips starve the renderer's event loop — measured as the editor's+ // automation surface timing out while `getError` topped the profile. Opt in+ // via GLDebug.enable(); gl_checkErrors() probes force a check regardless.+ bool gl_error_check_enabled = false;u32 viewport_width = 1280;u32 viewport_height = 720;glm::vec4 clear_color{0.0f, 0.0f, 0.0f, 1.0f};