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

gl.texImage2D and HTMLCanvasElement #257

Open
stepancar opened this issue May 13, 2023 · 2 comments
Open

gl.texImage2D and HTMLCanvasElement #257

stepancar opened this issue May 13, 2023 · 2 comments

Comments

@stepancar
Copy link

stepancar commented May 13, 2023

Hello!
gl.texImage2D supports HTMLCanvasElement

In browser it works instantly , because under the hood they avoid moving data GPU -> CPU -> GPU

In headless gl implementation we see that in order to upload canvas to webgl it reads pixels from 2d context and then uploads it webgl

throw new TypeError('texImage2D(GLenum, GLint, GLenum, GLint, GLenum, GLenum, ImageData | HTMLImageElement | HTMLCanvasElement | HTMLVideoElement)')

Is it possible to speed it up somehow using just webgl?

@stepancar
Copy link
Author

@ivanpopelyshev maybe you can suggest anything, thanks!

@stepancar
Copy link
Author

If I understand correctly, we could create shared textures using EGL and pass them between contexts

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant