makepad/platform/script/src
Kevin Boos baa43c46a3
Animate draw_pass.time shaders on every backend, and repaint only the passes that use them (#1305)
* Shaders: detect `draw_pass.time` reads on every backend

`uses_time` came from searching the generated source for `draw_pass->time`, which only
Metal emits (GLSL and WGSL write `unibuf_draw_pass.time`, HLSL `u_io_draw_pass.f_time`).
So on Android, Linux, Windows and the web a time-driven shader like `LoadingSpinner`
never kept its pass repainting, and it froze whenever nothing else redrew.

The shader compiler now flags the read itself in `handle_field`.

* Repaint only the passes that draw a time-driven shader

A shader reading `draw_pass.time` made `compute_pass_repaint_order` re-dirty every live
pass in every window, so one spinner also re-rendered cached views every frame.
* backends set `CxDrawPass::repaint_next` on the pass they paint (a time shader drawn, or a
  skipped draw that must retry), and only those passes repaint; `demo_time_repaint` now
  just keeps the frame loop awake
* `draw_pass.time` comes from `Cx::pass_time`, whose origin rebases while nothing
  time-driven is on screen, so the f32 stays precise in long-running apps
* closed windows' passes stop repainting, and Android overlays every open popup

* Windows: keep polling while a time-driven pass needs its next frame

The event loop never looked at `demo_time_repaint`, so a `LoadingSpinner` froze right
after its first paint. Both EventFlow decisions now include it, and a tick that presents
nothing because it only painted an offscreen time pass sleeps 8 ms instead of spinning.

* OpenHarmony, hosted Android: keep repainting while a time-driven pass needs its next frame

Neither loop looked at `demo_time_repaint`, so a `LoadingSpinner` froze right after its
first paint: OpenHarmony's vsync handler only repainted when a pass was already dirty, and a
WM-hosted Android child never asked its host for another tick. The hosted child now also
takes `draw_pass.time` from `Cx::pass_time` like every other backend.

* LoadingSpinner: remove the unused `border_size` uniform

The pixel shader never read it (the stroke is `stroke_width`), so setting it did nothing.

* Progress, StatusSpinner: only read the pass clock while something moves

`ProgressBarFlat`/`ProgressRingFlat` read `draw_pass.time` in the same shader as their fill,
and `StatusSpinner` drew its time shader even when quiet or showing a finished mark, so all
of them repainted their pass every frame while nothing moved.
* the shaders read the time through `self.clock()`, and a twin of `draw_bg` with the other
  clock (`draw_sweep` while indeterminate, `draw_still` once a mark has finished) is drawn in
  its place, so only a moving sweep or arc reads the pass clock
* `apply_draw_twin` builds each twin from the applied `draw_bg`, so every override reaches it
* a quiet `StatusSpinner` draws nothing and just keeps its space
2026-10-12 22:39:41 +02:00
..
math_aot platform+widgets: sploded 3D inspect view, the tweaker design-feedback suite, script math-AOT and docs channel, pointer-pin and pixel-probe, modal layout, map warp 2026-08-29 09:26:24 +02:00
apply.rs Add Apply::Rebake so script_mod re-runs stop clobbering imperative state (#1219) 2026-09-05 23:26:03 +02:00
array.rs script: the Octoscript VM hardening -- execution caps, fuel and deadlines, heap/string/array/object limits, parser diagnostics and re-entrant dispatch, keeping a Makepad host's semantics and speed 2026-09-26 20:08:33 +02:00
array_heap.rs script: the Octoscript VM hardening -- execution caps, fuel and deadlines, heap/string/array/object limits, parser diagnostics and re-entrant dispatch, keeping a Makepad host's semantics and speed 2026-09-26 20:08:33 +02:00
clock.rs platform: thread pool, clocks, storage, trace, game input 2026-09-15 13:39:43 +02:00
colorhex.rs First 2.0 2026-02-12 14:52:33 +01:00
docs.rs tweaker + shader const-table: the design-feedback campaign — annotated props, hot-patchable shader constants, animator-state wells, the theme tab, typed editors, undo through anonymous paths 2026-09-01 16:46:26 +02:00
equality.rs script: the Octoscript VM hardening -- execution caps, fuel and deadlines, heap/string/array/object limits, parser diagnostics and re-entrant dispatch, keeping a Makepad host's semantics and speed 2026-09-26 20:08:33 +02:00
function.rs Splash: a host-services bridge for mini-apps, plus three VM/parser fixes (#1181) 2026-08-19 20:06:01 +02:00
gc.rs script: the Octoscript VM hardening -- execution caps, fuel and deadlines, heap/string/array/object limits, parser diagnostics and re-entrant dispatch, keeping a Makepad host's semantics and speed 2026-09-26 20:08:33 +02:00
gen_index.rs Splash isolate host: keep inserted subtrees reachable, survive foreign-heap values, contain isolate panics (#1208) 2026-09-02 02:26:52 +02:00
handle.rs script: the Octoscript VM hardening -- execution caps, fuel and deadlines, heap/string/array/object limits, parser diagnostics and re-entrant dispatch, keeping a Makepad host's semantics and speed 2026-09-26 20:08:33 +02:00
heap.rs script: the Octoscript VM hardening -- execution caps, fuel and deadlines, heap/string/array/object limits, parser diagnostics and re-entrant dispatch, keeping a Makepad host's semantics and speed 2026-09-26 20:08:33 +02:00
json.rs Splash: a host-services bridge for mini-apps, plus three VM/parser fixes (#1181) 2026-08-19 20:06:01 +02:00
key_code.rs platform: faster builds and sturdier runs -- #[derive(Script)] emits one helper call per field, studio-protocol no longer waits for script, an app's package dir, icons and bundle name rebuild only that app, MAKEPAD=gpusim builds again, and a contained panic on macOS no longer frees the windows under AppKit 2026-09-26 20:10:03 +02:00
lib.rs platform: faster builds and sturdier runs -- #[derive(Script)] emits one helper call per field, studio-protocol no longer waits for script, an app's package dir, icons and bundle name rebuild only that app, MAKEPAD=gpusim builds again, and a contained panic on macOS no longer frees the windows under AppKit 2026-09-26 20:10:03 +02:00
mod_gc.rs rustc 1.98 sweep: script module glob imports nothing uses, and strlen declared as libc has it 2026-09-01 17:12:15 +02:00
mod_html.rs Html: fix collapsed details with void tags corrupting table layout (#1222) 2026-09-11 10:54:28 +02:00
mod_math.rs First 2.0 2026-02-12 14:52:33 +01:00
mod_pod.rs draw: geometry, shaders, WGSL, fonts, turtle/layout 2026-09-15 13:39:02 +02:00
mod_regex.rs rustc 1.98 sweep: script module glob imports nothing uses, and strlen declared as libc has it 2026-09-01 17:12:15 +02:00
mod_shader.rs platform: rename the CPU simulated-GPU backend from headless to gpusim 2026-09-15 13:40:28 +02:00
mod_std.rs rustc 1.98 sweep: script module glob imports nothing uses, and strlen declared as libc has it 2026-09-01 17:12:15 +02:00
native.rs script: the Octoscript VM hardening -- execution caps, fuel and deadlines, heap/string/array/object limits, parser diagnostics and re-entrant dispatch, keeping a Makepad host's semantics and speed 2026-09-26 20:08:33 +02:00
numeric.rs First 2.0 2026-02-12 14:52:33 +01:00
object.rs script: the Octoscript VM hardening -- execution caps, fuel and deadlines, heap/string/array/object limits, parser diagnostics and re-entrant dispatch, keeping a Makepad host's semantics and speed 2026-09-26 20:08:33 +02:00
object_heap.rs Faster shader codegen, working shader caches, and no GL repaints for buffer retirement (#1279) 2026-10-02 01:21:31 +02:00
opcode.rs Land platform, studio, and widget infra from rik2. 2026-08-18 14:23:57 +02:00
opcodes.rs script: the Octoscript VM hardening -- execution caps, fuel and deadlines, heap/string/array/object limits, parser diagnostics and re-entrant dispatch, keeping a Makepad host's semantics and speed 2026-09-26 20:08:33 +02:00
opcodes_assign.rs script: the Octoscript VM hardening -- execution caps, fuel and deadlines, heap/string/array/object limits, parser diagnostics and re-entrant dispatch, keeping a Makepad host's semantics and speed 2026-09-26 20:08:33 +02:00
opcodes_calls.rs script: the Octoscript VM hardening -- execution caps, fuel and deadlines, heap/string/array/object limits, parser diagnostics and re-entrant dispatch, keeping a Makepad host's semantics and speed 2026-09-26 20:08:33 +02:00
opcodes_control.rs script: the Octoscript VM hardening -- execution caps, fuel and deadlines, heap/string/array/object limits, parser diagnostics and re-entrant dispatch, keeping a Makepad host's semantics and speed 2026-09-26 20:08:33 +02:00
opcodes_loops.rs script: the Octoscript VM hardening -- execution caps, fuel and deadlines, heap/string/array/object limits, parser diagnostics and re-entrant dispatch, keeping a Makepad host's semantics and speed 2026-09-26 20:08:33 +02:00
opcodes_ops.rs script: the Octoscript VM hardening -- execution caps, fuel and deadlines, heap/string/array/object limits, parser diagnostics and re-entrant dispatch, keeping a Makepad host's semantics and speed 2026-09-26 20:08:33 +02:00
opcodes_slots.rs Land platform, studio, and widget infra from rik2. 2026-08-18 14:23:57 +02:00
opcodes_vars.rs Faster shader codegen, working shader caches, and no GL repaints for buffer retirement (#1279) 2026-10-02 01:21:31 +02:00
parser.rs platform: hosted apps on Android -- every app its own process under the WM, frames handed over with GPU fences, a touch that is taken away is cancelled, hosted children ask the WM for what they cannot do, window crossfades and whole-frame presents, relief-lit textures 2026-09-26 20:09:17 +02:00
pod.rs draw: geometry, shaders, WGSL, fonts, turtle/layout 2026-09-15 13:39:02 +02:00
pod_heap.rs script: the Octoscript VM hardening -- execution caps, fuel and deadlines, heap/string/array/object limits, parser diagnostics and re-entrant dispatch, keeping a Makepad host's semantics and speed 2026-09-26 20:08:33 +02:00
prims.rs platform: Windows and macOS -- every window keeps animating with several open, half-float RGBA textures have four channels, a first-opened popup draws its rows, a texture pass before its window has a size is skipped, desktop apps open no console window, the macOS display link is kept until invalidated, and a hosted child redraws at its tile's new size 2026-09-26 20:09:39 +02:00
regex.rs platform: GPU passes store top-left rows on every backend, hosted apps get software frames as textures, the Android desk renders at 120 Hz, and the platform builds warning-free on every CI target 2026-09-26 20:08:13 +02:00
regex_heap.rs First 2.0 2026-02-12 14:52:33 +01:00
scratch.rs First 2.0 2026-02-12 14:52:33 +01:00
shader.rs Faster shader codegen, working shader caches, and no GL repaints for buffer retirement (#1279) 2026-10-02 01:21:31 +02:00
shader_backend.rs Faster shader codegen, working shader caches, and no GL repaints for buffer retirement (#1279) 2026-10-02 01:21:31 +02:00
shader_builtins.rs platform: rename the CPU simulated-GPU backend from headless to gpusim 2026-09-15 13:40:28 +02:00
shader_calls.rs Faster shader codegen, working shader caches, and no GL repaints for buffer retirement (#1279) 2026-10-02 01:21:31 +02:00
shader_control.rs platform: Windows and macOS -- every window keeps animating with several open, half-float RGBA textures have four channels, a first-opened popup draws its rows, a texture pass before its window has a size is skipped, desktop apps open no console window, the macOS display link is kept until invalidated, and a hosted child redraws at its tile's new size 2026-09-26 20:09:39 +02:00
shader_glsl.rs Faster shader codegen, working shader caches, and no GL repaints for buffer retirement (#1279) 2026-10-02 01:21:31 +02:00
shader_hlsl.rs platform: topic hunks the per-commit assembly could not place, the Sep 2–15 dev PRs (#1208–#1236) as adapted to this tree, and the zero-warning chore 2026-09-15 13:40:33 +02:00
shader_metal.rs platform: topic hunks the per-commit assembly could not place, the Sep 2–15 dev PRs (#1208–#1236) as adapted to this tree, and the zero-warning chore 2026-09-15 13:40:33 +02:00
shader_ops.rs Faster shader codegen, working shader caches, and no GL repaints for buffer retirement (#1279) 2026-10-02 01:21:31 +02:00
shader_output.rs Animate draw_pass.time shaders on every backend, and repaint only the passes that use them (#1305) 2026-10-12 22:39:41 +02:00
shader_tables.rs First 2.0 2026-02-12 14:52:33 +01:00
shader_vars.rs Animate draw_pass.time shaders on every backend, and repaint only the passes that use them (#1305) 2026-10-12 22:39:41 +02:00
shader_wgsl.rs platform: topic hunks the per-commit assembly could not place, the Sep 2–15 dev PRs (#1208–#1236) as adapted to this tree, and the zero-warning chore 2026-09-15 13:40:33 +02:00
string.rs Land platform, studio, and widget infra from rik2. 2026-08-18 14:23:57 +02:00
string_heap.rs script: the Octoscript VM hardening -- execution caps, fuel and deadlines, heap/string/array/object limits, parser diagnostics and re-entrant dispatch, keeping a Makepad host's semantics and speed 2026-09-26 20:08:33 +02:00
suggest.rs script: the Octoscript VM hardening -- execution caps, fuel and deadlines, heap/string/array/object limits, parser diagnostics and re-entrant dispatch, keeping a Makepad host's semantics and speed 2026-09-26 20:08:33 +02:00
test.rs First 2.0 2026-02-12 14:52:33 +01:00
thread.rs script: the Octoscript VM hardening -- execution caps, fuel and deadlines, heap/string/array/object limits, parser diagnostics and re-entrant dispatch, keeping a Makepad host's semantics and speed 2026-09-26 20:08:33 +02:00
tokenizer.rs script: the Octoscript VM hardening -- execution caps, fuel and deadlines, heap/string/array/object limits, parser diagnostics and re-entrant dispatch, keeping a Makepad host's semantics and speed 2026-09-26 20:08:33 +02:00
traits.rs Script derive: reload a field back to its own #[live] default (#1278) 2026-10-03 09:26:30 +02:00
trap.rs splash optimisation work 2026-08-10 13:07:40 +02:00
value.rs platform: hosted apps on Android -- every app its own process under the WM, frames handed over with GPU fences, a touch that is taken away is cancelled, hosted children ask the WM for what they cannot do, window crossfades and whole-frame presents, relief-lit textures 2026-09-26 20:09:17 +02:00
value_map.rs script: the Octoscript VM hardening -- execution caps, fuel and deadlines, heap/string/array/object limits, parser diagnostics and re-entrant dispatch, keeping a Makepad host's semantics and speed 2026-09-26 20:08:33 +02:00
vec_prims.rs widgets/map: retained map renderer, typed streams, gestures 2026-09-15 13:39:37 +02:00
vm.rs Faster shader codegen, working shader caches, and no GL repaints for buffer retirement (#1279) 2026-10-02 01:21:31 +02:00