-
Notifications
You must be signed in to change notification settings - Fork 948
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
Dual Source Blending #1804
Comments
This is desired as a feature. See also - gpuweb/gpuweb#391 upstream. |
Hi, i did an attempt at this over at https://github.com/freqmod/wgpu/tree/alt_blend / https://github.com/freqmod/naga/tree/alt_blend . Currently it is working for metal and vulkan. I can submit a PR and help getting this merged, if there are interest to accept the current API or work to make a suitable one. For vulkan the feature must be enabled for the functionality to work without warnings:
Attached is a simple attempt at a fragment shader for rgb subpixel font rendering. It is still a bit wrong, but it shows how to write to the secondary output for blending (inspired by description in https://github.com/servo/webrender/blob/master/webrender/doc/text-rendering.md ),
and the target descriptor:
|
PRs as a next step would be great! I have a couple of comments but it would be easier to leave them on a PR. |
Great. See |
I'd like to be able to use "Dual Source Blending" with wgpu, so that I can perform sub-pixel-AA with alpha blending.
I can see some mention of whether the Metal backend supports this in the code, but I don't see anything more than this so far.
I think that what I'd like to see for this is for BlendFactor to have enum variants representing the second source, and a way to reference that in the shader program.
Is this a lot of work to plumb in and get implemented?
For my purposes, I'm most interested in using wgpu as a way to run against Metal and DX backends as I already have an OpenGL implementation of my renderer.
The text was updated successfully, but these errors were encountered: