Revert "Fix UI corruption for AMD gpus with Vulkan (#9169)" (#9237)

# Objective

Fixes https://github.com/bevyengine/bevy/issues/9234

re-breaks: The issues that were linked in #9169 

## Solution

Revert the PR that broke tonemapping/postprocessing/etc.

Any passes that are post msaa resolve need to use the main textures, not
the msaa texture.

## Changelog

Idk what to put here since it's a revert.
This commit is contained in:
Elabajaba 2023-07-25 17:15:41 -04:00 committed by GitHub
parent 31f40d5faf
commit 774fb56a67
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 3 additions and 9 deletions

View File

@ -3,7 +3,6 @@ mod render_pass;
use bevy_core_pipeline::{core_2d::Camera2d, core_3d::Camera3d}; use bevy_core_pipeline::{core_2d::Camera2d, core_3d::Camera3d};
use bevy_hierarchy::Parent; use bevy_hierarchy::Parent;
use bevy_render::view::Msaa;
use bevy_render::{ExtractSchedule, Render}; use bevy_render::{ExtractSchedule, Render};
use bevy_window::{PrimaryWindow, Window}; use bevy_window::{PrimaryWindow, Window};
pub use pipeline::*; pub use pipeline::*;
@ -805,7 +804,6 @@ pub fn queue_uinodes(
ui_batches: Query<(Entity, &UiBatch)>, ui_batches: Query<(Entity, &UiBatch)>,
mut views: Query<(&ExtractedView, &mut RenderPhase<TransparentUi>)>, mut views: Query<(&ExtractedView, &mut RenderPhase<TransparentUi>)>,
events: Res<SpriteAssetEvents>, events: Res<SpriteAssetEvents>,
msaa: Res<Msaa>,
) { ) {
// If an image has changed, the GpuImage has (probably) changed // If an image has changed, the GpuImage has (probably) changed
for event in &events.images { for event in &events.images {
@ -831,10 +829,7 @@ pub fn queue_uinodes(
let pipeline = pipelines.specialize( let pipeline = pipelines.specialize(
&pipeline_cache, &pipeline_cache,
&ui_pipeline, &ui_pipeline,
UiPipelineKey { UiPipelineKey { hdr: view.hdr },
hdr: view.hdr,
msaa_samples: msaa.samples(),
},
); );
for (entity, batch) in &ui_batches { for (entity, batch) in &ui_batches {
image_bind_groups image_bind_groups

View File

@ -62,7 +62,6 @@ impl FromWorld for UiPipeline {
#[derive(Clone, Copy, Hash, PartialEq, Eq)] #[derive(Clone, Copy, Hash, PartialEq, Eq)]
pub struct UiPipelineKey { pub struct UiPipelineKey {
pub hdr: bool, pub hdr: bool,
pub msaa_samples: u32,
} }
impl SpecializedRenderPipeline for UiPipeline { impl SpecializedRenderPipeline for UiPipeline {
@ -118,7 +117,7 @@ impl SpecializedRenderPipeline for UiPipeline {
}, },
depth_stencil: None, depth_stencil: None,
multisample: MultisampleState { multisample: MultisampleState {
count: key.msaa_samples, count: 1,
mask: !0, mask: !0,
alpha_to_coverage_enabled: false, alpha_to_coverage_enabled: false,
}, },

View File

@ -72,7 +72,7 @@ impl Node for UiPassNode {
}; };
let mut render_pass = render_context.begin_tracked_render_pass(RenderPassDescriptor { let mut render_pass = render_context.begin_tracked_render_pass(RenderPassDescriptor {
label: Some("ui_pass"), label: Some("ui_pass"),
color_attachments: &[Some(target.get_color_attachment(Operations { color_attachments: &[Some(target.get_unsampled_color_attachment(Operations {
load: LoadOp::Load, load: LoadOp::Load,
store: true, store: true,
}))], }))],