-
Notifications
You must be signed in to change notification settings - Fork 313
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
Show a dialog if WebGPU isn't available or there's an error #423
Conversation
I'm not against this but my gut says this seems further from showing WebGPU? What about something like
Then the code shows more straight forward WebGPU in the example. You can still check if That won't handle the case when asking for limits, features though. |
100% agree, I had some similar thoughts in the evening after I posted this. I think I can come up with something but it will have to wait a little bit. |
8c9df57
to
211370f
Compare
This won't catch JS exceptions in the middle of the actual sample, but it at least shows a nice message when WebGPU is not available for some reason, or there's an error (the browser doesn't support the sample).
Finally revised this - PTAL |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
just random comments
-
does it need a button?
The user clicks 'OK' for what purpose? I'm not saying to remove the button. Maybe the fact that it has one makes them more likely to read the message.
-
not getting an adapter doesn't technically mean WebGPU is not available on this system. Compat for example, and in the future
fl2
. I can't think of a simple message though it's probably best as is.
Not super necessary, but sometimes there will be an error yet the sample keeps working - for example the reversedZ sample does this in Firefox right now. Also if some error comes up in an interactive demo like samplerParameters, it could be useful to dismiss it and change the settings back to the mode that didn't have an error.
Good point, I'll tweak it a little. |
This won't catch JS exceptions in the middle of the actual sample, but it at least shows a nice message when WebGPU is not available for some reason, or there's a validation error (usually because the browser doesn't support the sample).
I would like to catch JS exceptions but it would be a bit more complicated. Thinking of just registering an onunhandledrejection handler and wrapping each sample in a
(async () => { ... })()
but that's a bit silly.Anyway what do you think of this - is the DOM stuff too heavy handed for a sample util?