Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[webgpu] Support WGPUCompositeAlphaMode_Premultiplied #22491

Closed
SergeyLebedkin opened this issue Sep 1, 2024 · 1 comment · Fixed by #22494
Closed

[webgpu] Support WGPUCompositeAlphaMode_Premultiplied #22491

SergeyLebedkin opened this issue Sep 1, 2024 · 1 comment · Fixed by #22494
Assignees
Labels

Comments

@SergeyLebedkin
Copy link

SergeyLebedkin commented Sep 1, 2024

Browsers already supports Premultiplied alpha mode in surface configuration if use JS way to create webgpu context handles.
But emsdk still have it as TODO option.
Please, make it works.

WGPUSurfaceConfiguration surfaceConfiguration {
    .device = device,
    .format = preferredFormat,
    .usage = WGPUTextureUsage_RenderAttachment,
    .alphaMode = WGPUCompositeAlphaMode_Premultiplied, // <-- does not supported
    .width = w,
    .height = h,
    .presentMode = WGPUPresentMode_Fifo,
};
wgpuSurfaceConfigure(surface, &surfaceConfiguration);
@sbc100 sbc100 transferred this issue from emscripten-core/emsdk Sep 3, 2024
@kainino0x
Copy link
Collaborator

Ah... we left this as TODO in #21939 (comment) but forgot to follow up. Thanks for reporting!

I've started trying to fix this.

kainino0x added a commit that referenced this issue Sep 3, 2024
(Note the default HTML template page's canvas has a black background, so
the difference is not visible there.)

Fixes #22491
copybara-service bot pushed a commit to google/dawn that referenced this issue Sep 5, 2024
Port of this Emscripten fix into emdawnwebgpu:
https://github.com/emscripten-core/emscripten/pull/22494/files

Bug: emscripten-core/emscripten#22491
Change-Id: Id3ed385d47ce2045d20e61f31e890a6f459ffb88
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/205075
Reviewed-by: Loko Kung <[email protected]>
Commit-Queue: Kai Ninomiya <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants