fix(web): make WASM compositor evaluation produce an image
Some checks failed
M6 deployable RC / quick (push) Has been cancelled
M6 deployable RC / chromium (push) Has been cancelled
M6 deployable RC / release (push) Has been cancelled

Initialize the preview RenderResult before compositing and serve the result
via a blob URL so the deployment CSP accepts it. Verified RGB→Composite
returns 1024×1024 and the Properties button displays it.

Co-Authored-By: Claude Code <noreply@anthropic.com>
This commit is contained in:
mes123456
2026-11-14 07:54:31 +08:00
parent fe253bd9b2
commit 0274b58c18
8 changed files with 44 additions and 14 deletions

View File

@@ -70,6 +70,18 @@ print('TREE ' + json.dumps({'nodes': nodes, 'links': links}))`);
const evaluated = await request({ type: "jsonCommand", cmd: "compositorEvaluate", params: { sceneId } });
const payload = evaluated.result?.json;
log("evaluate", JSON.stringify({ ok: evaluated.ok, error: evaluated.error, width: payload?.width, height: payload?.height, pixels: typeof payload?.pixelsBase64 === "string" ? payload.pixelsBase64.length : null }));
const panel = page.locator('[data-testid="scene-pipeline-settings-workbench"]').first();
await panel.waitFor({ timeout: 30_000 });
await panel.getByRole("button", { name: "WASM 合成求值", exact: true }).evaluate((element) => element.click());
for (let index = 0; index < 120; index++) {
await page.waitForTimeout(500);
const ui = await page.evaluate(() => {
const workbench = document.querySelector('[data-testid="scene-pipeline-settings-workbench"]');
return { status: workbench?.querySelector('output[role="status"]')?.textContent ?? "", hasImage: Boolean(workbench?.querySelector('img')) };
});
if (ui.hasImage || (ui.status && !/求值中/.test(ui.status))) { log("ui", JSON.stringify(ui)); break; }
if (index === 119) log("ui timeout", JSON.stringify(ui));
}
} catch (error) {
log("probe error", error instanceof Error ? error.message : String(error));
} finally {