Skip to content

refactor: Document frame pass ownership and flag destroyed pass reuse - #9787

Merged
mvaligursky merged 1 commit into
mainfrom
mv-pass-ownership-rule
Oct 16, 2026
Merged

mvaligursky merged 1 commit into
mainfrom
mv-pass-ownership-rule

Conversation

@mvaligursky

Copy link
Copy Markdown
Contributor

Documents who owns a frame pass, makes every frame pass call the base destroy(), and reports in debug builds a destroyed pass added to the frame.

Changes:

  • The ownership rule is documented: a pass owns only what it creates. It does not destroy its render target, nor its before and after passes, and the camera does not destroy the passes in its frame passes, before passes or after passes. Whoever adds a pass destroys it, once.
  • The destroy() of all frame passes now calls the base destroy(), which ten of them did not.
  • In debug builds, adding a destroyed pass to the frame reports an error, once. The check is stripped from release builds.

Document who owns a frame pass: a pass owns only what it creates. It
does not destroy its render target, nor its before and after passes,
and the camera does not destroy its frame passes, before passes or after
passes. Whoever adds a pass destroys it, once.

The destroy of all frame passes now calls the base destroy, which ten of
them did not. The base destroy marks the pass as destroyed in debug
builds, and adding a destroyed pass to the frame reports an error, once.
Both are stripped from release builds.
@github-actions

Copy link
Copy Markdown

Build size report

This PR changes the size of the minified bundles.

Bundle Minified Gzip Brotli
playcanvas.min.js 2664.5 KB (+160 B, +0.01%) 690.9 KB (+22 B, +0.00%) 535.7 KB (−522 B, −0.10%)
playcanvas.min.mjs 2661.3 KB (+160 B, +0.01%) 689.6 KB (+18 B, +0.00%) 535.3 KB (−55 B, −0.01%)

@mvaligursky
mvaligursky merged commit f8a0540 into main Oct 16, 2026
11 checks passed
@mvaligursky
mvaligursky deleted the mv-pass-ownership-rule branch October 16, 2026 20:29

This branch was successfully deployed

2 active deployments
Preview – engine — 1cdd05d9 Deployed Oct 16, 2026 by vercel[bot]
Preview – engine-api-docs — 1cdd05d9 Deployed Oct 16, 2026 by vercel[bot]
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.

1 participant