Skip to content

gl.texImage2D and HTMLCanvasElement #257

Open

Description

@stepancar

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?

Activity

  1. stepancar commented on May 13, 2023

    @stepancar
    Author

    @ivanpopelyshev maybe you can suggest anything, thanks!

  2. stepancar commented on May 17, 2023

    @stepancar
    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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions