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

Corruption on some UI elements #7944

Open
AmionSky opened this issue Mar 7, 2023 · 15 comments · Fixed by #9169
Open

Corruption on some UI elements #7944

AmionSky opened this issue Mar 7, 2023 · 15 comments · Fixed by #9169
Labels
A-Rendering Drawing game state to the screen A-UI Graphical user interfaces, styles, layouts, and widgets C-Bug An unexpected or incorrect behavior S-Needs-Investigation This issue requires detective work to figure out what's going wrong

Comments

@AmionSky
Copy link
Contributor

AmionSky commented Mar 7, 2023

Bevy version

v0.10.0 (289fd1d)

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 AmionSky added C-Bug An unexpected or incorrect behavior S-Needs-Triage This issue needs to be labelled labels Mar 7, 2023
@ickk ickk added A-Rendering Drawing game state to the screen A-UI Graphical user interfaces, styles, layouts, and widgets S-Needs-Investigation This issue requires detective work to figure out what's going wrong and removed S-Needs-Triage This issue needs to be labelled labels Mar 7, 2023
@AmionSky
Copy link
Contributor Author

AmionSky commented Apr 2, 2023

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

Screenshot 2023-04-02 145114

@AmionSky
Copy link
Contributor Author

AmionSky commented Apr 2, 2023

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

@nishusb
Copy link

nishusb commented May 22, 2023

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
Copy link

hiibolt commented Jun 21, 2023

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
Copy link

nishusb commented Jun 21, 2023

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
Copy link
Contributor

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

 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
Copy link
Contributor

mahulst commented Jul 3, 2023

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

github-merge-queue bot pushed a commit that referenced this issue Jul 19, 2023
# Objective

Fixes #8894 
Fixes #7944 

## Solution

The UI pipeline's `MultisampleState::count` is set to 1 whereas the
`MultisampleState::count` for the camera's ViewTarget is taken from the
`Msaa` resource, and corruption occurs when these two values are
different.

This PR solves the problem by setting `MultisampleState::count` for the
UI pipeline to the value from the Msaa resource too.

I don't know much about Bevy's rendering internals or graphics hardware,
so maybe there is a better solution than this. UI MSAA was probably
disabled for a good reason (performance?).

## Changelog
* Enabled multisampling for the UI pipeline.
@hymm
Copy link
Contributor

hymm commented Jul 25, 2023

reopening as #9169 was reverted in #9237

@hymm hymm reopened this Jul 25, 2023
@Bogpan
Copy link

Bogpan commented Aug 22, 2023

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
Copy link
Contributor

onkoe commented Nov 26, 2024

Also experiencing this with my lovely font:

Image

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

@hiibolt
Copy link

hiibolt commented Nov 26, 2024

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
Copy link
Contributor

onkoe commented Nov 26, 2024

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

@hiibolt
Copy link

hiibolt commented Nov 26, 2024

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
Copy link

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
Copy link

C-Entropy commented Nov 28, 2024

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-Rendering Drawing game state to the screen A-UI Graphical user interfaces, styles, layouts, and widgets C-Bug An unexpected or incorrect behavior S-Needs-Investigation This issue requires detective work to figure out what's going wrong
Projects
None yet
Development

Successfully merging a pull request may close this issue.

10 participants