mirror of
https://github.com/thorvg/thorvg.git
synced 2025-06-14 12:04:29 +00:00
wg_engine: Enable premultiplied canvas on browser
Emscripten 3.1.66 includes support for WebGPU's premultiplied canvas.
Surface configurations have been updated with premultiplied alpha mode to support this feature.
see: c82a307c61
This commit is contained in:
parent
9f43039403
commit
fbe6d59c04
1 changed files with 6 additions and 3 deletions
|
@ -322,12 +322,15 @@ bool WgRenderer::target(WGPUSurface surface, uint32_t w, uint32_t h) {
|
|||
.device = mContext.device,
|
||||
.format = mContext.preferredFormat,
|
||||
.usage = WGPUTextureUsage_RenderAttachment,
|
||||
#ifdef __EMSCRIPTEN__
|
||||
.alphaMode = WGPUCompositeAlphaMode_Premultiplied,
|
||||
#endif
|
||||
.width = w, .height = h,
|
||||
#ifdef __EMSCRIPTEN__
|
||||
#ifdef __EMSCRIPTEN__
|
||||
.presentMode = WGPUPresentMode_Fifo,
|
||||
#else
|
||||
#else
|
||||
.presentMode = WGPUPresentMode_Immediate
|
||||
#endif
|
||||
#endif
|
||||
};
|
||||
wgpuSurfaceConfigure(surface, &surfaceConfiguration);
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue