Skip to content

Commit 120de76

Browse files
committed
Enable synchronous_pipeline_compilation and disabled PipelinedRenderingPlugin for ambiguity_detection example.
1 parent 826d917 commit 120de76

File tree

1 file changed

+17
-12
lines changed

1 file changed

+17
-12
lines changed

tests/ecs/ambiguity_detection.rs

Lines changed: 17 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -8,17 +8,30 @@ use bevy::{
88
ecs::schedule::{InternedScheduleLabel, LogLevel, ScheduleBuildSettings},
99
platform::collections::HashMap,
1010
prelude::*,
11-
render::pipelined_rendering::RenderExtractApp,
11+
render::RenderPlugin,
1212
};
13+
use bevy_render::pipelined_rendering::PipelinedRenderingPlugin;
1314

1415
fn main() {
1516
let mut app = App::new();
16-
app.add_plugins(DefaultPlugins);
17+
app.add_plugins(
18+
DefaultPlugins
19+
.build()
20+
.set(RenderPlugin {
21+
// llvmpipe driver can cause segfaults when aborting the binary while pipelines are being
22+
// compiled (which happens very quickly in this example since we only run for a single
23+
// frame). Synchronous pipeline compilation helps prevent these segfaults as the
24+
// rendering thread blocks on these pipeline compilations.
25+
synchronous_pipeline_compilation: true,
26+
..Default::default()
27+
})
28+
// We also have to disable pipelined rendering to ensure the test doesn't end while the
29+
// rendering frame is still executing in another thread.
30+
.disable::<PipelinedRenderingPlugin>(),
31+
);
1732

1833
let main_app = app.main_mut();
1934
configure_ambiguity_detection(main_app);
20-
let render_extract_app = app.sub_app_mut(RenderExtractApp);
21-
configure_ambiguity_detection(render_extract_app);
2235

2336
// Ambiguities in the RenderApp are currently allowed.
2437
// Eventually, we should forbid these: see https://github.com/bevyengine/bevy/issues/7386
@@ -36,14 +49,6 @@ fn main() {
3649
0,
3750
"Main app has unexpected ambiguities among the following schedules: \n{main_app_ambiguities:#?}.",
3851
);
39-
40-
// RenderApp is not checked here, because it is not within the App at this point.
41-
let render_extract_ambiguities = count_ambiguities(app.sub_app(RenderExtractApp));
42-
assert_eq!(
43-
render_extract_ambiguities.total(),
44-
0,
45-
"RenderExtract app has unexpected ambiguities among the following schedules: \n{render_extract_ambiguities:#?}",
46-
);
4752
}
4853

4954
/// Contains the number of conflicting systems per schedule.

0 commit comments

Comments
 (0)