vello_gpu: Do not optimize away transparent draws - #1966
Merged
Merged
Conversation
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.
LaurenzV
self-requested a review
October 1, 2026 06:46
laurenz-canva
force-pushed
the
filter-transparent-draws
branch
from
October 1, 2026 08:52
7075bb4 to
17e8380
Compare
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
approved these changes
Oct 1, 2026
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.
vello_gpuskips 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, whilevello_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_painttest 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.