- 
          
- 
                Notifications
    You must be signed in to change notification settings 
- Fork 4.2k
Closed
Labels
A-RenderingDrawing game state to the screenDrawing game state to the screenA-UIGraphical user interfaces, styles, layouts, and widgetsGraphical user interfaces, styles, layouts, and widgetsC-BugAn unexpected or incorrect behaviorAn unexpected or incorrect behavior
Description
Bevy version
Relevant system information
Tested on MacOS and iOS, with 4x MSAA
What you did
I used UiCameraConfig to enable show_ui on only one pass that was not the last pass (using camera priority.)
What went wrong
The UI did not show, but I could see it was being rendered using the Metal debugger.
Additional information
I suspected that the wrong color attachment was being used, so that the rendered UI was accidentally discarded.
So I made the following changes:
diff --git a/crates/bevy_ui/src/render/pipeline.rs b/crates/bevy_ui/src/render/pipeline.rs
index e199cef52..7914d3b8f 100644
--- a/crates/bevy_ui/src/render/pipeline.rs
+++ b/crates/bevy_ui/src/render/pipeline.rs
@@ -105,7 +105,7 @@ impl SpecializedRenderPipeline for UiPipeline {
             },
             depth_stencil: None,
             multisample: MultisampleState {
-                count: 1,
+                count: 4,
                 mask: !0,
                 alpha_to_coverage_enabled: false,
             },
diff --git a/crates/bevy_ui/src/render/render_pass.rs b/crates/bevy_ui/src/render/render_pass.rs
index 66445c92a..9308b7a26 100644
--- a/crates/bevy_ui/src/render/render_pass.rs
+++ b/crates/bevy_ui/src/render/render_pass.rs
@@ -81,14 +81,10 @@ impl Node for UiPassNode {
         };
         let pass_descriptor = RenderPassDescriptor {
             label: Some("ui_pass"),
-            color_attachments: &[Some(RenderPassColorAttachment {
-                view: &target.view,
-                resolve_target: None,
-                ops: Operations {
-                    load: LoadOp::Load,
-                    store: true,
-                },
-            })],
+            color_attachments: &[Some(target.get_color_attachment(Operations {
+                load: LoadOp::Load,
+                store: true,
+            }))],
             depth_stencil_attachment: None,
         };and it works as expected now, but it's probably not necessary to use MSAA for the UI, so I'm not sure what the correct way to do this is. Obviously hardcoding the multisample count is a bad idea; it would have to be passed through the key if this is actually the correct solution.
rotoclone, bardt and vabrador
Metadata
Metadata
Assignees
Labels
A-RenderingDrawing game state to the screenDrawing game state to the screenA-UIGraphical user interfaces, styles, layouts, and widgetsGraphical user interfaces, styles, layouts, and widgetsC-BugAn unexpected or incorrect behaviorAn unexpected or incorrect behavior