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
Does compositingAlphaMode affect using the canvas as an image source? #1847
Comments
Actually I'm not sure which makes more sense.
|
Or two separate flags, |
Another side note: recent additions to the spec mean that webgpu canvases can't be both composited and used as image sources at the same time. So on macOS, where we have to clear the alpha channel to get the "opaque" compositing behavior, we do have the opportunity to do so without affecting |
Meeting update: This should be blocked on #1988 |
#1988 is post-V1. What is the tacit resolution candidate for this? |
We don't have a proposal yet, I just put that label to indicate that editors should discuss and look for a solution we can propose. Specifically, I want to attempt to unblock this on #1988, just define the behavior and keep the API open for future improvements. |
More specifically, the spec actually says you can't use already-composited results as an image source:
and we need to make sure that's OK because I'm pretty sure it resolves this issue. |
If we add a way to read back the "display buffer" (presented image), then compositingAlphaMode would need to affect the result of that readback (on all platforms for consistency) because some platforms have to clear the alpha channel to 1.0 for presentation. |
I think we have conclusion in this issue that we don't apply |
It's not concluded yet because I need to make a proposal for #2743. I think the solution there is going to necessitate compositingAlphaMode affecting drawImage/toDataURL/etc. |
Changes compositingAlphaMode to just alphaMode, because it now affects the canvas as an image source (drawImage/toDataURL/etc.) as well as compositing. Fixes gpuweb#2743 Fixes gpuweb#1847 Fixes a leftover bit from gpuweb#2373 (placeholder canvases)
Changes compositingAlphaMode to just alphaMode, because it now affects the canvas as an image source (drawImage/toDataURL/etc.) as well as compositing. Fixes gpuweb#2743 Fixes gpuweb#1847 Fixes a leftover bit from gpuweb#2373 (placeholder canvases)
Changes compositingAlphaMode to just alphaMode, because it now affects the canvas as an image source (drawImage/toDataURL/etc.) as well as compositing. Fixes gpuweb#2743 Fixes gpuweb#1847 Fixes a leftover bit from gpuweb#2373 (placeholder canvases)
This allows drawImage/toDataURL/etc. to see the canvas contents presented in the previous frame, as long as getCurrentTexture (or configure/unconfigure) hasn't been called yet this frame. alphaMode (née compositingAlphaMode) now affects using the canvas as an image source (drawImage/etc.) as well as compositing, so that the observed contents don't change on a frame boundary. As a weird aside (necessary to fully define the image source behavior), defines super-luminant values as being in the extended color space (i.e. once un-premultiplied). This definition emerges naturally, but it's also weird. Fixes gpuweb#2743 Fixes gpuweb#1847 Fixes a leftover bit from gpuweb#2373 (placeholder canvases)
* Allow reading back from canvases after present This allows drawImage/toDataURL/etc. to see the canvas contents presented in the previous frame, as long as getCurrentTexture (or configure/unconfigure) hasn't been called yet this frame. alphaMode (née compositingAlphaMode) now affects using the canvas as an image source (drawImage/etc.) as well as compositing, so that the observed contents don't change on a frame boundary. As a weird aside (necessary to fully define the image source behavior), defines super-luminant values as being in the extended color space (i.e. once un-premultiplied). This definition emerges naturally, but it's also weird. Fixes #2743 Fixes #1847 Fixes a leftover bit from #2373 (placeholder canvases) * nit * Remove the "cancel present" behavior of destroy() This fixes several problems: - Unnecessary complexity in how currentTexture logic works. - Errors in the previous commit, where this was just not fully handled. - Using the "destroyed" state on the content process (minor issue). * nits * nit
* Allow reading back from canvases after present This allows drawImage/toDataURL/etc. to see the canvas contents presented in the previous frame, as long as getCurrentTexture (or configure/unconfigure) hasn't been called yet this frame. alphaMode (née compositingAlphaMode) now affects using the canvas as an image source (drawImage/etc.) as well as compositing, so that the observed contents don't change on a frame boundary. As a weird aside (necessary to fully define the image source behavior), defines super-luminant values as being in the extended color space (i.e. once un-premultiplied). This definition emerges naturally, but it's also weird. Fixes gpuweb#2743 Fixes gpuweb#1847 Fixes a leftover bit from gpuweb#2373 (placeholder canvases) * nit * Remove the "cancel present" behavior of destroy() This fixes several problems: - Unnecessary complexity in how currentTexture logic works. - Errors in the previous commit, where this was just not fully handled. - Using the "destroyed" state on the content process (minor issue). * nits * nit
In #1839 we spec the behavior of reading from WebGPU canvases from other APIs, but we need to clarify whether compositingAlphaMode affects those.
My initial feeling is that the answers to both should be yes. In that case we should also probably rename compositingAlphaMode to something like canvasAlphaMode.The text was updated successfully, but these errors were encountered: