-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Extend WgpuSetup, egui_kittest now prefers software rasterizers for testing
#5506
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
Conversation
|
Preview available at https://egui-pr-preview.github.io/pr/5506-configurable-test-renderer |
|
I refactored how the snapshots are rendered in #5539, introducing a new |
|
My attempts to try out software rasterizing on Dx12 ran into a recent wgpu regression, took me quite a while |
db45bfa to
d28dd8b
Compare
WgpuSetup, make egui_kittest wgpu setup configurable & prefer software rasterizers for testingWgpuSetup, make egui_kittest now prefers software rasterizers for testing
b4c2d05 to
a837994
Compare
de49f75 to
cc96c1e
Compare
cc96c1e to
b973ffd
Compare
| let backends = if let WgpuSetup::CreateNew(create_new) = &config.wgpu_setup { | ||
| create_new.instance_descriptor.backends | ||
| } else { | ||
| wgpu::Backends::all() |
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'm a lil bit uneasy about this actually. Requesting adapters for all backends when the user already settled on one has the potential to waste a lot of startup time. But I didn't want to break the list of adapters we provide.
Should reconsider this in the future.
WgpuSetup, make egui_kittest now prefers software rasterizers for testingWgpuSetup, egui_kittest now prefers software rasterizers for testing
|
I gave this a try on windows to see if the snapshot tests would work, they all seem fine, except for the rendering test, where the snapshot fails in the linear gradient section (but only at a scale of 1.0, for some reason): Screen.Recording.2025-01-08.at.13.22.55.movI had to increase the threshold to 15.0 for the test to succeed. But this test is also failing on master, so it's not related to the software rasterizer. Also, logging the AdapterInfo it is choosing vulkan over dx12, meaning it doesn't use the dx12 software rasterizer. I guess this would be fixed by gfx-rs/wgpu#6843? |
Yep. That's fixed there, tried that locally :) |
lucasmerlin
left a comment
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.
Looks great!
WgpuSetupis now a lot more powerful:egui_kittestnow uses this to prefer software rasterizers when possible.Sidenote:
request_adapter'sforce_fallback_adapteris not exposed since it will fail if there's no software rasterizer around (which is unfortunately the regular state of things on Mac). Since it also doesn't have any effect on WebGPU (unlike power preference!), I removed it again fromWgpuSetupas it doesn't seem to be all that useful in general to me 🤷TODO:
InstanceDescriptorthings, like instance flags / validation options!Harness::new_eframeandTestRenderertrait #5539 (comment)