Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wasm demo: Report an error when opengl context cannot be created #896

Open
gwpl opened this issue Jan 29, 2022 · 10 comments
Open

Wasm demo: Report an error when opengl context cannot be created #896

gwpl opened this issue Jan 29, 2022 · 10 comments
Labels
a:platform-wasm browser integration (mO,bT) bug Something isn't working good first issue Good for newcomers priority:low Lowest priority. The issue is kept open for tracking purpose, but noone is actively working on this

Comments

@gwpl
Copy link

gwpl commented Jan 29, 2022

Demos does not work on Chromium 97.0.4692.99 Arch Linux.

(However they work in Firefox...)

@ogoffart
Copy link
Member

They work for me on the same version of Chromium.
Could you describe what is not working?

@gwpl
Copy link
Author

gwpl commented Jan 29, 2022

On Firefox everything works fine.

On Chromium in a place where should be wasm sixtyfps demo apps, it's just white.

@gwpl
Copy link
Author

gwpl commented Jan 29, 2022

E.g. https://sixtyfps.io/releases/0.1.6/demos/slide_puzzle/

when I open Developer Console I see:

slide_puzzle_bg.wasm:0x1bbbec Uncaught (in promise) RuntimeError: unreachable
    at slide_puzzle_bg.wasm:0x1bbbec
    at slide_puzzle_bg.wasm:0x1c5dc3
    at slide_puzzle_bg.wasm:0x1c2da0
    at slide_puzzle_bg.wasm:0x3fd80
    at slide_puzzle_bg.wasm:0x90f33
    at slide_puzzle_bg.wasm:0xd4f12
    at init (slide_puzzle.js:1268:10)
$func2168	@	slide_puzzle_bg.wasm:0x1bbbec
$func2697	@	slide_puzzle_bg.wasm:0x1c5dc3
$func2496	@	slide_puzzle_bg.wasm:0x1c2da0
$func270	@	slide_puzzle_bg.wasm:0x3fd80
$func309	@	slide_puzzle_bg.wasm:0x90f33
$main	@	slide_puzzle_bg.wasm:0xd4f12
init	@	slide_puzzle.js:1268

@ogoffart ogoffart added the a:platform-wasm browser integration (mO,bT) label Jan 29, 2022
@ogoffart
Copy link
Member

Interresting. The exact same works for me.
And i'm also using an up-to-date Archlinux

Screenshot_20220129_132157
.

@gwpl
Copy link
Author

gwpl commented Jan 29, 2022

Yes, I know. It works for me on Firefox on Arch Linux, and on Chromium on Ubuntu. But not on Arch Linux.

Based on stack trace , are you able to identify control flow ?

Otherwise, if you would have some debugging build with tracing information dumped to console, I am more then happy to try it out and post here results from console.

@tronical
Copy link
Member

Perhaps this is a webgl related problem. What graphics card do you have? Does this demo work for you in Chrome? https://mdn.github.io/webgl-examples/tutorial/sample3/

What does https://webglreport.com/ report for your setup?

@gwpl
Copy link
Author

gwpl commented Jan 29, 2022

Screenshot_20220129_183232

Bingo! I am getting "Unable to initialize WebGL. Your browser or machine may not support it".

Maybe good to add to sixtyfps demos/examples/templates error handling code to display error message (webgl or any other failure)?

(and also maybe good to add some fallback canvas rendering in long term?)

@tronical
Copy link
Member

I agree, we should show an alert in that case.

@tronical tronical added the bug Something isn't working label Jan 29, 2022
@gwpl gwpl closed this as completed Jan 29, 2022
@gwpl gwpl reopened this Jan 29, 2022
@ogoffart ogoffart changed the title Demos does not work on Chromium 97.0.4692.99 Arch Linux Wasm demo: Report an error when opengl context cannot be created Nov 29, 2022
@ogoffart
Copy link
Member

The main() of our demo could return a Result<> instead of unwrap'ing the Slint result.
and the entry point of wasm could react to it and do an alert.

@ogoffart ogoffart added priority:low Lowest priority. The issue is kept open for tracking purpose, but noone is actively working on this good first issue Good for newcomers labels Jan 19, 2024
@tronical
Copy link
Member

That would be very nice, indeed! I think for that to work, we need to provide an implementation of Into<JsValue> for PlatformError (at least my local attempt at doing this bails out with this requirement).

We could perhaps have a weak dependency on wasm-bindgen in i-slint-core and then implement it there, but that would imply that wasm-bindgen becomes a public dependency in our API, I guess.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
a:platform-wasm browser integration (mO,bT) bug Something isn't working good first issue Good for newcomers priority:low Lowest priority. The issue is kept open for tracking purpose, but noone is actively working on this
Projects
None yet
Development

No branches or pull requests

3 participants