hakolao/egui_winit_vulkano

Font artifacts on Radeon RX 5700

Closed this issue · 17 comments

OS: Arch Linux
egui_winit_vulkano version: 0.17.0
Graphics card: Radeon RX 5700 (Free driver + vulkan-radeon)

I'm currently observing color artifacts with label/button fonts when using RX 5700, yet the issue does not reproduce on Ryzen 4700U's integrated GPU.

GUI is setup with is_overlay = false and I used minimal.rs as an example.

I'm not sure if this is the correct crate to open the issue, but I don't really know whether the issue is in the integration or in egui itself.

Here are two screenshots for comparison, first one taken from RX 5700 test, second one from Ryzen 4700U IGPU
photo_RX5700
photo_Ryzen4700U

Are you using the crates version or the newest master branch? (Havent bumped the version number yet).

if it’s not the master branch one, do you see the issue there too?

Hard to say though. I’d need to figure out a way to reproduce it.

Does it happen on any other integration? E.g https://github.com/emilk/egui/tree/master/egui-wgpu just to see if it seems specific to my integration.

Just tested master egui_winit_vulkano with its Cargo.toml revision of vulkano libs, same issue. Did not yet test egui with wgpu backend, as my project is developed using vulkano as a backend.

Some fonts work, but only the label + buttons not?

No, all the components with text I tested so far have this issue

I was thinking that the wgpu integration test could help pinpoint if it’s vulkan (you can select vulkan backend with it) or egui. And then if it does not show there, then it’s probably bug in this integration.

Anyway, I can try to see tomorrow if I can find out probable causes

Tried https://github.com/hasenbanck/egui_example, works fine. Still not sure if I am doing something wrong in my setup with vulkano.
Thanks for looking into this issue!

Would you be able to attempt with the branch from #17. Let me know if it changes anything for you. It might not...

Just tried, unfortunately, did not help

Also, the button texture itself seems fine, it's only fonts that get these artifacts. So I think, there might be some problem with TTF stuff specific to my setup. I will try to experiment with different fonts to see if that changes anything

Alright!

I seem to have found the likely cause of the problem: with RX 5700, my output format is A2R10G10B10 (sRGB), whereas with Ryzen 4700U IGPU it's B8G8R8A8. I also noticed that other egui integration libraries do some sRGB-specific conversions in their shaders, so doing the same thing might actually fix the problem.

Want to try a fix? :)

Sure. I'll try to port shaders from other crates and see if it fixes the problem

I merged the little PR anyway, as I had been thinking of doing that earlier, even though it did nothing to address this issue. I added also a new example to run the egui_demo_app so it's better to check everything works correct if you end up fixing this

This issue should then be resolved, other than the SRGB conversions. I might have to try if I can find a consistent solution to that.

Let me know if you run into anything else!