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).
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 inBufferVec
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).