Skip to content

Commit f15c2c7

Browse files
committed
Enable synchronous_pipeline_compilation and disabled PipelinedRenderingPlugin for ambiguity_detection example.
1 parent c61515d commit f15c2c7

File tree

1 file changed

+16
-12
lines changed

1 file changed

+16
-12
lines changed

tests/ecs/ambiguity_detection.rs

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

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

1832
let main_app = app.main_mut();
1933
configure_ambiguity_detection(main_app);
20-
let render_extract_app = app.sub_app_mut(RenderExtractApp);
21-
configure_ambiguity_detection(render_extract_app);
2234

2335
// Ambiguities in the RenderApp are currently allowed.
2436
// Eventually, we should forbid these: see https://github.com/bevyengine/bevy/issues/7386
@@ -36,14 +48,6 @@ fn main() {
3648
0,
3749
"Main app has unexpected ambiguities among the following schedules: \n{main_app_ambiguities:#?}.",
3850
);
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-
);
4751
}
4852

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

0 commit comments

Comments
 (0)