perf: compile scene shaders off-thread before the first frame
I warm the world's programs with renderer.compileAsync() at the end of the async build, with the composer's scene target bound so tone mapping and output colour space key the same programs the composer draws with, and with hidden subtrees revealed so the light count matches the frame-0 warm render. The wait is capped at 2.5 s; the warm render stays as the safety net for the post passes, texture uploads and anything a slow or extension-less driver left. Test builds report renderer.info.programs, and a browser spec pins zero program growth after frame 0. On the Intel ARL laptop the frame-0 task drops from ~1.74 s to ~0.34 s with a pixel-identical first frame; measurements in docs/overnight/compile-async-results.md.
This commit is contained in:
@@ -404,6 +404,8 @@ describe("procedural world models", () => {
|
||||
expect(bloomPass.strength).toBe(restingBloom.strength);
|
||||
expect(bloomPass.threshold).toBe(restingBloom.threshold);
|
||||
processor.render({}, {});
|
||||
// The shader warm-up binds the scene pass's target (EffectComposer's readBuffer).
|
||||
expect(processor.sceneTarget()).toBe(composer.renderTarget2);
|
||||
const allocations = resources.gpuBudgetSnapshot({
|
||||
tier: "high",
|
||||
defaultFramebuffer: {
|
||||
|
||||
Reference in New Issue
Block a user