这是indexloc提供的服务,不要输入任何密码
Skip to content

Investigate possible solution for cheaper opaque canvases #1988

@kainino0x

Description

@kainino0x

Tabling #1871 while we get some implementation experience. Here are some options that we should try to get experience with:

Options:

  1. Don't do anything (just keep the compositingAlphaMode: "opaque" we already have, which requires an alpha-clear and can't do so inside an existing render pass).
  2. storeOp: "present" which takes away access immediately at the end of the render pass, and can either clear to 1 at the end of the pass (with a quad) or clear later. Can WebGPU canvas alpha be configured? #1425 (comment)
    • storeOp: "present" which ALWAYS clears to 1 at the end of the pass (regardless of platform), avoiding the extra tracking within command buffers to take away access.
  3. An RGBX texture format that can be used for canvases, that must be used with loadop clear, and either (a) overrides (or validates) the alpha write mask to 0, or (b) overrides (or validates) the blend mode to always write 1.
    • Can have an alternate implementation that modifies the shader instead of the alpha write mask, for hardware that has performance issues with alpha mask (WebGL has seen issues with alpha write mask performance on Intel GPUs).
  4. Allow unportable compositing results, but "good enough for security" (e.g. insert a blank extra compositor layer behind the canvas).

See: #1871, #1425

Metadata

Metadata

Assignees

No one assigned

    Labels

    apiWebGPU APIapi-milestone-2-202502api issues that were in milestone 2 before we triaged milestone 1 on 2025-02-19

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions