Skip to content

Render layers to offscreen textures and composite them as a last step of rendering #39

@Kethku

Description

@Kethku

Doing this has a couple benefits:

  1. The textures can be retained and only rerendered if we detect that a layer has actually changed.
  2. Clip masks can be applied at the composite step rather than by primitive which may be faster
  3. 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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions