We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent c399f75 commit 48b37ddCopy full SHA for 48b37dd
1 file changed
webgpu/canvas.py
@@ -31,12 +31,18 @@ def f():
31
debounced.timer = None
32
debounced.t_last = t
33
34
+ if debounced.t_last is None:
35
+ # first call -> just call the function immediately
36
+ debounced.t_last = time.time()
37
+ f()
38
+ return
39
+
40
t_wait = max(1 / target_fps - (time.time() - debounced.t_last), 0)
41
debounced.timer = threading.Timer(t_wait, f)
42
debounced.timer.start()
43
44
- debounced.t_last = time.time()
45
+ debounced.t_last = None
46
return debounced
47
48
if callable(arg):
@@ -61,6 +67,7 @@ class Canvas:
61
67
depth_texture: Texture
62
68
multisample_texture: Texture
63
69
multisample: MultisampleState
70
+ target_texture: Texture
64
71
65
72
width: int = 0
66
73
height: int = 0
0 commit comments