lastSwapchainColorTexture method

Texture? lastSwapchainColorTexture([
  1. int viewIndex = 0
])

The color texture most recently issued for viewIndex (the previous frame's output once the next frame begins), or null before the first frame or after a resize.

Sampling it from a material creates a one-frame feedback loop, the scene's own output appearing inside the scene. The ring guarantees the returned texture is not the one being rendered this frame, so reading it while the current frame draws is safe.

Implementation

gpu.Texture? lastSwapchainColorTexture([int viewIndex = 0]) =>
    _view(viewIndex)._lastIssued;