Fix UI corruption for AMD gpus with Vulkan#9169
Merged
mockersf merged 2 commits intobevyengine:mainfrom Jul 19, 2023
Merged
Conversation
…. I know very little about Bevy's rendering internals but this seems to be caused by MSAA. Multisampling is disabled for the UI pipeline but is enabled for the camera's ViewTarget, and this seems to cause some conflict. This commit fixes the corruption issues by enabling MSAA for the UiPipeline.
Contributor
|
Feels like an issue with either wgpu or drivers... |
Contributor
|
Is this related: |
Contributor
Author
Seems like it. The corruption has only been observed on a subset of AMD cards using the Vulkan backend and official AMD drivers (on both Windows and Linux, OS doesn't seem to make a difference):
Didn't reproduce on:
|
Contributor
Author
#5721 doesn't look like it's directly related to the corruption bugs, but this PR should fix that issue too. |
mockersf
approved these changes
Jul 17, 2023
Contributor
|
#5752 is already fixed. IIRC, it was fixed by disabling MSAA on UI. Let me check this PR doesn't introduce a regression. |
nicopap
approved these changes
Jul 17, 2023
Contributor
|
Tested with the Minimal reproducible example from #7012 and I don't see a regression, nice! |
Contributor
|
This seems to have broken bloom. edit: It also broke tonemapping. |
Elabajaba
added a commit
to Elabajaba/bevy
that referenced
this pull request
Jul 22, 2023
This was referenced Jul 25, 2023
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Objective
Fixes #8894
Fixes #7944
Solution
The UI pipeline's
MultisampleState::countis set to 1 whereas theMultisampleState::countfor the camera's ViewTarget is taken from theMsaaresource, and corruption occurs when these two values are different.This PR solves the problem by setting
MultisampleState::countfor 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