Skip to content

vello_gpu: Do not optimize away transparent draws - #1966

Merged
LaurenzV merged 4 commits into
linebender:mainfrom
AdrianEddy:filter-transparent-draws
Oct 1, 2026
Merged

LaurenzV merged 4 commits into
linebender:mainfrom
AdrianEddy:filter-transparent-draws

Conversation

@AdrianEddy

Copy link
Copy Markdown
Contributor

vello_gpu skips draws whose solid paint is fully transparent, since they normally can't change the output. That doesn't hold under a filter: a flood fills the drawn geometry whatever its paint, and a color matrix with an alpha offset (#1765) can make transparent pixels visible. The skip happens before the inline filter layer is pushed or the draw is recorded into an enclosing filter layer, so on the GPU such a draw disappears, while vello_cpu, which doesn't skip transparent draws, renders it.

This keeps transparent draws while a filter is active, meaning an inline filter effect or any open filter layer. Outside of filters nothing changes.

The new filter_flood_transparent_paint test floods a fully transparent rect, once in a filter layer and once with an inline filter effect. On main the CPU variants pass and the GPU variant renders nothing.

Found in the review of #1765.

This PR was generated by Claude.

Draws with a fully transparent solid paint were skipped before the inline
filter layer was pushed or the draw was recorded into an enclosing filter
layer. A filter can make that geometry visible (a flood fills it, a color
matrix can add an alpha offset), so the draw disappeared on the GPU while
vello_cpu, which never skips it, rendered it. Only skip transparent draws
when no filter is active.
@laurenz-canva
laurenz-canva force-pushed the filter-transparent-draws branch from 7075bb4 to 17e8380 Compare October 1, 2026 08:52
@LaurenzV LaurenzV changed the title vello_gpu: Keep transparent draws while a filter is active vello_gpu: Do not optimize away transparent draws Oct 1, 2026
@LaurenzV

LaurenzV commented Oct 1, 2026

Copy link
Copy Markdown
Collaborator

Thanks! We've decided it's easier to simply not optimize away transparent draws. This was introduced in #998, but the original failure seems to have disappeared already.

@LaurenzV
LaurenzV added this pull request to the merge queue Oct 1, 2026
Merged via the queue into linebender:main with commit c7269fb Oct 1, 2026
17 checks passed
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.

2 participants