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

Add opaque region or isOpaque hint #1871

@rmader

Description

@rmader

This is a follow up on #1425 / #1474

IIUC the now introduced GPUSwapChainAlphaMode=opaque hint can have overhead depending on the implementation, as the implementation has e.g. fill alpha values etc. As already pointed out in #1425 (comment), many OSs, including MacOS[1], Android, Wayland[2], X11[3] and maybe Windows allow clients to provide a hint of the form "please composite this assuming the alpha channel is actually all 1, with undefined results if it's not.". These are usually realized either as a region (Wayland/X11) or as single boolean for a surface (MacOS).

Such a opt-in flag should allow to save a canvas size blit on many implementations, by skipping any blending. Most importantly it would move the responsibility to the client: provide content in an easy to optimize way and you become faster.

As this kind of hint has been well established in OS compositors and is available to native clients, I think we should have an equivalent in WebGPU as well.

cc: @kvark, @magcius


1: https://developer.apple.com/documentation/appkit/nsview/1483558-isopaque
2: https://wayland.freedesktop.org/docs/html/apa.html#protocol-spec-wl_surface -> set_opaque_region
3: https://specifications.freedesktop.org/wm-spec/wm-spec-latest.html#idm46291029692400

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