Possibility of gpu-side pixel buffer
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 2.1k
- Forks
- 147
- Avg merge
- 12m
- Merged PRs (30d)
- 1
Description
I am currently working on implementing cellular automata and similar things while learning rust and wgpu.
Simulation on the cpu is already working for me and pixels was a big help for me since I didn't need to put any consideration whatsoever on the graphics aspect. So big thanks for this awesome crate!
But the next step is doing the computation on the gpu to enable large simulations like these.
At the moment it's necessary to have separate buffers on the gpu for the computation, then mapping the buffers to be read by the cpu to update the pixel buffer of pixels which then copies the pixel buffer back to the gpu side texture on rendering.
Directly updating the texture is not possible either, since the .render-with- method (and by extension the .render- method) override the texture with the cpu-side pixel buffer.
It would be awesome if it were possible to specify a pixel buffer on the gpu which then gets used by pixels or request pixels itself to use a gpu-side pixel buffer and expose that to the user.
This would allow users to use pixels for what it does best, rendering pixel perfect graphics, while using the most appropriate buffer location for the specific application.
As an alternative pixels could also expose a method which renders the texture without first copying the pixel buffer to it. In that case it would be conveniant to also be able to query the necessary TextureView to be able to use the copy_buffer_to_texture- method of the CommandEncoder of wgpu.
Thank you for your work!
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by examining the .render-with and .render entry points and how they copy the CPU-side pixel buffer into the rendering texture. Compare the requested GPU-side pixel buffer and no-copy rendering alternatives, then define completion as allowing GPU computation to render without mapping data back to the CPU first.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- computer-graphics
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 25/100