WebGPU renderer complete: dirty uploads, default limits, legacy removed, WebGPU required, warm-up (t88 phase 2d)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-10-27 23:17:17 -04:00
co-authored by Claude Opus 5.5
parent 452b6aed32
commit 20963c776e
83 changed files with 776 additions and 1240 deletions
+3 -6
View File
@@ -173,7 +173,7 @@ with launch(viewport={'width': 1280, 'height': 800}) as (b, pg, url):
check('but not on the title screen', not ev(f'(() => {{ GAME.running = false; const r = {leave}; GAME.running = true; return r; }})()'))
ev("SET.zoom = 4; resizeRender(); R.snapNext = true;") # the rest of this play-through was laid out at zoom 4
ev(f"SET.look = '{look}'"); pg.wait_for_timeout(200)
check(f'the {look} look is drawing', ev('R.smoothOn') == (look == 'smooth'), ev('[SET.look, R.smoothOn, SM.ok]'))
check(f'the {look} look is drawing', ev('R.smoothOn') == (look == 'smooth'), ev('[SET.look, R.smoothOn, GPU.ok]'))
# Maps use the real frame loop and keyboard, including settings persistence.
pg.wait_for_function('MAP.image && MAP.init >= Math.ceil(W / 32) * Math.ceil(H / 32)')
check('minimap lives in bottom right with its controls', ev("!!document.querySelector('#hud .br #minimap canvas') && ['mini-plus', 'mini-minus', 'mini-map'].every(id => $(id).tagName === 'BUTTON')"))
@@ -1220,8 +1220,6 @@ with launch(viewport={'width': 1280, 'height': 800}) as (b, pg, url):
# Fog has its own paused scene; existing play checks keep the whole world visible.
fog_context = b.new_context(viewport={'width': 1280, 'height': 800})
fp = fog_context.new_page()
if pg.evaluate('!!window.__allowSoftwareGL'):
fp.add_init_script('window.__allowSoftwareGL = true')
fp.on('pageerror', lambda e: logs.append(f'PAGEERROR(fog): {e}'))
fp.goto(url)
fp.evaluate('startNewWorld(4242, 512, 384)')
@@ -1328,12 +1326,11 @@ with launch(viewport={'width': 1280, 'height': 800}) as (b, pg, url):
check('fog toggle shows the same rock', fp.evaluate(sample) != 0)
fp.evaluate("SET.fog = true; SET.look = 'smooth'; SM.t0 = performance.now() + 100000")
fp.wait_for_timeout(500)
check('fog draws in the smooth look', fp.evaluate('R.smoothOn && (R.gpuOn ? GPU.ok : SM.ok)'))
check('fog draws in the smooth look', fp.evaluate('R.smoothOn && GPU.ok'))
fp.add_script_tag(path=str(root / 'test/gpu-readback.js'))
check('unseen smooth grains have no terrain shape', fp.evaluate("""async () => {
const k=(235-R.vy0)*R.bw+300-R.vx0;
const inputs=R.gpuOn ? Array.from((await testSmoothInputs()).slice(k*4,k*4+4)) :
[R.px[k],R.backPx[k],R.treePx[k],R.fieldPx[k]];
const inputs=Array.from((await testSmoothInputs()).slice(k*4,k*4+4));
return inputs[0]===0x04000000 && inputs[1]===0 && inputs[2]===0 && inputs[3]===255;
}"""))
fp.screenshot(path=str(out / 'fog-smooth.png'))