Skip to content

Commit 896015a

Browse files
committed
fix: update BaseVectorRenderer and VectorRenderer to use options API
The update() method used the old timestamp-based API instead of the current options-based API. The broken timestamp management caused GPU buffers to be recreated on every render, producing visual noise.
1 parent 76b433f commit 896015a

1 file changed

Lines changed: 3 additions & 10 deletions

File tree

webgpu/vectors.py

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -31,13 +31,8 @@ def __init__(self, label="VectorField"):
3131
super().__init__(label=label)
3232
self.gpu_objects.colormap = Colormap()
3333

34-
def update(self, timestamp):
35-
if timestamp == self._timestamp:
36-
return
37-
self._timestamp = timestamp
38-
39-
self.gpu_objects.colormap.options = self.options
40-
self.gpu_objects.colormap.update(timestamp)
34+
def update(self, options):
35+
pass
4136

4237
def get_bindings(self):
4338
return [
@@ -68,9 +63,7 @@ def __init__(self, points, vectors, size=None, scale_with_vector_length=False):
6863
)
6964
self.size = size or 1 / 10 * np.linalg.norm(self.bounding_box[1] - self.bounding_box[0])
7065

71-
def update(self, timestamp):
72-
super().update(timestamp)
73-
66+
def update(self, options):
7467
self._buffers = {
7568
"points": buffer_from_array(self.points),
7669
"vectors": buffer_from_array(self.vectors),

0 commit comments

Comments
 (0)