8000 fix(render): probe VideoFrame upload before claiming WebGPU by johannboehme · Pull Request #31 · johannboehme/tk-1 · GitHub
[go: up one dir, main page]

Skip to content

fix(render): probe VideoFrame upload before claiming WebGPU - #31

Merged
johannboehme merged 1 commit into
mainfrom
claude/zen-haslett-3e2b67
May 6, 2026
Merged

johannboehme merged 1 commit into
mainfrom
claude/zen-haslett-3e2b67

Conversation

@johannboehme
Copy link
Copy Markdown
Owner

Summary

  • Firefox 148 has navigator.gpu + an adapter, but copyExternalImageToTexture only accepts ImageBitmap / HTMLImage / HTMLCanvas / OffscreenCanvas — passing a VideoFrame throws TypeError on every rAF tick.
  • probeWebGPU() now also runs a real copyExternalImageToTexture(VideoFrame) after requestAdapter(). Firefox fails the upload step → webgpu: false → WebGL2 fallback (already documented in the README) takes over cleanly.
  • Same probe is exported and reused in the render worker, so export pipeline picks the correct backend too.

Test plan

  • npm run lint clean
  • npm run test -- src/local/capabilities.test.ts — 17/17 (3 new: accept / throw / no-VideoFrame)
  • Playwright Firefox: TRACK flow (drop song + 3 cams → sync → editor) — 6 s end-to-end, 0 page errors
  • Playwright Firefox: SESSION flow (→ triage → arrange → editor) — 0 page errors
  • Playwright Firefox: editor playback (Space, 1/2/3) — frames render via WebGL2, playhead advances

🤖 Generated with Claude Code

Firefox 148 ships navigator.gpu but its copyExternalImageToTexture
only accepts ImageBitmap / HTMLImage / HTMLCanvas / OffscreenCanvas —
not VideoFrame. The renderer uploads a VideoFrame every tick, so the
old probe (just requestAdapter()) let the WebGPU backend take over
and then threw TypeError on every rAF. Now the probe also runs a
real copyExternalImageToTexture(VideoFrame) and reports false on
throw, so Firefox falls through to WebGL2 cleanly.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
@johannboehme
johannboehme merged commit 1548b51 into main May 6, 2026
1 check passed
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.

1 participant

0