Doing this has a couple benefits:
- The textures can be retained and only rerendered if we detect that a layer has actually changed.
- Clip masks can be applied at the composite step rather than by primitive which may be faster
- Transparency effects like blurring can be done at composite time rather than by primitive which simplifies things and removes the need to copy to the offscreen texture between primitive draws.
To pull this off and get the full benefit we will need to track layer changes probably by diffing them or introducing a way to indicate whether a layer has actually changed at the api level. Text rendering will also have to change as we wont be able to composite directly and will have to store the text alphas separately using something like https://wgpu.rs/doc/wgpu/struct.Features.html#associatedconstant.MULTIVIEW.