Closed Sruimeng closed 4 months ago
The recent updates enhance error handling across multiple classes in the effects package. A notable addition is the onRendererError
callback in the Ticker
class, which improves error management during rendering. The Player
class now assigns this callback to handle render errors and pause playback if errors occur. Additionally, the Engine
class now manages GPU resources more effectively, and the GLMaterial
and GLRendererInternal
classes include improved shader program checks and error handling.
File Path | Change Summary |
---|---|
packages/effects-core/src/ticker.ts |
Added onRendererError callback and modified runLoop to handle rendering errors. |
packages/effects/src/player.ts |
Assigned handleRenderError to onRendererError and added logic to pause playback on errors. |
packages/effects-core/src/engine.ts |
Enhanced GPU resource management and added rendererErrors property. |
packages/effects-webgl/src/gl-material.ts |
Added shader program initialization check and error handling in GLMaterial class. |
packages/effects-webgl/src/gl-renderer-internal.ts |
Removed console.warn for shader initialization failure. |
web-packages/demo/src/single.ts |
Added onRenderError callback to log errors in createPlayer function. |
sequenceDiagram
participant Player
participant Ticker
participant Engine
participant GLMaterial
participant Console
Player->>Ticker: Assign handleRenderError to onRendererError
Ticker->>GLMaterial: Check shader program initialization
GLMaterial-->>Ticker: Return error if uninitialized
Ticker->>Engine: Capture renderer error
Engine->>Player: Notify about renderer error
Player->>Player: Pause playback
Player->>Console: Log error message
In the code where errors dwell,
A rabbit hopped with tales to tell.
With callbacks set and shaders checked,
No more will rendering be wrecked.
Engines hum and players play,
Bugs and glitches kept at bay.
🐇✨
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?
Summary by CodeRabbit
New Features
Improvements
Bug Fixes
Developer Experience