Skip to content

What is the best way to download pictures from webgpu? #202

Answered by greggman
ouzhou asked this question in Q&A
Discussion options

You must be logged in to vote

There a no built in way to copy "any" texture ot a blob. You have to do it yourself.

The most efficent way to take any texture to a PNG for some defintion of any would be

  1. use copyTextureToTexture to copy from that texture to a canvas texture then canvas toBlob.

    You can only do this if both texture are the canvas texture are the same format

  2. use a compute shader to copy from that texture to a canvas texture then cavnas toBlob

Replies: 1 comment 4 replies

Comment options

You must be logged in to vote
4 replies
@ouzhou
Comment options

@greggman
Comment options

@ouzhou
Comment options

@greggman
Comment options

Answer selected by ouzhou
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants