Skip to content

Fall back when particles HDR canvas format is unsupported#567

Open
lyonsno wants to merge 1 commit into
webgpu:mainfrom
lyonsno:fix-particles-hdr-canvas-fallback-564
Open

Fall back when particles HDR canvas format is unsupported#567
lyonsno wants to merge 1 commit into
webgpu:mainfrom
lyonsno:fix-particles-hdr-canvas-fallback-564

Conversation

@lyonsno
Copy link
Copy Markdown

@lyonsno lyonsno commented May 30, 2026

Summary

Fixes #564.

The particles sample currently configures its canvas as rgba16float unconditionally. Firefox reports that format as unsupported and throws from GPUCanvasContext.configure(), which sends the page through the global "uncaught exception, please report a bug" dialog.

This keeps rgba16float as the preferred HDR path, but catches unsupported canvas configuration and falls back to the browser's preferred canvas format. When the fallback path is active, the sample omits HDR-only toneMapping settings and marks the HDR settings UI as browser-unsupported instead of stopping the page.

Changes

  • Try the rgba16float canvas configuration before creating the render pipeline.
  • Fall back to the browser's preferred canvas format if HDR canvas configuration throws.
  • Skip canvas toneMapping settings while using the fallback format.
  • Show the browser-unsupported HDR state in the existing HDR settings UI.
  • Reuse the shared sample error dialog if both HDR and fallback canvas configuration fail.

Verification

  • npx eslint sample/particles/main.ts sample/util.ts
  • npm run lint
  • npm run build
  • git diff --check
  • Manual Firefox smoke: Firefox rejected rgba16float, logged a fallback to bgra8unorm, continued rendering the particles sample, and the brightnessFactor control remained interactive without an uncaught-exception dialog.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

uncaught exception - Canvas texture format rgba16float is not yet supported

1 participant