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.

perf(ui): drop the redundant PostUpdate transform pass

esengined314a75e9557
diff --git a/sdk/src/ui/layout/layout.ts b/sdk/src/ui/layout/layout.ts
index b7ba73c27..bc39100bc 100644
--- a/sdk/src/ui/layout/layout.ts
+++ b/sdk/src/ui/layout/layout.ts
@@ -5,8 +5,8 @@
* @brief Layout concept — the Yoga-backed layout driver.
*
* Owns the PreUpdate `UILayoutSystem` (drives the C++ Yoga pass via
- * `uiLayout_update` + `transform_update`) plus the PostUpdate late/final
- * passes that re-solve after scroll/list mutations. Co-located with the
+ * `uiLayout_update` + `transform_update`) plus the PostUpdate late pass
+ * that re-solves after scroll/list mutations. Co-located with the
* `flex`/`safe-area` schemas in this module.
*/
import type { App, Plugin } from '../../app';
@@ -69,16 +69,13 @@ export class UILayoutPlugin implements Plugin {
{ name: 'UILayoutSystem' }
));
+ // No transform pass after the late layout: nothing between PostUpdate and
+ // render reads world transforms (UIRenderOrder walks hierarchy only), and
+ // the renderer's ensureTransformsUpdated composes worlds before collect.
app.addSystemToSchedule(Schedule.PostUpdate, defineSystem(
[Res(UICameraInfo)],
layoutOnlyFn,
{ name: 'UILayoutLateSystem' }
- ), { runBefore: [SystemLabel.UIRenderOrder] });
-
- app.addSystemToSchedule(Schedule.PostUpdate, defineSystem(
- [],
- () => { module.transform_update(registry); },
- { name: 'UITransformFinalSystem' }
), { runAfter: [SystemLabel.ListView], runBefore: [SystemLabel.UIRenderOrder] });
}
}