Skip to content

vello_cpu: Tweak behavior for filter layers with zero clips#1437

Merged
laurenz-canva merged 3 commits into
linebender:mainfrom
laurenz-canva:laurenz/zero_clip_filter_layer
Feb 16, 2026
Merged

vello_cpu: Tweak behavior for filter layers with zero clips#1437
laurenz-canva merged 3 commits into
linebender:mainfrom
laurenz-canva:laurenz/zero_clip_filter_layer

Conversation

@laurenz-canva
Copy link
Copy Markdown
Contributor

Closes #1421. The problematic command trace looks as follows:

image

Using the current logic, when we hit a filter layer followed by PushZeroClip, we simply increase the command index by one. The render range is 4..4, so afterwards we would simply skip to the Filter command that follows PushZeroClip. However, as you can see there still is a PopZeroClip command.

I think the correct behavior is to completely skip all commands of the layer and jump to the very last PopBuf command, which is then executed to ensure the previously pushed (empty) buffer is freed again.

@LaurenzV LaurenzV requested a review from grebmeg February 13, 2026 09:26
Comment thread sparse_strips/vello_cpu/src/dispatch/single_threaded.rs Outdated
@laurenz-canva laurenz-canva added this pull request to the merge queue Feb 16, 2026
Merged via the queue into linebender:main with commit 2a85708 Feb 16, 2026
17 checks passed
@laurenz-canva laurenz-canva deleted the laurenz/zero_clip_filter_layer branch February 16, 2026 12:09
github-merge-queue Bot pushed a commit that referenced this pull request Feb 16, 2026
)

This requires #1437 to be merged first, otherwise the test doesn't pass
properly. But I have verified that this fixes the issue. There were
basically two problems:

1) We were erroneously exiting eagerly in `pop_clip` in case the clip
path has zero strips, causing `push_clip` and `pop_clip` to not be
symmetrical. This meant that if the first scene was rendered improperly,
this inconsistent state could leak into future iterations.
2) We were not properly resetting `n_zero_clips` in Wide.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

vello_cpu: Unreachable code reached

3 participants