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.

chore(gates): the terrain occlusion scenes wait for the ground to be made, not for eight seconds - a step of a software rasteriser is slow, so an eight-second wall-clock settle ran past the runner's seventy-five; the render host can warm a scene as a loading screen does (ESTELLA_VERIFY_WARM), and the two scenes take five and twelve seconds there

yhhc5d70f7f6050
diff --git a/tools/render-host/host.ts b/tools/render-host/host.ts
index 9279c959a..0e91348be 100644
--- a/tools/render-host/host.ts
+++ b/tools/render-host/host.ts
@@ -28,7 +28,7 @@ import {
planarReflectionStatus,
EditorViewLighting, EditorViewShading, EditorView, EditorGrid, installEditorGrid, editorViewHalfHeight, setEditorViewHalfHeight,
ProfileRecorder, AnimatorController, Timeline, onDeviceRestored, Schedule, defineSystem,
- textureImportSettingsFrom, shadersCompiled, defineSkyEffect,
+ textureImportSettingsFrom, shadersCompiled, warmShaders, defineSkyEffect,
} from 'esengine';
import type { App, SceneData, SceneEntityData, PrefabData, RenderSurfaceSource } from 'esengine';
import type { ESEngineModule } from 'esengine/wasm';
@@ -534,6 +534,11 @@ const api = {
/** Waits for submitted shader variants without advancing the simulation clock. */
waitForShaders: () => shadersCompiled(module),
+ async warm(timeoutMs = 60000): Promise<{ frames: number; ms: number; pending: number; timedOut: boolean }> {
+ if (!app) throw new Error('warm: no scene loaded');
+ return warmShaders(app, { timeoutMs });
+ },
+
/** Uploads the native row-major placement records used by foliage and composite batches. */
setMeshPlacements(id: number, values: number[]): void {
if (!module?.meshInstances_set || values.length % 16 !== 0 || values.some(v => !Number.isFinite(v))) {
diff --git a/tools/render-host/run.mjs b/tools/render-host/run.mjs
index 25086a979..eb65368de 100644
--- a/tools/render-host/run.mjs
+++ b/tools/render-host/run.mjs
@@ -347,6 +347,10 @@ app.whenReady().then(async () => {
await api.step(cfg.steps ?? 2, 1 / 60);
})()`);
}
+ if (process.env.ESTELLA_VERIFY_WARM) {
+ const warmed = await exec(`window.__estellaHeadless.api.warm(${Number(process.env.ESTELLA_VERIFY_WARM) > 1 ? Number(process.env.ESTELLA_VERIFY_WARM) : 60000})`);
+ if (warmed.timedOut) throw new Error(`warm: the scene was still being made after ${Math.round(warmed.ms)} ms (${warmed.pending} shader(s) compiling)`);
+ }
if (process.env.ESTELLA_VERIFY_TRAIL) {
const trail = JSON.parse(process.env.ESTELLA_VERIFY_TRAIL);
await exec(`(async () => {
diff --git a/tools/renderScenes.mjs b/tools/renderScenes.mjs
index 3b33d1613..286342f18 100644
--- a/tools/renderScenes.mjs
+++ b/tools/renderScenes.mjs
@@ -102,8 +102,7 @@ export const SCENES = [
id: test.id, tier: 'pr', webgpu: true,
env: {
ESTELLA_VERIFY_SCENE: '/scenes/terrain-layer-occlusion.esscene',
- // Layers are packed and their shader compiled before the ground draws at all: a cold WebGL2 start took more than 2.5 s.
- ESTELLA_VERIFY_W: '256', ESTELLA_VERIFY_H: '256', ESTELLA_VERIFY_STEPS: '30', ESTELLA_VERIFY_SETTLE_MS: '8000',
+ ESTELLA_VERIFY_W: '256', ESTELLA_VERIFY_H: '256', ESTELLA_VERIFY_STEPS: '30', ESTELLA_VERIFY_WARM: '1',
...(test.set.length ? { ESTELLA_VERIFY_SET_FIELD: JSON.stringify(test.set) } : {}),
ESTELLA_VERIFY_EXPECT: JSON.stringify(test.expect.map(([x, rgb]) => ({ x, y: 0.5, rgb, tol: 14 }))),
},