-
Notifications
You must be signed in to change notification settings - Fork 345
Open
Labels
apiWebGPU APIWebGPU APIapi-milestone-2-202502api issues that were in milestone 2 before we triaged milestone 1 on 2025-02-19api issues that were in milestone 2 before we triaged milestone 1 on 2025-02-19
Milestone
Description
Currently, if you have a PNG or JPG for example, and want to upload it into WebGPU, you must upload through an ImageBitmap (... or a canvas, technically). The basic set of ways to upload are:
- HTMLImageElement -> createImageBitmap -> copyExternalImageToTexture
(Noteimage.decodeis not useful here, because createImageBitmap is already asynchronous, and already expresses the intent that the image must be decoded.) - fetch -> blob -> createImageBitmap -> copyExternalImageToTexture
The core problem is, it's impossible to express the full intent of "I have a URL for an image and I want to copy it into a GPUTexture". The createImageBitmap step in particular cannot know that the goal is to copy the image into a GPUTexture and then throw it away and never use it again, so there's no real way to avoid an extra copy in the middle.
kdashg
Metadata
Metadata
Assignees
Labels
apiWebGPU APIWebGPU APIapi-milestone-2-202502api issues that were in milestone 2 before we triaged milestone 1 on 2025-02-19api issues that were in milestone 2 before we triaged milestone 1 on 2025-02-19