Code panics when setting up a bind group #4189
-
I'm very new to doing GPU programming, so there could be something that I'm doing that is obviously wrong. But, a quick setup. I'm creating an add-on in Blender using Rust and WGPU to calculate rig weight assignments by treating the rig's bones as heaters and heating a voxel grid. This works when I do everything on the CPU, but I want to see if I can get better performance on the GPU (I believe the answer is yes, and I want to learn GPU computing so I see this as a win-win). I'm getting a panic when I try to bind the textures to a bind group. More information (including code snippet) here: https://gist.github.com/scott-wilson/a2407f9c828ef7ce32562e7852e6a217 I'd appreciate any help I can get on this. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 5 replies
-
Could you post the error you're getting? |
Beta Was this translation helpful? Give feedback.
I don't think you need to map that buffer at creation at all. It's recieving data.
You've got it flipped. Mapping allows cpu access of a buffer, by saying "allow me access once the GPU is done". The unmap operation is handing the ownership back to the GPU. Mapping does not modify the contents of the buffer at all, outside of what you explicitly change on the CPU while it's mapped.