pixelpipe: don't convert the pipe input in place for blending - #22326
masterpiga wants to merge 1 commit into
Conversation
For the first processed module, the input can be pipe->input itself, so the in-place conversion to the blend colorspace corrupted the source buffer that every later run reads again. Screen pipes now convert a copy, as they already do for the input transform.
|
First: the issue, it's analysis and the code spots where this commit modifies Yet it comes at a cost and when looking at the
|
There was a problem hiding this comment.
Copilot review overview
🟢 Approval recommended
The only unresolved finding is a non-blocking release-notes nit.
Review effort: Lite
Findings: None
What changed in this PR
Fixes repeated in-place blend colorspace conversion that corrupted screen-pipe previews.
Changes:
- Copies screen-pipe input before blend conversion.
- Applies protection to CPU and OpenCL fallback paths.
- Preserves existing export and thumbnail behavior.
| File | Description |
|---|---|
src/develop/pixelpipe_hb.c |
Adds temporary buffering for screen-pipe blend transforms. Review noted a non-blocking release-notes documentation nit. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Another bug that I stumbled upon while testing flexi masks.
When a module blends in a colorspace other than the one it processes in, the CPU path converts
tmpto the blend colorspace in place. When no input transform was needed,tmpis the input itself, and the code relies on invalidating the cacheline. But for the first processed module the input can bepipe->input(pipe data: fullin-d pipe), which every later run reads again. It stays converted, and each run converts it once more, so the image degrades into false-color garbage. This change makes screen pipes convert a copy instead, as they already do for the input transform. The same fix applies to the OpenCL path's CPU fallback. Export and thumbnail pipes keep the in-place conversion: they run once.To reproduce: open a small TIFF, enable blending on exposure with the blend colorspace set to Lab, then trigger a second preview run, for example by moving a mask shape. The navigation thumbnail turns into saturated bands while the center view stays correct. Tested in the GUI with these steps.
Co-authored with Claude.