You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+16Lines changed: 16 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -73,6 +73,22 @@ llvmexpr.VkExpr(clip[] clips, string[] expr[, int format, int boundary=0, int nu
73
73
-`num_streams`: Number of concurrent Vulkan streams (default: 8). Increase this for better parallelism if you have a powerful GPU, or decrease it if you run into insufficient vram.
74
74
-`device_id`: Selects which Vulkan physical device to run on (default: -1 = auto).
75
75
76
+
### Multi-Pass Pipeline (VkExpr only)
77
+
78
+
`VkExpr` supports executing multiple expressions sequentially for the same plane, with efficient zero-copy data transfer between them.
79
+
80
+
-**Separator**: Use `##` to separate different stages in the expression string.
81
+
-**Intermediate Access**: Use `bufN` to access the result of the N-th stage (0-indexed). `buf0` is the result of the first expression, `buf1` is the second, and so on. Relative and absolute access for buffers are also supported.
82
+
83
+
**Example:**
84
+
```python
85
+
# Stage 1: x + 0.5 (result stored in buf0)
86
+
# Stage 2: x + buf0 (calculates x + (x[1,1] + 0.5))
87
+
core.llvmexpr.VkExpr(clip, expr="x 0.5 + ## x buf0[1,1] +")
88
+
```
89
+
90
+
Intermediate buffers are stored as `float32` on the GPU, with no clamping / quantization.
91
+
76
92
### `llvmexpr.SingleExpr` (Per-Frame)
77
93
78
94
This function executes an expression only once per frame. It is not suitable for typical image filtering but is powerful for tasks that involve reading from arbitrary coordinates, calculating frame-wide metrics, and writing results to other pixels or to frame properties.
0 commit comments