What does write_texture()'s "size" parameter do? #2497
-
I'm building a wrapper around wgpu for a project and ran into something I was curious about: So Device::create_texture() creates a texture, and the descriptor requires you to provide a If I can't find any of this information in the documentation, so I'd love if someone who knew could share. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
It's so that you can write to only part of the texture! You can use the origin field of the image copy and the size, to form a rectangle that you want to write data to. If either size or origin cause the box to overrun the texture, there will be a validation error. We'd love for this documentation to be improved, PRs accepted :) |
Beta Was this translation helpful? Give feedback.
It's so that you can write to only part of the texture! You can use the origin field of the image copy and the size, to form a rectangle that you want to write data to.
If either size or origin cause the box to overrun the texture, there will be a validation error.
We'd love for this documentation to be improved, PRs accepted :)