Skip to content

fix(exporter): set default render backend for ModernVideoExporter#769

Open
maxmedina05 wants to merge 1 commit into
webadderallorg:mainfrom
maxmedina05:fix/lightning-webgl-backend
Open

fix(exporter): set default render backend for ModernVideoExporter#769
maxmedina05 wants to merge 1 commit into
webadderallorg:mainfrom
maxmedina05:fix/lightning-webgl-backend

Conversation

@maxmedina05

@maxmedina05 maxmedina05 commented Jul 19, 2026

Copy link
Copy Markdown

Description

ModernVideoExporter passes preferredRenderBackend: undefined to ModernFrameRenderer. With no preference and navigator.gpu present (always, in Electron), the backend order becomes ["webgpu", "webgl"], so Lightning renders through Pixi's WebGPU path — which is broken on Linux across GPU vendors (#644 has Intel, AMD, and NVIDIA reporters).

backendPolicy already exports getDefaultLightningRenderBackend(), which returns "webgl" and has a passing test, but the exporter never called it. This wires it up, flipping the order to ["webgl", "webgpu"] — the same order the Legacy pipeline uses, which reporters confirm works — while keeping WebGPU as a fallback if WebGL fails to init.

Part of a series of Linux fixes for Ubuntu 24.04; each PR is standalone and touches disjoint files.

Motivation

WebGPU requestAdapter() succeeds, then rendering crashes deeper inside Pixi's bind-group system, so the renderer's init-time fallback never fires and export dies with:

Lightning (Beta) export failed. Reason: Cannot read properties of undefined (reading '_resourceType')
Renderer: webgpu

Because the adapter check passes, gating on requestAdapter() would not help — the WebGPU path itself is the flaw, not the presence check. Preferring WebGL avoids it entirely.

Type of Change

  • Bug Fix
  • New Feature
  • Refactor / Code Cleanup
  • Documentation Update
  • Other (please specify)

Related Issue(s)

Fixes #644

Screenshots / Video

Not a UI change. The observable difference is the export banner: Renderer: webgpu (crashes) before, Renderer: webgl (completes) after.

Testing Guide

npx vitest --run
npm run dev   # export with Lightning (Beta); banner should read "Renderer: webgl"

Confirmed on Ubuntu 24.04 (X11, hybrid Intel iGPU + NVIDIA RTX 3070): with WebGPU, requestAdapter() returns a valid adapter yet Pixi still crashes as above; WebGL initializes cleanly as ANGLE (Intel, Mesa Intel(R) UHD Graphics (CML GT2), OpenGL 4.6).

Scope

getDefaultLightningRenderBackend() returns "webgl" unconditionally, so this applies to all platforms, not just Linux. #644 notes a possibly-related macOS variant (#501). If you'd rather keep WebGPU-first on macOS/Windows, I can gate this on platform === "linux" instead — happy to adjust.

Checklist

  • I have performed a self-review of my code.
  • I have added any necessary screenshots or videos.
  • I have linked related issue(s) and updated the changelog if applicable.

Notes

Investigated and drafted with Claude Code. The error and adapter behaviour described are from real runs on the hardware listed, not generated — I can re-run on request.


Thank you for contributing!

Summary by CodeRabbit

  • Bug Fixes
    • Improved video export rendering by selecting the recommended default rendering backend automatically.
    • Enhanced export reliability and consistency across supported environments.

@coderabbitai

coderabbitai Bot commented Jul 19, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 7f0e603d-609d-4955-8d18-1c7e84712b2b

📥 Commits

Reviewing files that changed from the base of the PR and between 360b160 and 4d81ef5.

📒 Files selected for processing (1)
  • src/lib/exporter/modernVideoExporter.ts

📝 Walkthrough

Walkthrough

ModernVideoExporter now computes the default Lightning render backend and passes it to ModernFrameRenderer during the main export flow instead of leaving the preference undefined.

Changes

Lightning backend selection

Layer / File(s) Summary
Apply the default render backend
src/lib/exporter/modernVideoExporter.ts
Imports getDefaultLightningRenderBackend and uses its result for preferredRenderBackend when constructing ModernFrameRenderer.

Estimated code review effort: 2 (Simple) | ~5 minutes

Suggested reviewers: meiiie, webadderall

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly summarizes the main change: setting a default render backend for ModernVideoExporter.
Description check ✅ Passed The description follows the template well and includes description, motivation, type, issue link, testing, and checklist.
Linked Issues check ✅ Passed The change addresses #644 by switching ModernVideoExporter to the WebGL-first default backend, matching the issue's goal.
Out of Scope Changes check ✅ Passed The patch is narrowly scoped to the exporter backend selection and adds no unrelated changes.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

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

Labels

Projects

None yet

1 participant