Run the conformance logic suite on the Cesium renderer

The conformance page can now run the logic checks against the Cesium
scene renderer as well as the stub. CESIUM_CHECKS lists the checks of
the ports Cesium already has; each phase 2 migration adds its own, so
the suite shows how far the renderer is through the contract. All eight
listed checks pass in the browser, and the stub still passes its 69.

A harness frame is one tick of the render loop, observed through
frame.on('preUpdate'). It asks for no frame itself, so a check's own
requestRender is what makes a tick draw, and a loop that stops fails
the check after five seconds instead of hanging the run. The harness
frees each WebGL context on destroy.

FrameTime.dt is now measured rather than fixed at 1/60, and renderOnce
honours timeoutMs. A scene renderer made without the models capability
has no draw.models.
This commit is contained in:
Sameh Khamis committed 2026-11-05 16:04:02 -08:00
1 parent 6a8afe3009
commit 22ce0925a2
6 files changed
+170 -16

No files matched your search

+20 -4
View File
@@ -29,11 +29,19 @@ const SKY_DEFAULTS = Object.freeze({
lighting: false,
});
/** What this renderer can do; a caller may ask for fewer. */
const CAPABILITIES = ['models'];
/**
* @param {{container: HTMLElement, msaa?: number}} options
* @param {{container: HTMLElement, msaa?: number, capabilities?: Iterable<string>}} options
* `capabilities` limits the renderer to those it lists.
* @returns {Promise<object>} A renderer with the members listed above.
*/
export async function createCesiumSceneRenderer({ container, msaa = 4 }) {
export async function createCesiumSceneRenderer({
container,
msaa = 4,
capabilities: only,
}) {
const credits = document.createElement('div');
const widget = new Cesium.CesiumWidget(container, {
baseLayer: false,
@@ -60,7 +68,10 @@ export async function createCesiumSceneRenderer({ container, msaa = 4 }) {
if (scene.moon) scene.moon.show = false;
const sky = { ...SKY_DEFAULTS };
const capabilities = new Set(['models']);
const allowed = only && new Set(only);
const capabilities = new Set(
CAPABILITIES.filter((c) => !allowed || allowed.has(c)),
);
function applySky() {
scene.globe.enableLighting = sky.lighting;
@@ -134,7 +145,12 @@ export async function createCesiumSceneRenderer({ container, msaa = 4 }) {
canvas: scene.canvas,
frame,
globe,
draw: ports.draw,
// A member of a capability left out is absent, not stubbed.
draw: capabilities.has('models')
? ports.draw
: Object.fromEntries(
Object.entries(ports.draw).filter(([kind]) => kind !== 'models'),
),
camera: ports.camera,
query: ports.query,
capture: ports.capture,