Conversation
Pixi caches one module-level batch shader sized by the first renderer's
texture limit. The editor preview initializes WebGL first, and on Mesa
drivers WebGL allows 32 textures while WebGPU allows 16, so the WebGPU export
renderer reused an incompatible bind group layout and crashed on the first
frame ("Cannot read properties of undefined (reading '_resourceType')").
Reject WebGPU when the limits differ so the export falls back to WebGL.
Co-Authored-By: claude-flow <ruv@ruv.net>
Claude-Session: https://claude.ai/code/session_014WWof1pMnhBVJuJzNreUoB
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (3)
Included review availability: Your plan provides up to 10 included reviews per hour; 7 remain after this review. 📝 WalkthroughWalkthroughChangesBatch texture compatibility
Priority: ➖ Normal Estimated code review effort: 2 (Simple) | ~10 minutes Change: Bug fix · Severity of issue fixed: Medium Sequence Diagram(s)sequenceDiagram
participant createPixiApplication
participant assertWebGpuBatchTextureLimitCompatible
participant readWebGlMaxBatchableTextures
participant PixiRenderer
createPixiApplication->>assertWebGpuBatchTextureLimitCompatible: check WebGPU application
assertWebGpuBatchTextureLimitCompatible->>readWebGlMaxBatchableTextures: read WebGL batch limit
readWebGlMaxBatchableTextures->>PixiRenderer: call getMaxTexturesPerBatch()
PixiRenderer-->>readWebGlMaxBatchableTextures: return limit or failure
assertWebGpuBatchTextureLimitCompatible->>PixiRenderer: read maxBatchableTextures
PixiRenderer-->>assertWebGpuBatchTextureLimitCompatible: return WebGPU limit
assertWebGpuBatchTextureLimitCompatible-->>createPixiApplication: return or throw mismatch
createPixiApplication->>createPixiApplication: retry next backend after mismatch
Merge Risk: ⚪ Minimal · up to The change detects incompatible renderer limits and safely falls back to WebGL, with no unresolved merge-blocking risk identified. 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
❤️ |
|
Tested PR #951 locally on Fedora 44 KDE Plasma with an AMD Ryzen 7 7730U / integrated Radeon GPU. Lightning MP4 export at 1920×1080, 30 FPS completed successfully using the PR build. The _resourceType crash from v1.4.0 is no longer reproducible. WebGL + WebCodecs export completed successfully. |
|
i'm trying this right now |

Description
Lightning exports on Linux crashed on the first frame with
Cannot read properties of undefined (reading '_resourceType'). When the WebGPU export renderer's batch texture limit differs from WebGL's, the renderer now rejects WebGPU and falls back to WebGL.Motivation
Root cause: Pixi caches a single module-level batch shader (
DefaultBatcher) sized by the first renderer created in the page. The editor preview initializes WebGL first; on Mesa drivers WebGL exposes 32 texture units while WebGPU exposes 16 (maxSampledTexturesPerShaderStage). The WebGPU export renderer then reuses a shader whose bind group layout expects 32 textures while its batch bind group only has 16, soBindGroupSystem._createBindGroupreadsundefinedresources. On macOS/Windows (ANGLE) both limits are 16, which is why only Linux is affected. Still present in pixi.js 8.20.1.Captured stack trace:
BindGroupSystem._createBindGroup ← GpuBatchAdaptor.execute ← BatcherPipe.execute ← WebGPURenderer.render ← FrameRenderer.renderFrame.Type of Change
Related Issue(s)
Fixes #644, fixes #948.
Testing Guide
webgpu export renderer unavailable … WebGPU batch texture limit (16) differs from WebGL (32)and the export completes with WebGL.npx vitest --run src/lib/exporter/pixiBatchTextureLimits.test.tsChecklist
🤖 Generated with claude-flow
https://claude.ai/code/session_014WWof1pMnhBVJuJzNreUoB
Summary by CodeRabbit