| 1 |
--- |
| 2 |
title: "Expose system accesses and filters in BRP `schedule.graph`" |
| 3 |
pull_requests: [24743] |
| 4 |
--- |
| 5 |
|
| 6 |
`bevy_dev_tools::SystemData` added fields `filtered_accesses` |
| 7 |
|
| 8 |
For example, |
| 9 |
|
| 10 |
```rs |
| 11 |
pub fn prepare_atmosphere_probe_components( |
| 12 |
probes: Query<(Entity, &AtmosphereEnvironmentMapLight), (Without<AtmosphereEnvironmentMap>,)>, |
| 13 |
mut commands: Commands, |
| 14 |
mut images: ResMut<Assets<Image>>, |
| 15 |
) |
| 16 |
``` |
| 17 |
|
| 18 |
Generates the below from `schedule.graph` in BRP. |
| 19 |
|
| 20 |
Note the values in `reads`, etc., are indexes into `components` array. |
| 21 |
|
| 22 |
```json |
| 23 |
{ |
| 24 |
"jsonrpc": "2.0", |
| 25 |
"id": 1, |
| 26 |
"result": { |
| 27 |
"schedule_data": { |
| 28 |
"name": "Update", |
| 29 |
"systems": [ |
| 30 |
{ |
| 31 |
"name": "bevy_pbr::atmosphere::environment::prepare_atmosphere_probe_components", |
| 32 |
"apply_deferred": false, |
| 33 |
"deferred": true, |
| 34 |
"exclusive": false, |
| 35 |
"filtered_accesses": [ |
| 36 |
{ |
| 37 |
"access": { |
| 38 |
"archetypal": [], |
| 39 |
"reads": [ |
| 40 |
3 // AtmosphereEnvironmentMapLight |
| 41 |
], |
| 42 |
"reads_inverted": false, |
| 43 |
"writes": [], |
| 44 |
"writes_inverted": false |
| 45 |
}, |
| 46 |
"filter_sets": [ |
| 47 |
{ |
| 48 |
"with": [ |
| 49 |
3 // AtmosphereEnvironmentMapLight |
| 50 |
], |
| 51 |
"without": [ |
| 52 |
4, // Disabled |
| 53 |
6 // AtmosphereEnvironmentMap |
| 54 |
] |
| 55 |
} |
| 56 |
] |
| 57 |
}, |
| 58 |
{ |
| 59 |
"access": { |
| 60 |
"archetypal": [], |
| 61 |
"reads": [ |
| 62 |
2 // Assets<Image> |
| 63 |
], |
| 64 |
"reads_inverted": false, |
| 65 |
"writes": [ |
| 66 |
2 // Assets<Image> |
| 67 |
], |
| 68 |
"writes_inverted": false |
| 69 |
}, |
| 70 |
"filter_sets": [ |
| 71 |
{ |
| 72 |
"with": [ |
| 73 |
0, // IsResource |
| 74 |
2 // Assets<Image> |
| 75 |
], |
| 76 |
"without": [] |
| 77 |
} |
| 78 |
] |
| 79 |
} |
| 80 |
] |
| 81 |
}, |
| 82 |
... |
| 83 |
], |
| 84 |
"components": [ |
| 85 |
{ |
| 86 |
"name": "bevy_ecs::resource::IsResource", |
| 87 |
"required": [] |
| 88 |
}, |
| 89 |
{ |
| 90 |
"name": "bevy_ui_widgets::dialog::DialogStack", |
| 91 |
"required": [ |
| 92 |
0 |
| 93 |
] |
| 94 |
}, |
| 95 |
{ |
| 96 |
"name": "bevy_asset::assets::Assets<bevy_image::image::Image>", |
| 97 |
"required": [ |
| 98 |
0 |
| 99 |
] |
| 100 |
}, |
| 101 |
{ |
| 102 |
"name": "bevy_light::probe::AtmosphereEnvironmentMapLight", |
| 103 |
"required": [] |
| 104 |
}, |
| 105 |
{ |
| 106 |
"name": "bevy_ecs::entity_disabling::Disabled", |
| 107 |
"required": [] |
| 108 |
}, |
| 109 |
{ |
| 110 |
"name": "bevy_render::sync_world::SyncToRenderWorld", |
| 111 |
"required": [] |
| 112 |
}, |
| 113 |
{ |
| 114 |
"name": "bevy_pbr::atmosphere::environment::AtmosphereEnvironmentMap", |
| 115 |
"required": [ |
| 116 |
5 |
| 117 |
] |
| 118 |
}, |
| 119 |
... |
| 120 |
], |
| 121 |
... |
| 122 |
} |
| 123 |
} |
| 124 |
} |
| 125 |
``` |