Skip to content
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

Weird Transparency glitch on Intel Integrated Graphics #11

Open
EriKWDev opened this issue Aug 24, 2022 · 13 comments
Open

Weird Transparency glitch on Intel Integrated Graphics #11

EriKWDev opened this issue Aug 24, 2022 · 13 comments

Comments

@EriKWDev
Copy link

EriKWDev commented Aug 24, 2022

image

Running on main branch's example. Getting reported info:

> cargo run --release --example example
MESA-INTEL: warning: Performance support disabled, consider sysctl dev.i915.perf_stream_paranoid=0
Using device: Intel(R) Xe Graphics (TGL GT2) (type: IntegratedGpu)
@derivator
Copy link
Owner

Looks a bit like #3. Are you running Wayland by any chance? You can check by running echo $XDG_SESSION_TYPE in terminal.

@EriKWDev
Copy link
Author

EriKWDev commented Aug 25, 2022

Indeed wayland.

> echo $XDG_SESSION_TYPE
wayland

Running on Fedora 36, with 5.18.18-200.fc36.x86_64 #1 SMP PREEMPT_DYNAMIC Wed Aug 17 16:02:04 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux

@derivator
Copy link
Owner

The common factors between #3 and this seem to be Wayland and Intel GPU. @Vistavleal suggested that xWayland might also be involved somehow, but they were unfortunately not in a position to try on x11. Meanwhile I could not reproduce this on Wayland/NVidia GPU. @EriKWDev could you test on x11?

@EriKWDev
Copy link
Author

Getting the same on x11 actually:
image

> echo $XDG_SESSION_TYPE
x11

Seems like Intel Integrated Graphics might be the problem then.

@derivator
Copy link
Owner

Can you try running some of the vulkano examples and see if they have similar problems? If those work, then I have a suspicion: In #10 @Wicpar said that egui_vulkano currently does some things that are actually forbidden by the vulkan spec, which Vulkano 0.30 checks and rejects. It could be that the NVidia driver quietly fixes up the incorrect usage, whereas the Intel driver doesn't do that and just happily corrupts GPU memory instead. Maybe try his Vulkano 0.30 branch and see if that fixes it?

@EriKWDev
Copy link
Author

EriKWDev commented Aug 26, 2022

I don't really knew what to look for, but I cloned vulkano and ran the run_all script in the examples directory and (after some compilation torture to my poor laptop) they all look fine to me (wayland):

image
image
image
image
image
image

I also tried out the main branch of @Wicpar's fork with vulkano 0.30 on wayland I got the following runtime error:

Available layer: VK_LAYER_VALVE_steam_overlay_32
Available layer: VK_LAYER_VALVE_steam_overlay_64
Available layer: VK_LAYER_VALVE_steam_fossilize_32
Available layer: VK_LAYER_VALVE_steam_fossilize_64
Available layer: VK_LAYER_RENDERDOC_Capture
Available layer: VK_LAYER_MESA_device_select
thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: LayerNotPresent', examples/example.rs:64:8
stack backtrace:
   0: rust_begin_unwind
             at /rustc/e092d0b6b43f2de967af0887873151bb1c0b18d3/library/std/src/panicking.rs:584:5
   1: core::panicking::panic_fmt
             at /rustc/e092d0b6b43f2de967af0887873151bb1c0b18d3/library/core/src/panicking.rs:142:14
   2: core::result::unwrap_failed
             at /rustc/e092d0b6b43f2de967af0887873151bb1c0b18d3/library/core/src/result.rs:1785:5
   3: example::main

(link to line in fork: https://github.com/Wicpar/egui_vulkano/blob/02ca7f81df42ace9577f5c669e42d76b56c8112c/examples/example.rs#L60)

@derivator
Copy link
Owner

You can change this line:
enabled_layers: vec!["VK_LAYER_KHRONOS_validation".into()],
to
enabled_layers: vec![],

That should allow you to run the fork.

@EriKWDev
Copy link
Author

Eureka! On wayland using the fork:

image

I now no longer see a triangle though, but haven't read th eexample enough yet to see if it was removed.

@derivator
Copy link
Owner

Thanks for testing! That seems to support my theory. The triangle is behind the gui, because at some point the egui example changed to fill the whole screen and I haven't bothered to change it 😄

@EriKWDev
Copy link
Author

EriKWDev commented Aug 26, 2022

Very nice to get it working though!

Would be nice to get that fork merged :)

Would also be nice to see a Vulkan texture be rendered into an egui Image in the/an example!

But I suppose that's just supplying the image with an egui::TextureId::User(_) with a Vulkan texture handle..?

I will also be trying to get this working with glfw instead of winit since winit takes so long to compile...

Thanks for the awesome work and help debugging!

@derivator
Copy link
Owner

I do plan on merging it, but haven't gotten around to it yet. Would be interesting to see if you can get it running with glfw.

@EriKWDev
Copy link
Author

EriKWDev commented Aug 26, 2022

Will base it on this implementation https://github.com/cohaereo/egui_glfw_gl

Will write on this repo if I succeed!
Might become an egui_glfw crate like the egui_winit..

@EriKWDev
Copy link
Author

Was a bit more struggle than I first though. Vulkano seems to use ash whereas the vulkan feature of the glfw crate produces types compatible with vk-sys... Have to find some conversions to and from the types. Previous attempts seem dead but parts of them can probably be of use https://github.com/atwupack/vulkan4rust, https://gitlab.com/braxtons12/vulkano-glfw-v2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants