Skip to content

Commit ffecb05

Browse files
committed
Replace old renderer with new renderer (#3312)
This makes the [New Bevy Renderer](#2535) the default (and only) renderer. The new renderer isn't _quite_ ready for the final release yet, but I want as many people as possible to start testing it so we can identify bugs and address feedback prior to release. The examples are all ported over and operational with a few exceptions: * I removed a good portion of the examples in the `shader` folder. We still have some work to do in order to make these examples possible / ergonomic / worthwhile: #3120 and "high level shader material plugins" are the big ones. This is a temporary measure. * Temporarily removed the multiple_windows example: doing this properly in the new renderer will require the upcoming "render targets" changes. Same goes for the render_to_texture example. * Removed z_sort_debug: entity visibility sort info is no longer available in app logic. we could do this on the "render app" side, but i dont consider it a priority.
1 parent de8edd3 commit ffecb05

File tree

329 files changed

+4545
-30634
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

329 files changed

+4545
-30634
lines changed

.github/workflows/ci.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -242,13 +242,13 @@ jobs:
242242
sed -i "s|PATH_TO_CHANGE|$curr|" vk_swiftshader_icd.json;
243243
- name: Build bevy
244244
run: |
245-
cargo build --no-default-features --features "bevy_dynamic_plugin,bevy_gilrs,bevy_gltf,bevy_wgpu,bevy_winit,render,png,hdr,x11,bevy_ci_testing"
245+
cargo build --no-default-features --features "bevy_dynamic_plugin,bevy_gilrs,bevy_gltf,bevy_winit,render,png,hdr,x11,bevy_ci_testing"
246246
- name: Run examples
247247
run: |
248248
for example in .github/example-run/*.ron; do
249249
example_name=`basename $example .ron`
250250
echo "running $example_name - "`date`
251-
time CI_TESTING_CONFIG=$example VK_ICD_FILENAMES=$(pwd)/vk_swiftshader_icd.json DRI_PRIME=0 xvfb-run cargo run --example $example_name --no-default-features --features "bevy_dynamic_plugin,bevy_gilrs,bevy_gltf,bevy_wgpu,bevy_winit,render,png,hdr,x11,bevy_ci_testing"
251+
time CI_TESTING_CONFIG=$example VK_ICD_FILENAMES=$(pwd)/vk_swiftshader_icd.json DRI_PRIME=0 xvfb-run cargo run --example $example_name --no-default-features --features "bevy_dynamic_plugin,bevy_gilrs,bevy_gltf,bevy_winit,render,png,hdr,x11,bevy_ci_testing"
252252
sleep 10
253253
done
254254

Cargo.toml

+19-123
Original file line numberDiff line numberDiff line change
@@ -13,20 +13,12 @@ repository = "https://github.com/bevyengine/bevy"
1313

1414
[workspace]
1515
exclude = ["benches", "crates/bevy_ecs_compile_fail_tests"]
16-
members = ["crates/*", "pipelined/*", "examples/ios", "tools/ci", "errors"]
16+
members = ["crates/*", "examples/ios", "tools/ci", "errors"]
1717

1818
[features]
1919
default = [
2020
"bevy_audio",
21-
"bevy_core_pipeline",
2221
"bevy_gilrs",
23-
"bevy_gltf2",
24-
"bevy_wgpu",
25-
"bevy_sprite2",
26-
"bevy_render2",
27-
"bevy_pbr2",
28-
"bevy_ui2",
29-
"bevy_text2",
3022
"bevy_winit",
3123
"render",
3224
"png",
@@ -39,9 +31,11 @@ default = [
3931
# Force dynamic linking, which improves iterative compile times
4032
dynamic = ["bevy_dylib"]
4133

42-
# Rendering support (Also needs the bevy_wgpu feature or a third-party rendering backend)
34+
# Rendering support
4335
render = [
36+
"bevy_internal/bevy_core_pipeline",
4437
"bevy_internal/bevy_pbr",
38+
"bevy_internal/bevy_gltf",
4539
"bevy_internal/bevy_render",
4640
"bevy_internal/bevy_sprite",
4741
"bevy_internal/bevy_text",
@@ -50,20 +44,16 @@ render = [
5044

5145
# Optional bevy crates
5246
bevy_audio = ["bevy_internal/bevy_audio"]
47+
bevy_core_pipeline = ["bevy_internal/bevy_core_pipeline"]
48+
bevy_render = ["bevy_internal/bevy_render"]
49+
bevy_text = ["bevy_internal/bevy_text"]
50+
bevy_pbr = ["bevy_internal/bevy_pbr"]
51+
bevy_sprite = ["bevy_internal/bevy_sprite"]
5352
bevy_dynamic_plugin = ["bevy_internal/bevy_dynamic_plugin"]
5453
bevy_gilrs = ["bevy_internal/bevy_gilrs"]
5554
bevy_gltf = ["bevy_internal/bevy_gltf"]
56-
bevy_wgpu = ["bevy_internal/bevy_wgpu"]
5755
bevy_winit = ["bevy_internal/bevy_winit"]
5856

59-
bevy_core_pipeline = ["bevy_internal/bevy_core_pipeline"]
60-
bevy_render2 = ["bevy_internal/bevy_render2"]
61-
bevy_sprite2 = ["bevy_internal/bevy_sprite2"]
62-
bevy_pbr2 = ["bevy_internal/bevy_pbr2"]
63-
bevy_gltf2 = ["bevy_internal/bevy_gltf2"]
64-
bevy_ui2 = ["bevy_internal/bevy_ui2"]
65-
bevy_text2 = ["bevy_internal/bevy_text2"]
66-
6757
trace_chrome = ["bevy_internal/trace_chrome"]
6858
trace_tracy = ["bevy_internal/trace_tracy"]
6959
trace = ["bevy_internal/trace"]
@@ -120,10 +110,6 @@ path = "examples/hello_world.rs"
120110
name = "contributors"
121111
path = "examples/2d/contributors.rs"
122112

123-
[[example]]
124-
name = "mesh"
125-
path = "examples/2d/mesh.rs"
126-
127113
[[example]]
128114
name = "many_sprites"
129115
path = "examples/2d/many_sprites.rs"
@@ -144,60 +130,35 @@ path = "examples/2d/sprite_sheet.rs"
144130
name = "text2d"
145131
path = "examples/2d/text2d.rs"
146132

147-
[[example]]
148-
name = "text2d_pipelined"
149-
path = "examples/2d/text2d_pipelined.rs"
150-
151133
[[example]]
152134
name = "texture_atlas"
153135
path = "examples/2d/texture_atlas.rs"
154136

155-
[[example]]
156-
name = "pipelined_texture_atlas"
157-
path = "examples/2d/pipelined_texture_atlas.rs"
158-
159137
# 3D Rendering
160138
[[example]]
161139
name = "3d_scene"
162140
path = "examples/3d/3d_scene.rs"
163141

164142
[[example]]
165-
name = "3d_scene_pipelined"
166-
path = "examples/3d/3d_scene_pipelined.rs"
167-
168-
[[example]]
169-
name = "many_cubes_pipelined"
170-
path = "examples/3d/many_cubes_pipelined.rs"
171-
172-
[[example]]
173-
name = "cornell_box_pipelined"
174-
path = "examples/3d/cornell_box_pipelined.rs"
143+
name = "lighting"
144+
path = "examples/3d/lighting.rs"
175145

176146
[[example]]
177147
name = "load_gltf"
178148
path = "examples/3d/load_gltf.rs"
179-
required-features = ["bevy_gltf"]
180149

181150
[[example]]
182-
name = "load_gltf_pipelined"
183-
path = "examples/3d/load_gltf_pipelined.rs"
151+
name = "many_cubes"
152+
path = "examples/3d/many_cubes.rs"
184153

185154
[[example]]
186155
name = "msaa"
187156
path = "examples/3d/msaa.rs"
188157

189-
[[example]]
190-
name = "msaa_pipelined"
191-
path = "examples/3d/msaa_pipelined.rs"
192-
193158
[[example]]
194159
name = "orthographic"
195160
path = "examples/3d/orthographic.rs"
196161

197-
[[example]]
198-
name = "orthographic_pipelined"
199-
path = "examples/3d/orthographic_pipelined.rs"
200-
201162
[[example]]
202163
name = "parenting"
203164
path = "examples/3d/parenting.rs"
@@ -207,46 +168,25 @@ name = "pbr"
207168
path = "examples/3d/pbr.rs"
208169

209170
[[example]]
210-
name = "pbr_pipelined"
211-
path = "examples/3d/pbr_pipelined.rs"
212-
213-
[[example]]
214-
name = "render_to_texture"
215-
path = "examples/3d/render_to_texture.rs"
216-
217-
[[example]]
218-
name = "shadow_biases_pipelined"
219-
path = "examples/3d/shadow_biases_pipelined.rs"
171+
name = "shadow_biases"
172+
path = "examples/3d/shadow_biases.rs"
220173

221174
[[example]]
222-
name = "shadow_caster_receiver_pipelined"
223-
path = "examples/3d/shadow_caster_receiver_pipelined.rs"
224-
225-
[[example]]
226-
name = "spawner"
227-
path = "examples/3d/spawner.rs"
175+
name = "shadow_caster_receiver"
176+
path = "examples/3d/shadow_caster_receiver.rs"
228177

229178
[[example]]
230179
name = "texture"
231180
path = "examples/3d/texture.rs"
232181

233-
[[example]]
234-
name = "texture_pipelined"
235-
path = "examples/3d/texture_pipelined.rs"
236-
237182
[[example]]
238183
name = "update_gltf_scene"
239184
path = "examples/3d/update_gltf_scene.rs"
240-
required-features = ["bevy_gltf"]
241185

242186
[[example]]
243187
name = "wireframe"
244188
path = "examples/3d/wireframe.rs"
245189

246-
[[example]]
247-
name = "z_sort_debug"
248-
path = "examples/3d/z_sort_debug.rs"
249-
250190
# Application
251191
[[example]]
252192
name = "custom_loop"
@@ -292,7 +232,6 @@ path = "examples/app/thread_pool_resources.rs"
292232
[[example]]
293233
name = "asset_loading"
294234
path = "examples/asset/asset_loading.rs"
295-
required-features = ["bevy_gltf"]
296235

297236
[[example]]
298237
name = "custom_asset"
@@ -305,7 +244,6 @@ path = "examples/asset/custom_asset_io.rs"
305244
[[example]]
306245
name = "hot_asset_reloading"
307246
path = "examples/asset/hot_asset_reloading.rs"
308-
required-features = ["bevy_gltf"]
309247

310248
# Async Tasks
311249
[[example]]
@@ -387,7 +325,6 @@ path = "examples/ecs/timers.rs"
387325
[[example]]
388326
name = "alien_cake_addict"
389327
path = "examples/game/alien_cake_addict.rs"
390-
required-features = ["bevy_gltf"]
391328

392329
[[example]]
393330
name = "breakout"
@@ -457,47 +394,19 @@ name = "scene"
457394
path = "examples/scene/scene.rs"
458395

459396
# Shaders
460-
[[example]]
461-
name = "animate_shader"
462-
path = "examples/shader/animate_shader.rs"
463-
464-
[[example]]
465-
name = "array_texture"
466-
path = "examples/shader/array_texture.rs"
467-
468-
[[example]]
469-
name = "hot_shader_reloading"
470-
path = "examples/shader/hot_shader_reloading.rs"
471-
472-
[[example]]
473-
name = "mesh_custom_attribute"
474-
path = "examples/shader/mesh_custom_attribute.rs"
475-
476-
[[example]]
477-
name = "shader_custom_material"
478-
path = "examples/shader/shader_custom_material.rs"
479-
480397
[[example]]
481398
name = "shader_defs"
482399
path = "examples/shader/shader_defs.rs"
483400

484401
[[example]]
485-
name = "custom_shader_pipelined"
486-
path = "examples/shader/custom_shader_pipelined.rs"
487-
488-
[[example]]
489-
name = "shader_defs_pipelined"
490-
path = "examples/shader/shader_defs_pipelined.rs"
402+
name = "shader_material"
403+
path = "examples/shader/shader_material.rs"
491404

492405
# Tools
493406
[[example]]
494407
name = "bevymark"
495408
path = "examples/tools/bevymark.rs"
496409

497-
[[example]]
498-
name = "bevymark_pipelined"
499-
path = "examples/tools/bevymark_pipelined.rs"
500-
501410
# UI (User Interface)
502411
[[example]]
503412
name = "button"
@@ -519,24 +428,11 @@ path = "examples/ui/text_debug.rs"
519428
name = "ui"
520429
path = "examples/ui/ui.rs"
521430

522-
[[example]]
523-
name = "ui_pipelined"
524-
path = "examples/ui/ui_pipelined.rs"
525-
526431
# Window
527432
[[example]]
528433
name = "clear_color"
529434
path = "examples/window/clear_color.rs"
530435

531-
[[example]]
532-
name = "clear_color_pipelined"
533-
path = "examples/window/clear_color_pipelined.rs"
534-
535-
[[example]]
536-
name = "multiple_windows"
537-
path = "examples/window/multiple_windows.rs"
538-
required-features = ["bevy_gltf"]
539-
540436
[[example]]
541437
name = "scale_factor_override"
542438
path = "examples/window/scale_factor_override.rs"

crates/bevy_asset/src/io/file_asset_io.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -84,10 +84,10 @@ impl AssetIo for FileAssetIo {
8484
)))
8585
}
8686

87-
fn watch_path_for_changes(&self, path: &Path) -> Result<(), AssetIoError> {
87+
fn watch_path_for_changes(&self, _path: &Path) -> Result<(), AssetIoError> {
8888
#[cfg(feature = "filesystem_watcher")]
8989
{
90-
let path = self.root_path.join(path);
90+
let path = self.root_path.join(_path);
9191
let mut watcher = self.filesystem_watcher.write();
9292
if let Some(ref mut watcher) = *watcher {
9393
watcher

pipelined/bevy_core_pipeline/Cargo.toml renamed to crates/bevy_core_pipeline/Cargo.toml

+5-5
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,9 @@ keywords = ["bevy"]
1414

1515
[dependencies]
1616
# bevy
17-
bevy_app = { path = "../../crates/bevy_app", version = "0.5.0" }
18-
bevy_asset = { path = "../../crates/bevy_asset", version = "0.5.0" }
19-
bevy_core = { path = "../../crates/bevy_core", version = "0.5.0" }
20-
bevy_ecs = { path = "../../crates/bevy_ecs", version = "0.5.0" }
21-
bevy_render2 = { path = "../bevy_render2", version = "0.5.0" }
17+
bevy_app = { path = "../bevy_app", version = "0.5.0" }
18+
bevy_asset = { path = "../bevy_asset", version = "0.5.0" }
19+
bevy_core = { path = "../bevy_core", version = "0.5.0" }
20+
bevy_ecs = { path = "../bevy_ecs", version = "0.5.0" }
21+
bevy_render = { path = "../bevy_render", version = "0.5.0" }
2222

pipelined/bevy_core_pipeline/src/clear_pass.rs renamed to crates/bevy_core_pipeline/src/clear_pass.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ use std::collections::HashSet;
22

33
use crate::ClearColor;
44
use bevy_ecs::prelude::*;
5-
use bevy_render2::{
5+
use bevy_render::{
66
camera::ExtractedCamera,
77
render_graph::{Node, NodeRunError, RenderGraphContext, SlotInfo},
88
render_resource::{

pipelined/bevy_core_pipeline/src/clear_pass_driver.rs renamed to crates/bevy_core_pipeline/src/clear_pass_driver.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
use bevy_ecs::world::World;
2-
use bevy_render2::{
2+
use bevy_render::{
33
render_graph::{Node, NodeRunError, RenderGraphContext},
44
renderer::RenderContext,
55
};

pipelined/bevy_core_pipeline/src/lib.rs renamed to crates/bevy_core_pipeline/src/lib.rs

+6-1
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,11 @@ mod main_pass_2d;
44
mod main_pass_3d;
55
mod main_pass_driver;
66

7+
pub mod prelude {
8+
#[doc(hidden)]
9+
pub use crate::ClearColor;
10+
}
11+
712
pub use clear_pass::*;
813
pub use clear_pass_driver::*;
914
pub use main_pass_2d::*;
@@ -13,7 +18,7 @@ pub use main_pass_driver::*;
1318
use bevy_app::{App, Plugin};
1419
use bevy_core::FloatOrd;
1520
use bevy_ecs::prelude::*;
16-
use bevy_render2::{
21+
use bevy_render::{
1722
camera::{ActiveCameras, CameraPlugin},
1823
color::Color,
1924
render_graph::{EmptyNode, RenderGraph, SlotInfo, SlotType},

pipelined/bevy_core_pipeline/src/main_pass_2d.rs renamed to crates/bevy_core_pipeline/src/main_pass_2d.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
use crate::Transparent2d;
22
use bevy_ecs::prelude::*;
3-
use bevy_render2::{
3+
use bevy_render::{
44
render_graph::{Node, NodeRunError, RenderGraphContext, SlotInfo, SlotType},
55
render_phase::{DrawFunctions, RenderPhase, TrackedRenderPass},
66
render_resource::{LoadOp, Operations, RenderPassColorAttachment, RenderPassDescriptor},

pipelined/bevy_core_pipeline/src/main_pass_3d.rs renamed to crates/bevy_core_pipeline/src/main_pass_3d.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
use crate::{AlphaMask3d, Opaque3d, Transparent3d};
22
use bevy_ecs::prelude::*;
3-
use bevy_render2::{
3+
use bevy_render::{
44
render_graph::{Node, NodeRunError, RenderGraphContext, SlotInfo, SlotType},
55
render_phase::{DrawFunctions, RenderPhase, TrackedRenderPass},
66
render_resource::{LoadOp, Operations, RenderPassDepthStencilAttachment, RenderPassDescriptor},

pipelined/bevy_core_pipeline/src/main_pass_driver.rs renamed to crates/bevy_core_pipeline/src/main_pass_driver.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
use bevy_ecs::world::World;
2-
use bevy_render2::{
2+
use bevy_render::{
33
camera::{CameraPlugin, ExtractedCameraNames},
44
render_graph::{Node, NodeRunError, RenderGraphContext, SlotValue},
55
renderer::RenderContext,

crates/bevy_ecs/macros/src/component.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ fn parse_component_attr(ast: &DeriveInput) -> Result<Attrs> {
7676
meta_item.path(),
7777
format!(
7878
"unknown component attribute `{}`",
79-
meta_item.path().into_token_stream().to_string()
79+
meta_item.path().into_token_stream()
8080
),
8181
));
8282
}

0 commit comments

Comments
 (0)