Skip to content

TRAANode: Fix previous-depth texture leak - #34873

Merged
Mugen87 merged 2 commits into
mrdoob:devfrom
EdoardoLuciani:fix/traa-depth-texture-lifetime
Oct 8, 2026
Merged

Mugen87 merged 2 commits into
mrdoob:devfrom
EdoardoLuciani:fix/traa-depth-texture-lifetime

Conversation

@EdoardoLuciani

@EdoardoLuciani EdoardoLuciani commented Oct 7, 2026 •

Copy link
Copy Markdown
Contributor

Related issue: -

Description

I noticed that recreating and disposing a TRAA effect on the same renderer leaves one depth texture behind each time, even after disposing the render pipeline and input pass.

Root cause: TRAANode creates a separate 1×1 previous-depth placeholder. updateBefore() replaces its reference with the history render target's depth texture, but the effect never disposes the original placeholder.

Fix: Initialize _previousDepthNode with the history render target's depth texture directly, so the existing render-target lifecycle owns and releases it.

Local validation

  • Three create/render/dispose cycles: retained textures 1 → 2 → 3 before, 0 → 0 → 0 after.
  • First-frame, motion, resize and disposal checks pass; 147 paired captures are pixel-identical across WebGPU/WebGL probes and the TRAA example.
  • Build, lint and core tests pass.

@EdoardoLuciani
EdoardoLuciani marked this pull request as ready for review October 7, 2026 21:05
@Mugen87 Mugen87 added this to the r187 milestone Oct 8, 2026
@Mugen87
Mugen87 merged commit b58697c into mrdoob:dev Oct 8, 2026
9 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