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