rive-app / rive-wasm

Wasm/JS runtime for Rive
MIT License
660 stars 46 forks source link

Why rive trying to call webgl2 and webgl in canvas-lite package? #355

Open smnfox opened 1 month ago

smnfox commented 1 month ago

Description

I use canvas-lite package and when creating new Rive instance at first it trying to use webgl context

Provide a Repro

Small example https://codepen.io/Nadezhda-Trenogina/pen/yLWJvoK?editors=1111 Click "run" and alert will be shown with called context type. And there is webgl2 and webgl, only in the end will be 2d

Expected behavior

For package canvas-lite i expected only 2d context to be used

Screenshots

image

Browser & Versions (please complete the following information)

Additional context

Reproduced on every my device. I saw this behaviour when tried to debug problem on old android device, that doesn`t work correctly with webgl and immediately shows error instead of animation. Now i am confused why it works this way

If described behavior is correct and there is no bug, then maybe i can somehow choose what context i want to use to avoid webgl?

luckydye commented 2 weeks ago

I also ran into this, had to downgrade to 2.7.8. Appears to be happening from 2.7.9 up.

Possibly https://github.com/rive-app/rive-wasm/blob/6d5cd8909a635184f156be03d1f32d5ceb4025fc/wasm/js/renderer.js#L193