-
Notifications
You must be signed in to change notification settings - Fork 143
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
Image x/y extend, alpha, nearest neighbor sampling #766
Conversation
This adds support for image extend modes, alpha and nearest neighbor sampling to fine and plumbs support for all through the pipeline.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. I don't know if we need to quantize the alpha down to 8 bits and store it with the other stuff, but okay for now.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this should have a changelog entry.
I'd also like to see some new tests here; these should be very similar to the existing tests, and so should be straightforward. Indeed, one of the tests needs to be updated.
Otherwise, only relatively peripheral concerns.
Thanks for the feedback, Daniel. I'm on vacation and out of town for the next week but I may have some time over the weekend to address all concerns and get this landed. |
@dfrg I took the liberty of updating this branch to fix the merge conflicts and a couple of other things. Feel free to force push and remove my changes if you have others locally that you prefer. |
d7d9e3a
to
ea95012
Compare
Odd that the nearest neighbor snapshot that I generated on my machine is slightly different than the one generated in CI. |
Not a problem. Your changes look good. Thanks for pushing this forward. |
I’ve also noticed inconsistent failures between local tests and CI. I’m not sure how to resolve this properly but I’ll play with this one and see if I can get it to pass as this PR would be nice to land for 0.4. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The border on the left side of the two right images looks off to me. Which platform/GPU did you use to generate these?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
M3 Pro Max laptop, macOS 15.2.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, I’ll test on my M3 in a bit and see if I can reproduce.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So there’s actually a fairly thick border around the entire image and this appears on the previous version as well. Note that this only seems to occur when generating snapshots on macOS. The winit demo is fine on macOS and the snapshots appear as they should on Windows.
I don’t have a lot of time to continue investigating this right now but I’ll come back to it later this week.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Additional data point: on my win11/rtx3070 machine, the COLR snapshot tests fail locally on main even though they pass in CI.
Discussion in office hours yesterday suggests that we should just skip the testing for now. I don't have a Mac to dig into this further myself. I understand that this does occur consistently on macOS (and so that |
Given that this is new functionality (and thus not a regression), I agree that shipping this with a known bug is reasonable. It's the sort of the thing that could likely be fixed in a patch release (if we can work out what's wrong (and it doesn't require a wgpu upgrade I suppose)). |
I suspect this might be a very slight difference in path rendering leading to over-extension of the image. I’ll do some tests to confirm this but in the meantime, I’m fine with disabling these failing tests and merging. |
This adds support for image extend modes, alpha and nearest neighbor sampling to fine and plumbs support for all through the pipeline.
Extend modes with bilinear filtering (bottom right is x repeat and y reflect):
Extend modes with nearest neighbor filtering:
Image alpha: