@@ -8,17 +8,29 @@ use bevy::{
8
8
ecs:: schedule:: { InternedScheduleLabel , LogLevel , ScheduleBuildSettings } ,
9
9
platform:: collections:: HashMap ,
10
10
prelude:: * ,
11
- render:: pipelined_rendering:: RenderExtractApp ,
11
+ render:: { pipelined_rendering:: PipelinedRenderingPlugin , RenderPlugin } ,
12
12
} ;
13
13
14
14
fn main ( ) {
15
15
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
+ ) ;
17
31
18
32
let main_app = app. main_mut ( ) ;
19
33
configure_ambiguity_detection ( main_app) ;
20
- let render_extract_app = app. sub_app_mut ( RenderExtractApp ) ;
21
- configure_ambiguity_detection ( render_extract_app) ;
22
34
23
35
// Ambiguities in the RenderApp are currently allowed.
24
36
// Eventually, we should forbid these: see https://github.com/bevyengine/bevy/issues/7386
@@ -36,14 +48,6 @@ fn main() {
36
48
0 ,
37
49
"Main app has unexpected ambiguities among the following schedules: \n {main_app_ambiguities:#?}." ,
38
50
) ;
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
- ) ;
47
51
}
48
52
49
53
/// Contains the number of conflicting systems per schedule.
0 commit comments