For WebGPU (gpupresent) canvases, I want to propose that the following options (from WebGL) would be unconfigurable and fixed at the following values. I thought we previously agreed on these, but I'm not sure where, and it would have been a VERY long time ago.
alpha: true - In WebGL, alpha:false has significant cost on some platforms because it's necessary to use RGBA instead of RGB, meaning the platform surface/overlay's alpha channel needs to get cleared or guarded against writes. It's possible that we can sidestep this issue in WebGL - perhaps problems that force us to use RGBA won't be present, but I don't think we should bank on it. This may also change the swap chain format to e.g. rgb8unorm, which we don't even have.
premultipliedAlpha: true - Platform surfaces/overlays generally require premultiplied alpha (AFAIK). Unfortunately, this means color values where r>a || g>a || b>a cause undefined compositing results (this is true in WebGL) (but not undefined JS-visible results).
Related: #1408 (comment) for preserveDrawingBuffer
CC cts issue: gpuweb/cts#460
For WebGPU (gpupresent) canvases, I want to propose that the following options (from WebGL) would be unconfigurable and fixed at the following values. I thought we previously agreed on these, but I'm not sure where, and it would have been a VERY long time ago.
alpha: true- In WebGL, alpha:false has significant cost on some platforms because it's necessary to use RGBA instead of RGB, meaning the platform surface/overlay's alpha channel needs to get cleared or guarded against writes. It's possible that we can sidestep this issue in WebGL - perhaps problems that force us to use RGBA won't be present, but I don't think we should bank on it. This may also change the swap chain format to e.g. rgb8unorm, which we don't even have.premultipliedAlpha: true- Platform surfaces/overlays generally require premultiplied alpha (AFAIK). Unfortunately, this means color values wherer>a || g>a || b>acause undefined compositing results (this is true in WebGL) (but not undefined JS-visible results).Related: #1408 (comment) for
preserveDrawingBufferCC cts issue: gpuweb/cts#460