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:
+4
-10
@@ -41,13 +41,7 @@ async function perfRender(lighting, overlays) {
|
||||
draw += perfLast.drawWorld / n;
|
||||
for (const [key, value] of Object.entries(perfMarks)) marks[key] = (marks[key] || 0) + value / n;
|
||||
}
|
||||
let light = 0;
|
||||
if (!R.gpuOn) {
|
||||
for (let k = 0; k < 5; k++) computeLight();
|
||||
const l0 = performance.now();
|
||||
for (let k = 0; k < n; k++) computeLight();
|
||||
light = (performance.now() - l0) / n;
|
||||
}
|
||||
const light = 0;
|
||||
// Exercise the actual overlay calls and their arguments/conditions in frame().
|
||||
PERF_MARKS = false;
|
||||
for (let k = 0; k < 5; k++) frame(lastT + 1000 / 60);
|
||||
@@ -57,7 +51,7 @@ async function perfRender(lighting, overlays) {
|
||||
const frame_ms = (performance.now() - frameStart) / n;
|
||||
// One completed timestamp sample for this configuration, outside the CPU measurements.
|
||||
let gpu_ms = null;
|
||||
if (R.gpuOn && GPU.queries) {
|
||||
if (GPU.queries) {
|
||||
await GPU.timingPromise;
|
||||
PERF_MARKS = true; drawWorld();
|
||||
await GPU.timingPromise;
|
||||
@@ -66,7 +60,7 @@ async function perfRender(lighting, overlays) {
|
||||
return { frame_ms, drawWorld_ms: draw, computeLight_ms: light, marks_ms: marks,
|
||||
overlays: Object.fromEntries(Object.entries(data).map(([key, d]) => [key, { ms_per_frame: d.ms / n, calls: d.calls }])),
|
||||
overlay_ms: Object.values(data).reduce((sum, d) => sum + d.ms / n, 0),
|
||||
scale: R.gpuOn ? 1 : SM.scale, actual_look: SET.look, renderer: R.gpuOn ? 'webgpu' : 'legacy', override_cells: GPU.overrideCount || 0, gpu_ms };
|
||||
scale: 1, actual_look: SET.look, renderer: 'webgpu', override_cells: GPU.overrideCount || 0, gpu_ms };
|
||||
} finally { PERF_MARKS = false; }
|
||||
}
|
||||
function perfRun(seconds) {
|
||||
@@ -84,7 +78,7 @@ function perfRun(seconds) {
|
||||
requestAnimationFrame(frame);
|
||||
setTimeout(() => {
|
||||
window.__perfHalt(); PERF_FRAME = null; GAME.paused = true;
|
||||
resolve({ samples, end: perfState(), scale: R.gpuOn ? 1 : SM.scale, actual_look: SET.look, renderer: R.gpuOn ? 'webgpu' : 'legacy', override_cells: GPU.overrideCount || 0, gpu_ms: R.gpuOn ? GPU.gpuMs : null });
|
||||
resolve({ samples, end: perfState(), scale: 1, actual_look: SET.look, renderer: 'webgpu', override_cells: GPU.overrideCount || 0, gpu_ms: GPU.gpuMs });
|
||||
}, seconds * 1000);
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user