Create a frame-graph task that rebuilds pyramid from source() into the FRAME command encoder each frame.
Order it right after the pass that produces the depth (e.g. addTaskAfter(scene, task, depthPrepassTask)) so
the pyramid reflects THIS frame's depth. Resize the pyramid to the source's size before the frame is recorded
(the source depth target only changes size on a canvas resize).
Create a frame-graph task that rebuilds
pyramidfromsource()into the FRAME command encoder each frame. Order it right after the pass that produces the depth (e.g.addTaskAfter(scene, task, depthPrepassTask)) so the pyramid reflects THIS frame's depth. Resize the pyramid to the source's size before the frame is recorded (the source depth target only changes size on a canvas resize).