Skip to content

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.

build: the two renderer boundary guards follow the files they guard

yhh8fe5f1d06047
diff --git a/tools/check-draw-command-boundary.mjs b/tools/check-draw-command-boundary.mjs
index 8cb263262..4c465116c 100644
--- a/tools/check-draw-command-boundary.mjs
+++ b/tools/check-draw-command-boundary.mjs
@@ -6,23 +6,33 @@
//
// Enforces the unified-pipeline invariant: DrawCommand assembly and DrawList
// submission may appear ONLY in the single submission face
-// (renderer/BatchBuilder.cpp). Every renderer — plugin or direct submit —
+// (renderer/draw/BatchBuilder.cpp). Every renderer — plugin or direct submit —
// describes its draw as a BatchDrawKey + geometry and produces the command
// through that face; sort/merge/submit stay unified in DrawList.
//
// Run: node tools/check-draw-command-boundary.mjs (exit 1 on violation)
// =============================================================================
-import { readdirSync, readFileSync, statSync } from 'node:fs';
+import { existsSync, readdirSync, readFileSync, statSync } from 'node:fs';
import { join } from 'node:path';
const ROOT = 'src/esengine';
// The one translation unit allowed to build + push DrawCommands.
const ALLOWED = new Set([
- 'src/esengine/renderer/BatchBuilder.cpp',
+ 'src/esengine/renderer/draw/BatchBuilder.cpp',
]);
+// A moved or renamed exemption means the guard is describing a tree that no
+// longer exists — say so instead of reporting the submission face as its own
+// violation.
+for (const allowed of ALLOWED) {
+ if (!existsSync(allowed)) {
+ console.error(`Render-command boundary guard is stale: exempt file ${allowed} does not exist.`);
+ process.exit(1);
+ }
+}
+
// A DrawCommand local/member being assembled (`DrawCommand cmd{...}`, `= DrawCommand{...}`),
// and a command being pushed into the queue. References/params (`const DrawCommand&`) and
// the struct definition itself don't match.
diff --git a/tools/check-gl-boundary.mjs b/tools/check-gl-boundary.mjs
index 48bfbbd1f..8388dc897 100644
--- a/tools/check-gl-boundary.mjs
+++ b/tools/check-gl-boundary.mjs
@@ -5,22 +5,31 @@
// GL boundary guard (RC5)
//
// Enforces the keystone invariant: raw OpenGL/WebGL calls (`glXxx(...)`) may
-// appear ONLY in the single backend implementation (renderer/GLDevice.cpp).
+// appear ONLY in the single backend implementation (renderer/rhi/GLDevice.cpp).
// Every other translation unit must reach the GPU through GfxDevice/StateTracker.
//
// Run: node tools/check-gl-boundary.mjs (exit 1 on violation)
// =============================================================================
-import { readdirSync, readFileSync, statSync } from 'node:fs';
+import { existsSync, readdirSync, readFileSync, statSync } from 'node:fs';
import { join } from 'node:path';
const ROOT = 'src/esengine';
// The one file allowed to call gl* — the concrete GfxDevice backend.
const ALLOWED = new Set([
- 'src/esengine/renderer/GLDevice.cpp',
+ 'src/esengine/renderer/rhi/GLDevice.cpp',
]);
+// A moved or renamed exemption means the guard is describing a tree that no
+// longer exists — say so instead of reporting the backend as its own violation.
+for (const allowed of ALLOWED) {
+ if (!existsSync(allowed)) {
+ console.error(`GL boundary guard is stale: exempt file ${allowed} does not exist.`);
+ process.exit(1);
+ }
+}
+
// A gl call: `gl` + uppercase letter + identifier + `(`. Does not match `glm::`
// (lowercase m) or `GL_CONSTANT` macros.
const GL_CALL = /\bgl[A-Z]\w*\s*\(/;