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 · 9 comments · Fixed by #9169
Open

Corruption on some UI elements #7944

AmionSky opened this issue Mar 7, 2023 · 9 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}

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.

8 participants