Skip to content

Remove cumulative paint layer limit - #790

Open
VladimirKras wants to merge 2 commits into
DioxusLabs:mainfrom
VladimirKras:fix/remove-layer-limit
Open

Remove cumulative paint layer limit#790
VladimirKras wants to merge 2 commits into
DioxusLabs:mainfrom
VladimirKras:fix/remove-layer-limit

Conversation

@VladimirKras

@VladimirKras VladimirKras commented Aug 25, 2026

Copy link
Copy Markdown

Motivation

Dense scenes silently stop emitting requested clip and effect layers once cumulative painting crosses the nominal 1,024-layer limit, so later content is painted with the wrong layer stack and becomes visibly corrupted even when frame rate is healthy. The cap is enforced in backend-independent paint code, so it affects CPU and GPU renderers alike.

Why the cap can be removed

The cap was introduced at 28 in 596d419 as a workaround for Vello #644, then raised to 1,024 in c74b019. Vello fixed the underlying empty-clip encoding bug in Vello #651, merged in August 2024; Blitz now uses Vello 0.10.0, so retaining the old global workaround causes silent data loss without protecting current renderers from that historical bug.

Changes

  • Remove the cumulative layer cap and its now-unused accounting.

Validation

  • cargo test -p blitz-paint --lib
  • cargo clippy -p blitz-paint --no-deps -- -D warnings
  • cargo fmt --all -- --check
  • git diff --check

The workspace Clippy command currently stops on an unrelated existing needless_return warning at packages/blitz-dom/src/mutator.rs:1218 with Rust 1.96.1; the affected crate passes Clippy with dependency linting disabled.

Note

AI-assistance disclosure: this change and PR description were prepared with assistance from Codex/GPT-5 and reviewed by the submitter.

WPT results

No changes in test results compared to main.

Generated by the WPT workflow.

Dense scenes could silently stop emitting requested clip and effect layers after crossing the global limit, corrupting later content. Always preserve the layer stack and cover the previous cutoff with a recording-scene regression test.

Assisted-by: Codex/GPT-5

@nicoburns nicoburns left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems reasonable, but can we ditch the test please.

Vello Classic and Vello Hybrid both still have issues with resource allocation, but this isn't really guarding against it effectively.

@VladimirKras

Copy link
Copy Markdown
Author

Sorry about the useless test. Dropped it.

@VladimirKras
VladimirKras requested a review from nicoburns August 25, 2026 13:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

2 participants