Skip to content

Commit c8dcac1

Browse files
committed
docs(effects): the write-time check leaves the main thread in #1202
The spec and rendering-performance said checkShaderEffect compiles on the calling thread; #1202 now runs it on the libuv pool.
1 parent 80a3db1 commit c8dcac1

2 files changed

Lines changed: 3 additions & 4 deletions

File tree

‎docs/shader-effects.md‎

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -719,9 +719,8 @@ qu'on n'a pas écrit.
719719
| Vue live contre MP4 (BT.709), image entière | 3,1 / 255 avec effet, 3,0 sans |
720720
| Vue live contre MP4, sur les pixels où l'effet agit | 13 à 16 / 255 avec effet, 14 à 16 sans effet sur les mêmes pixels : le bruit du codec sur des bords nets |
721721

722-
La compilation, dix fois plus lente qu'avec FXC, reste hors du rendu. `checkShaderEffect`, lui,
723-
compile sur le thread qui l'appelle : le processus principal y passe ces 120 ms à chaque code
724-
neuf.
722+
La compilation, dix fois plus lente qu'avec FXC, reste hors du rendu. Elle tourne aussi à
723+
l'écriture (`checkShaderEffect`), d'où le pool de libuv plutôt que le thread principal (D.4).
725724

726725
Le détail est dans
727726
[rendering-performance.md](../technical-documentation/engineering/rendering-performance.md).

‎technical-documentation/engineering/rendering-performance.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -462,7 +462,7 @@ An agent-written effect (`crates/compositor/src/shader_fx.rs`, [docs/shader-effe
462462
- **About 0.12 ms per read at 1080p and 0.5 ms at 4K,** over a fixed 0.3 ms: thirty times the RTX. The fixed part is the copy into `ann_copy` and the full-frame pass, which are bandwidth on a 68 GB/s unified memory.
463463
- **The reads dominate here too.** The bench effect computes a `sin` and a `cos` per read; with integer offsets instead, 128 reads cost 10.5 ms rather than 16.2.
464464
- **naga's `force_loop_bounding` is off** (`shader_fx::to_msl`): its guard, a `volatile` read per iteration, cost 7 to 10 % of every row above. The validation has already proved each loop bounded.
465-
- **Compiling is ten times slower than FXC.** naga, `new_library_with_source` and the pipeline state take 120 ms in the median for a source Metal has not seen (the C.6 ripple), and 160 to 375 ms for the first one in a process. A source Metal has seen comes back in 0.4 ms in the same process, 3 ms in another. All of it runs on the background thread; the preview shows the effect once it lands. `checkShaderEffect` compiles on the calling thread, so an agent's `addEffect` took 152 ms through the `mcp` CLI.
465+
- **Compiling is ten times slower than FXC.** naga, `new_library_with_source` and the pipeline state take 120 ms in the median for a source Metal has not seen (the C.6 ripple), and 160 to 375 ms for the first one in a process. A source Metal has seen comes back in 0.4 ms in the same process, 3 ms in another. All of it runs on the background thread; the preview shows the effect once it lands. An agent's `addEffect` took 152 ms through the `mcp` CLI, the compile included.
466466
- **The export does not notice an effect:** 180 frames at 1752×1080 (`exportMulti`, three alternated runs after a warm-up) took 2469 ms without, 2428 ms with the ripple over the whole video, and 2375 ms with the spike's heavier effect. The M1 export is encoder-bound. The live view held 29.7 fps against a 30 fps source with and without the effect.
467467
- **Not measured yet:** the Radeon 610M and the wgpu pass.
468468

0 commit comments

Comments
 (0)