Skip to content

Commit

Permalink
rebase fixes for #8109 and #8079
Browse files Browse the repository at this point in the history
  • Loading branch information
Elabajaba committed Mar 22, 2023
1 parent a4204f4 commit 6a0fd31
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 25 deletions.
18 changes: 2 additions & 16 deletions crates/bevy_core_pipeline/src/contrast_adaptive_sharpening/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ use bevy_render::{
renderer::RenderDevice,
texture::BevyDefault,
view::{ExtractedView, ViewTarget},
RenderApp, RenderSet,
Render, RenderApp, RenderSet,
};

mod node;
Expand Down Expand Up @@ -105,21 +105,14 @@ impl Plugin for CASPlugin {
render_app
.init_resource::<CASPipeline>()
.init_resource::<SpecializedRenderPipelines<CASPipeline>>()
.add_system(prepare_cas_pipelines.in_set(RenderSet::Prepare));
.add_systems(Render, prepare_cas_pipelines.in_set(RenderSet::Prepare));
{
let cas_node = CASNode::new(&mut render_app.world);
let mut binding = render_app.world.resource_mut::<RenderGraph>();
let graph = binding.get_sub_graph_mut(core_3d::graph::NAME).unwrap();

graph.add_node(core_3d::graph::node::CONTRAST_ADAPTIVE_SHARPENING, cas_node);

graph.add_slot_edge(
graph.input_node().id,
core_3d::graph::input::VIEW_ENTITY,
core_3d::graph::node::CONTRAST_ADAPTIVE_SHARPENING,
CASNode::IN_VIEW,
);

graph.add_node_edge(
core_3d::graph::node::FXAA,
core_3d::graph::node::CONTRAST_ADAPTIVE_SHARPENING,
Expand All @@ -136,13 +129,6 @@ impl Plugin for CASPlugin {

graph.add_node(core_2d::graph::node::CONTRAST_ADAPTIVE_SHARPENING, cas_node);

graph.add_slot_edge(
graph.input_node().id,
core_2d::graph::input::VIEW_ENTITY,
core_2d::graph::node::CONTRAST_ADAPTIVE_SHARPENING,
CASNode::IN_VIEW,
);

graph.add_node_edge(
core_2d::graph::node::FXAA,
core_2d::graph::node::CONTRAST_ADAPTIVE_SHARPENING,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ use bevy_ecs::prelude::*;
use bevy_ecs::query::QueryState;
use bevy_render::{
extract_component::{ComponentUniforms, DynamicUniformIndex},
render_graph::{Node, NodeRunError, RenderGraphContext, SlotInfo, SlotType},
render_graph::{Node, NodeRunError, RenderGraphContext},
render_resource::{
BindGroup, BindGroupDescriptor, BindGroupEntry, BindingResource, BufferId, Operations,
PipelineCache, RenderPassColorAttachment, RenderPassDescriptor, TextureViewId,
Expand All @@ -29,8 +29,6 @@ pub struct CASNode {
}

impl CASNode {
pub const IN_VIEW: &'static str = "view";

pub fn new(world: &mut World) -> Self {
Self {
query: QueryState::new(world),
Expand All @@ -40,10 +38,6 @@ impl CASNode {
}

impl Node for CASNode {
fn input(&self) -> Vec<SlotInfo> {
vec![SlotInfo::new(CASNode::IN_VIEW, SlotType::Entity)]
}

fn update(&mut self, world: &mut World) {
self.query.update_archetypes(world);
}
Expand All @@ -54,7 +48,7 @@ impl Node for CASNode {
render_context: &mut RenderContext,
world: &World,
) -> Result<(), NodeRunError> {
let view_entity = graph.get_input_entity(Self::IN_VIEW)?;
let view_entity = graph.view_entity();
let pipeline_cache = world.resource::<PipelineCache>();
let sharpening_pipeline = world.resource::<CASPipeline>();
let uniforms = world.resource::<ComponentUniforms<CASUniform>>();
Expand Down
2 changes: 1 addition & 1 deletion examples/3d/fxaa.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ fn main() {
.insert_resource(Msaa::Off)
.add_plugins(DefaultPlugins)
.add_systems(Startup, setup)
.add_systems(Update, toggle_fxaa)
.add_systems(Update, (toggle_fxaa, toggle_sharpening))
.run();
}

Expand Down

0 comments on commit 6a0fd31

Please sign in to comment.