Repository navigation
Fixes bug in retouch module w/ blending on - #21457
Merged
Merged
Conversation
Collaborator
Author
|
@TurboGit I set 5.6.1 as a milestone. This is not a fix for a 5.6-itnroduced bug, but it's still a fix nonetheless. It seems reasonable to me, but I am not sure if this is the right call. |
Collaborator
And yes, i agree this would be for 5.6.1 |
Collaborator
Author
|
Thanks, @jenshannoschwalm! Updated accordingly :) |
Collaborator
|
You might even concider to shorten this by using |
Collaborator
Author
|
Done, thanks! |
Member
|
Need a release note, TIA. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The bug
The pixelpipe's fast blend cache (
bcache) caches the focused module'sprocess()output, so that tweaking blend parameters (opacity, blend mask…) can re-blend instantly without re-runningprocess(). Its validity hash,_piece_process_hash, deliberately excludes the blend parameters — and with them, the drawn-mask group.That's correct for ordinary modules, whose drawn mask is a blend mask applied after
process(). But retouch is flaggedIOP_FLAGS_NO_MASKS: its shapes are consumed insideprocess()— the spots drive clone/heal/blur/fill. So when you moved or reshaped a shape:process()output should change.The path is active when blending is engaged, that's the gate (
mask_mode != DISABLED) that turns the bcache on. The non-blending path was already fine:dt_iop_commit_paramsfolds the spot geometry into the main module-output cache hash whenever the module is in focus.The Fix[EDIT: revisited after Hanno's comment see below]In_piece_process_hash, fold the form-group hash into the bcache validity hash forNO_MASKSmodules — mirroring whatdt_iop_commit_paramsalready does for the main cache:Onlyretouch.c(andspots.c) useIOP_FLAGS_NO_MASKS. This keeps the bcache's fast-path for genuine blend-only tweaks (opacity etc. leave the forms unchanged, so the cache still hits), while shape moves/reshapes now correctly invalidate it. It covers both the CPU and OpenCL process paths, since both use this hash.The Fix
Disable the fast-blend cache entirely for
IOP_FLAGS_NO_MASKSmodules by gating it off in_piece_fast_blend— the function that already collects all the cache-eligibility rules:Only
retouch.candspots.cuseIOP_FLAGS_NO_MASKS, so this is precisely scoped to the affected modules. Putting the decision here keeps all fast-cache eligibility rules in one place and means the bcache is never even allocated for these modules — rather than maintaining a validity hash whose only purpose is to force a miss. It covers both the CPU and OpenCL process paths, since both consult_piece_fast_blend.The trade-off: blend-only tweaks (e.g. dragging opacity) on retouch/spots will re-run
process()instead of just re-blending from cache. That's acceptable — these modules have no blend mask, so the fast path bought little, and correctness wins.Without the fix
before.mp4
With the fix
after.mp4
Co-authored with Claude.