Skip to content

Commit 66333d4

Browse files
committed
update vectors only when needs update
1 parent 42a61be commit 66333d4

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

webgpu/vectors.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,13 @@ def __init__(self, points, vectors, size=None, scale_with_vector_length=False):
6363
)
6464
self.size = size or 1 / 10 * np.linalg.norm(self.bounding_box[1] - self.bounding_box[0])
6565

66+
def create_vector_data(self):
67+
pass
68+
6669
def update(self, options):
70+
if not self.needs_update:
71+
return
72+
self.create_vector_data()
6773
self._buffers = {
6874
"points": buffer_from_array(self.points),
6975
"vectors": buffer_from_array(self.vectors),

0 commit comments

Comments
 (0)