feat(web): add render performance authoring
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

This commit is contained in:
mes123456
2026-08-29 19:43:51 +08:00
parent 085632b3a9
commit ec23b29db1
47 changed files with 1918 additions and 38 deletions

View File

@@ -578,6 +578,7 @@ export interface SceneIR {
motionBlurSettings?: { enabled: boolean; shutter: number; position: number };
hairSettings?: { type: number; subdivisions: number };
compositorSettings?: { device: number; precision: number; denoiseDevice: number; previewQuality: number; finalQuality: number };
performanceSettings?: { fixedThreads: boolean; threads: number; persistentData: boolean; highQualityNormals: boolean };
compositorGraph?: CompositorGraphIR;
compositorStatus?: "AVAILABLE" | "BLOCKED";
sequencerTimeline?: SequencerTimelineIR;
@@ -1632,6 +1633,11 @@ export function parseSceneSnapshotIR(value: unknown): SceneSnapshotIR {
if (!isRecord(scene.compositorSettings)) throw new Error(`SceneIR.scenes[${index}].compositorSettings must be an object`);
for (const field of ["device", "precision", "denoiseDevice", "previewQuality", "finalQuality"] as const) requireNumber(scene.compositorSettings[field], `scenes[${index}].compositorSettings.${field}`);
}
if (scene.performanceSettings !== undefined) {
if (!isRecord(scene.performanceSettings)) throw new Error(`SceneIR.scenes[${index}].performanceSettings must be an object`);
for (const field of ["fixedThreads", "persistentData", "highQualityNormals"] as const) requireBoolean(scene.performanceSettings[field], `scenes[${index}].performanceSettings.${field}`);
requireNumber(scene.performanceSettings.threads, `scenes[${index}].performanceSettings.threads`);
}
if (scene.compositorStatus !== undefined && !["AVAILABLE", "BLOCKED"].includes(scene.compositorStatus as string)) {
throw new Error(`scenes[${index}].compositorStatus is invalid`);
}