Performance of multiple queue.write_texture() calls: single large texture vs. multiple smaller textures? #7994
Unanswered
alexdesander
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hello,
I'm currently working on a 2D renderer and need some advice on efficiently rendering 2D chunks. I have two approaches in mind:
Single Texture per Chunk
Each chunk has its own texture, and I write directly to this texture whenever needed.
Dynamic Texture Atlas (2D Array Texture)
All chunks share one large 2D array texture acting as a dynamic texture atlas. Each chunk has its own allocation, and I write into the appropriate area in the atlas when required.
My renderer might involve many texture writes per frame, but these writes never overlap (no chunk's space is written to more than once per frame).
Considering performance, is approach 1 or approach 2 generally faster in practice with wgpu? Does wgpu internally lock textures when multiple writes occur to the same texture, potentially causing bottlenecks, or can writes to separate textures be effectively parallelized?
Beta Was this translation helpful? Give feedback.
All reactions