bevyengine / bevy

A refreshingly simple data-driven game engine built in Rust
https://bevyengine.org
Apache License 2.0
36.68k stars 3.61k forks source link

Corruption on some UI elements #7944

Open AmionSky opened 1 year ago

AmionSky commented 1 year ago

Bevy version

v0.10.0 (289fd1d0f2353353f565989a2296ed1b442e00bc)

Relevant system information

Rust Stable cargo 1.67.1 (8ecd4f20a 2023-01-10)

SystemInfo { os: "Windows 11 Pro", kernel: "22621", cpu: "AMD Ryzen 5 5600X 6-Core Processor", core_count: "6", memory: "15.9 GiB" }
AdapterInfo { name: "AMD Radeon RX 6750 XT", vendor: 4098, device: 29663, device_type: DiscreteGpu, driver: "AMD proprietary driver", driver_info: "23.2.2 (AMD proprietary shader compiler)", backend: Vulkan }

What you did

Ran some examples like: contributors, blend_modes or game_menu

What went wrong

Some UI elements have some sort of texture corruption?

Additional information

Screenshot 2023-03-07 110831 Screenshot 2023-03-07 111525

In the contributors example it's happening all the time and the corruption is flickering/changing every frame.

In the blend_modes example I have to rotate the camera around to start seeing some corruption and its flickering but without changing the camera angle it does not change.

But could not reproduce it in some examples like in tonemapping

AmionSky commented 1 year ago

Still an issue in 0.10.1 (1c5c94715cb17cda5ae209eef12a938501de90b5) (also ran cargo update)

Screenshot 2023-04-02 145114

AmionSky commented 1 year ago

I re-ran the examples with DX12 and the issue did not appear. It seems like the issue is related to Vulkan.

nishusb commented 1 year ago

image

I'm having the same issue using 0.10.1, and it was also fixed by using DX12.

AdapterInfo { name: "AMD Radeon RX 5600 XT", vendor: 4098, device: 29471, device_type: DiscreteGpu, driver: "AMD proprietary driver", driver_info: "23.4.2 (AMD proprietary shader compiler)", backend: Vulkan }

hiibolt commented 1 year ago

I re-ran the examples with DX12 and the issue did not appear. It seems like the issue is related to Vulkan.

How do you hardcode the engine to use DX12? I'm running into the same issue in the mentioned issue.

nishusb commented 1 year ago

I re-ran the examples with DX12 and the issue did not appear. It seems like the issue is related to Vulkan.

How do you hardcode the engine to use DX12? I'm running into the same issue in the mentioned issue.

When you're adding the default plugins, do this


.add_plugins(
    DefaultPlugins
        .set(RenderPlugin {
            wgpu_settings: bevy::render::settings::WgpuSettings {
                backends: Some(Backends::DX12),
                    ..default()
                }
            })
)
Elabajaba commented 1 year ago

I can't reproduce this on AMD+Windows 11 on either bevy 0.10.1 or bevy main (10f5c9206847ae01b8dc833c2680562e7bd46664).

 SystemInfo { os: "Windows 11 Pro", kernel: "22621", cpu: "AMD Ryzen 9 5900X 12-Core Processor", core_count: "12", memory: "31.9 GiB" }
AdapterInfo { name: "AMD Radeon RX 6800 XT", vendor: 4098, device: 29631, device_type: DiscreteGpu, driver: "AMD proprietary driver", driver_info: "23.5.2 (AMD proprietary shader compiler)", backend: Vulkan }
mahulst commented 1 year ago

With the help of @Elabajaba I installed a bunch of thinks that eventually made it better. But I can't say I understand what the exact fix was.

https://github.com/GPUOpen-Drivers/AMDVLK/releases https://github.com/lutris/docs/blob/master/InstallingDrivers.md

What actually did the trrick in the end was setting the environment variable AMD_VULKAN_ICD=RADV

hymm commented 1 year ago

reopening as #9169 was reverted in #9237

Bogpan commented 1 year ago

The same issue is happening to me with Bevy 0.11.2 on Windows 11 22H2 with an RX 6700 (non XT), using DX12 fixes it.

AdapterInfo { name: "AMD Radeon RX 6700", vendor: 4098, device: 29663, device_type: DiscreteGpu, driver: "", driver_info: "", backend: Vulkan}

onkoe commented 1 week ago

Also experiencing this with my lovely font:

Image

hiibolt commented 6 days ago

Also experiencing this with my lovely font:

Image

  • OS: Windows 10 IoT Enterprise LTSC, 21H2 (19044.5131)
  • Bevy version: 0.11.2
  • rustc version: rustc 1.84.0-nightly (705cfe0e9 2024-11-01)
  • GPU: RX 6750 XT
  • Rendering backend: Vulkan

It’s worth trying a minimal reproducible in a newer version of Bevy, migrating to 0.13 fixed my issue. When I was on 0.11, forcing DX12 as a backend worked too

onkoe commented 6 days ago

I misread Bevy's version number, sorry! I'm currently on 0.14.2 and have updated my comment accordingly.

hiibolt commented 6 days ago

I misread Bevy's version number, sorry! I'm currently on 0.14.2 and have updated my comment accordingly.

I see, thank you! Does your issue persist if you force DX12 as a backend?

C-Entropy commented 4 days ago

I have same issue here I supposed.

uname -a
Linux Gentoo 6.12.1-gentoo #3 SMP PREEMPT_RT Sun Nov 24 11:14:43 CST 2024 x86_64 AMD Ryzen 9 5900HX with Radeon Graphics AuthenticAMD GNU/Linux
bevy version: git log -1
commit 8e284984aa9b6c556b9fcdfec0d7f7df690ad9ac
 rustc --version
rustc 1.82.0 (f6e511eec 2024-10-15)
INFO bevy_render::renderer: AdapterInfo { name: "AMD Radeon RX 6800M", vendor: 4098, device: 29663, device_type: DiscreteGpu, driver: "AMD proprietary driver", driver_info: "(AMD proprietary shader compiler)", backend: Vulkan }

And the crash only happen at the bottom part of the window, unless the window is too small, at when will it spread to all window. Image Image

C-Entropy commented 4 days ago

Tried game_menu from examples, the corruption only happens when the window is too small. Image Image Image

By the way, I'm using Hyprland with Xwayland, and both grid and game_menu are built with wayland enabled.