feat(webgl): Enable all 28 scenarios for WebGL test harness

- Update wasm/Makefile to compile ALL scenario files using wildcard
- Add conditional compilation to scenario_bitmap.cpp (#ifdef __EMSCRIPTEN__)
  to handle OpenGL-specific shader workaround code for native only
- Change canvas dimensions to 1600x1200 to match native baseline (2x Retina)
- Set white background color to match native screenshots
- Update gal-webgl.spec.ts to hide UI overlay before taking screenshots
- Improve test-gal-regression.sh with better ImageMagick comparison

All 28 scenarios now compile and run on both native and WebGL backends.
Native vs baseline: PASSED (28/28 matching)
WebGL rendering: In progress (primitives not yet visible)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
Viktor Vaczi 2026-01-08 11:11:03 +01:00
commit d0e2500048
8 changed files with 129 additions and 35 deletions

View file

@ -138,10 +138,16 @@ test.describe('GAL WebGL Regression Tests', () => {
await expect(canvas).toBeVisible({ timeout: 5000 });
// Hide controls overlay before screenshot (it sits on top of canvas)
await page.locator('#controls-overlay').evaluate(el => el.style.visibility = 'hidden');
// Screenshot the canvas (matching native 800x600 output)
const screenshotPath = path.join(OUTPUT_DIR, `gal-${scenarioName}.png`);
await canvas.screenshot({ path: screenshotPath });
// Restore overlay for manual debugging
await page.locator('#controls-overlay').evaluate(el => el.style.visibility = 'visible');
// Print console logs for first scenario (debugging)
if (scenarioIndex === 0) {
console.log('\n=== Console logs ===');
@ -174,11 +180,17 @@ test.describe('GAL WebGL Regression Tests', () => {
// Wait for rendering
await page.waitForTimeout(50);
// Hide controls overlay before screenshot
await page.locator('#controls-overlay').evaluate(el => el.style.visibility = 'hidden');
// Screenshot the canvas
const canvas = await page.locator('#canvas');
const screenshotPath = path.join(OUTPUT_DIR, `gal-${scenarioName}.png`);
await canvas.screenshot({ path: screenshotPath });
// Restore overlay
await page.locator('#controls-overlay').evaluate(el => el.style.visibility = 'visible');
console.log(`[${i + 1}/28] ${scenarioName}`);
}