-
Notifications
You must be signed in to change notification settings - Fork 3.5k
Verify that webgl2 is supported before using it #3435
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
Conversation
lib/components/term.js
Outdated
isSupported = gl instanceof window.WebGL2RenderingContext; | ||
if (!isSupported) { | ||
// eslint-disable-next-line no-console | ||
console.warn(`WebGL2 is not supported on your machine. Falling back to canvas-based rendering.`); |
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.
I would move this warning in getTermOptions
where fallback occurs. This is juste a test here.
We can warn if webGL is disabled due to a non-opaque backgroundColor too.
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.
Done!
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.
Sorry, linting issues on push. One sec
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.
Ok, now it's done. I need to set up eslint integration in vim.
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.
thank you! 🙏
Some hardware/drivers seem to not support WebGL2 (now our default renderer) which completely breaks hyper.
Check that webgl2 is supported before using.
This seems to add ~10ms to my startup time, which I think it's acceptable. The alternative being catching an exception in
Terminal.open
and then falling back to canvas.fixes #3433