shinzlet / atomCAD

Mozilla Public License 2.0
0 stars 0 forks source link

`Atoms::reupload_atoms` not allowing size to be changed #3

Open shinzlet opened 1 year ago

shinzlet commented 1 year ago

Atoms::reupload_atoms is supposed to use the existing wgpu buffer and replace its contents. This works for changing or removing atoms, but when the buffer is reallocated to add more atoms, the new atoms are not displayed. (although, as far as I can tell, the reallocation actually works fine). This is likely an issue in BufferVec that I haven't been able to find. The current workaround is to create a new Atoms instance and drop the old buffer.

This is relevant to #2 - reupload_atoms should be called every time the Molecule graph changes to keep the host and gpu in sync, but the workaround is forcing this to always reallocate (in practise, reallocation should be far less common than just reuploading).