From e65011f029ac9df3e7e9404199dae91f9b0b6c94 Mon Sep 17 00:00:00 2001 From: Carter Anderson Date: Sat, 24 Jul 2021 16:29:35 -0700 Subject: [PATCH 01/14] remove .system from pipelined code --- crates/bevy_ecs/src/system/exclusive_system.rs | 2 +- examples/3d/3d_scene_pipelined.rs | 6 +++--- examples/3d/cornell_box_pipelined.rs | 2 +- examples/3d/shadow_biases_pipelined.rs | 12 ++++++------ examples/3d/texture_pipelined.rs | 2 +- examples/tools/bevymark_pipelined.rs | 10 +++++----- pipelined/bevy_pbr2/src/lib.rs | 13 +++++-------- pipelined/bevy_render2/src/camera/mod.rs | 11 ++++------- pipelined/bevy_render2/src/core_pipeline/mod.rs | 11 ++++------- pipelined/bevy_render2/src/render_asset.rs | 4 ++-- pipelined/bevy_render2/src/texture/mod.rs | 3 +-- pipelined/bevy_render2/src/view/mod.rs | 2 +- pipelined/bevy_render2/src/view/window.rs | 4 ++-- pipelined/bevy_sprite2/src/lib.rs | 7 +++---- 14 files changed, 39 insertions(+), 50 deletions(-) diff --git a/crates/bevy_ecs/src/system/exclusive_system.rs b/crates/bevy_ecs/src/system/exclusive_system.rs index f5af6cbbfcc45..8ea5064167b4b 100644 --- a/crates/bevy_ecs/src/system/exclusive_system.rs +++ b/crates/bevy_ecs/src/system/exclusive_system.rs @@ -1,6 +1,6 @@ use crate::{ archetype::ArchetypeGeneration, - system::{check_system_change_tick, BoxedSystem, IntoSystem, System, SystemId}, + system::{check_system_change_tick, BoxedSystem, IntoSystem, SystemId}, world::World, }; use std::borrow::Cow; diff --git a/examples/3d/3d_scene_pipelined.rs b/examples/3d/3d_scene_pipelined.rs index 58cdcedd01fee..711a5b0bc0ce3 100644 --- a/examples/3d/3d_scene_pipelined.rs +++ b/examples/3d/3d_scene_pipelined.rs @@ -22,9 +22,9 @@ fn main() { .add_plugins(PipelinedDefaultPlugins) .add_plugin(FrameTimeDiagnosticsPlugin::default()) .add_plugin(LogDiagnosticsPlugin::default()) - .add_startup_system(setup.system()) - .add_system(movement.system()) - .add_system(animate_light_direction.system()) + .add_startup_system(setup) + .add_system(movement) + .add_system(animate_light_direction) .run(); } diff --git a/examples/3d/cornell_box_pipelined.rs b/examples/3d/cornell_box_pipelined.rs index 9dbce9a8b0e57..161b268fb7703 100644 --- a/examples/3d/cornell_box_pipelined.rs +++ b/examples/3d/cornell_box_pipelined.rs @@ -20,7 +20,7 @@ fn main() { .add_plugins(PipelinedDefaultPlugins) .add_plugin(FrameTimeDiagnosticsPlugin::default()) .add_plugin(LogDiagnosticsPlugin::default()) - .add_startup_system(setup.system()) + .add_startup_system(setup) .run(); } diff --git a/examples/3d/shadow_biases_pipelined.rs b/examples/3d/shadow_biases_pipelined.rs index ad56596ebc764..3036021c006a7 100644 --- a/examples/3d/shadow_biases_pipelined.rs +++ b/examples/3d/shadow_biases_pipelined.rs @@ -31,11 +31,11 @@ fn main() { ); App::new() .add_plugins(PipelinedDefaultPlugins) - .add_startup_system(setup.system()) - .add_system(adjust_point_light_biases.system()) - .add_system(toggle_light.system()) - .add_system(adjust_directional_light_biases.system()) - .add_system(camera_controller.system()) + .add_startup_system(setup) + .add_system(adjust_point_light_biases) + .add_system(toggle_light) + .add_system(adjust_directional_light_biases) + .add_system(camera_controller) .run(); } @@ -119,7 +119,7 @@ fn setup( mesh: meshes.add(Mesh::from(shape::Plane { size: 2.0 * spawn_plane_depth, })), - material: white_handle.clone(), + material: white_handle, ..Default::default() }); } diff --git a/examples/3d/texture_pipelined.rs b/examples/3d/texture_pipelined.rs index a5f07f16bbdf9..f37fa182c7b57 100644 --- a/examples/3d/texture_pipelined.rs +++ b/examples/3d/texture_pipelined.rs @@ -15,7 +15,7 @@ use bevy::{ fn main() { App::new() .add_plugins(PipelinedDefaultPlugins) - .add_startup_system(setup.system()) + .add_startup_system(setup) .run(); } diff --git a/examples/tools/bevymark_pipelined.rs b/examples/tools/bevymark_pipelined.rs index b2e80850e381e..2178ced79c973 100644 --- a/examples/tools/bevymark_pipelined.rs +++ b/examples/tools/bevymark_pipelined.rs @@ -54,11 +54,11 @@ fn main() { // .add_plugin(WgpuResourceDiagnosticsPlugin::default()) .insert_resource(BevyCounter { count: 0 }) // .init_resource::() - .add_startup_system(setup.system()) - .add_system(mouse_handler.system()) - .add_system(movement_system.system()) - .add_system(collision_system.system()) - .add_system(counter_system.system()) + .add_startup_system(setup) + .add_system(mouse_handler) + .add_system(movement_system) + .add_system(collision_system) + .add_system(counter_system) .run(); } diff --git a/pipelined/bevy_pbr2/src/lib.rs b/pipelined/bevy_pbr2/src/lib.rs index 290643ad0dbb3..02ecb7ae37b38 100644 --- a/pipelined/bevy_pbr2/src/lib.rs +++ b/pipelined/bevy_pbr2/src/lib.rs @@ -33,20 +33,17 @@ impl Plugin for PbrPlugin { let render_app = app.sub_app_mut(0); render_app - .add_system_to_stage(RenderStage::Extract, render::extract_meshes.system()) - .add_system_to_stage(RenderStage::Extract, render::extract_lights.system()) - .add_system_to_stage(RenderStage::Prepare, render::prepare_meshes.system()) + .add_system_to_stage(RenderStage::Extract, render::extract_meshes) + .add_system_to_stage(RenderStage::Extract, render::extract_lights) + .add_system_to_stage(RenderStage::Prepare, render::prepare_meshes) .add_system_to_stage( RenderStage::Prepare, // this is added as an exclusive system because it contributes new views. it must run (and have Commands applied) // _before_ the `prepare_views()` system is run. ideally this becomes a normal system when "stageless" features come out render::prepare_lights.exclusive_system(), ) - .add_system_to_stage(RenderStage::Queue, render::queue_meshes.system()) - .add_system_to_stage( - RenderStage::PhaseSort, - sort_phase_system::.system(), - ) + .add_system_to_stage(RenderStage::Queue, render::queue_meshes) + .add_system_to_stage(RenderStage::PhaseSort, sort_phase_system::) // FIXME: Hack to ensure RenderCommandQueue is initialized when PbrShaders is being initialized // .init_resource::() .init_resource::() diff --git a/pipelined/bevy_render2/src/camera/mod.rs b/pipelined/bevy_render2/src/camera/mod.rs index 23b31691d96e5..63ea8f66721f2 100644 --- a/pipelined/bevy_render2/src/camera/mod.rs +++ b/pipelined/bevy_render2/src/camera/mod.rs @@ -31,22 +31,19 @@ impl Plugin for CameraPlugin { active_cameras.add(Self::CAMERA_3D); app.register_type::() .insert_resource(active_cameras) + .add_system_to_stage(CoreStage::PostUpdate, crate::camera::active_cameras_system) .add_system_to_stage( CoreStage::PostUpdate, - crate::camera::active_cameras_system.system(), + crate::camera::camera_system::, ) .add_system_to_stage( CoreStage::PostUpdate, - crate::camera::camera_system::.system(), - ) - .add_system_to_stage( - CoreStage::PostUpdate, - crate::camera::camera_system::.system(), + crate::camera::camera_system::, ); let render_app = app.sub_app_mut(0); render_app .init_resource::() - .add_system_to_stage(RenderStage::Extract, extract_cameras.system()); + .add_system_to_stage(RenderStage::Extract, extract_cameras); } } diff --git a/pipelined/bevy_render2/src/core_pipeline/mod.rs b/pipelined/bevy_render2/src/core_pipeline/mod.rs index 36769ec92e243..45bb313b6f23a 100644 --- a/pipelined/bevy_render2/src/core_pipeline/mod.rs +++ b/pipelined/bevy_render2/src/core_pipeline/mod.rs @@ -61,18 +61,15 @@ impl Plugin for CorePipelinePlugin { fn build(&self, app: &mut App) { let render_app = app.sub_app_mut(0); render_app - .add_system_to_stage( - RenderStage::Extract, - extract_core_pipeline_camera_phases.system(), - ) - .add_system_to_stage(RenderStage::Prepare, prepare_core_views_system.system()) + .add_system_to_stage(RenderStage::Extract, extract_core_pipeline_camera_phases) + .add_system_to_stage(RenderStage::Prepare, prepare_core_views_system) .add_system_to_stage( RenderStage::PhaseSort, - sort_phase_system::.system(), + sort_phase_system::, ) .add_system_to_stage( RenderStage::PhaseSort, - sort_phase_system::.system(), + sort_phase_system::, ); let pass_node_2d = MainPass2dNode::new(&mut render_app.world); diff --git a/pipelined/bevy_render2/src/render_asset.rs b/pipelined/bevy_render2/src/render_asset.rs index be9489b5cb6e4..90533d2e5915c 100644 --- a/pipelined/bevy_render2/src/render_asset.rs +++ b/pipelined/bevy_render2/src/render_asset.rs @@ -35,8 +35,8 @@ impl Plugin for RenderAssetPlugin { render_app .init_resource::>() .init_resource::>() - .add_system_to_stage(RenderStage::Extract, extract_render_asset::.system()) - .add_system_to_stage(RenderStage::Prepare, prepare_render_asset::.system()); + .add_system_to_stage(RenderStage::Extract, extract_render_asset::) + .add_system_to_stage(RenderStage::Prepare, prepare_render_asset::); } } diff --git a/pipelined/bevy_render2/src/texture/mod.rs b/pipelined/bevy_render2/src/texture/mod.rs index 243c9fdc58d52..976b7c10592d5 100644 --- a/pipelined/bevy_render2/src/texture/mod.rs +++ b/pipelined/bevy_render2/src/texture/mod.rs @@ -16,7 +16,6 @@ pub use texture_cache::*; use crate::{render_asset::RenderAssetPlugin, RenderStage}; use bevy_app::{App, Plugin}; use bevy_asset::AddAsset; -use bevy_ecs::prelude::*; // TODO: replace Texture names with Image names? pub struct ImagePlugin; @@ -34,7 +33,7 @@ impl Plugin for ImagePlugin { let render_app = app.sub_app_mut(0); render_app .init_resource::() - .add_system_to_stage(RenderStage::Cleanup, update_texture_cache_system.system()); + .add_system_to_stage(RenderStage::Cleanup, update_texture_cache_system); } } diff --git a/pipelined/bevy_render2/src/view/mod.rs b/pipelined/bevy_render2/src/view/mod.rs index 06d73fd80ce00..d95ae8834ada5 100644 --- a/pipelined/bevy_render2/src/view/mod.rs +++ b/pipelined/bevy_render2/src/view/mod.rs @@ -25,7 +25,7 @@ impl Plugin for ViewPlugin { let render_app = app.sub_app_mut(0); render_app .init_resource::() - .add_system_to_stage(RenderStage::Prepare, prepare_views.system()); + .add_system_to_stage(RenderStage::Prepare, prepare_views); let mut graph = render_app.world.get_resource_mut::().unwrap(); graph.add_node(ViewPlugin::VIEW_NODE, ViewNode); diff --git a/pipelined/bevy_render2/src/view/window.rs b/pipelined/bevy_render2/src/view/window.rs index ddae464da516c..5ec52bec0d49b 100644 --- a/pipelined/bevy_render2/src/view/window.rs +++ b/pipelined/bevy_render2/src/view/window.rs @@ -23,8 +23,8 @@ impl Plugin for WindowRenderPlugin { render_app .init_resource::() .init_resource::() - .add_system_to_stage(RenderStage::Extract, extract_windows.system()) - .add_system_to_stage(RenderStage::Prepare, prepare_windows.system()); + .add_system_to_stage(RenderStage::Extract, extract_windows) + .add_system_to_stage(RenderStage::Prepare, prepare_windows); } } diff --git a/pipelined/bevy_sprite2/src/lib.rs b/pipelined/bevy_sprite2/src/lib.rs index 4f0c14d8becd2..9aed799588077 100644 --- a/pipelined/bevy_sprite2/src/lib.rs +++ b/pipelined/bevy_sprite2/src/lib.rs @@ -9,7 +9,6 @@ pub use render::*; pub use sprite::*; use bevy_app::prelude::*; -use bevy_ecs::prelude::IntoSystem; use bevy_render2::{ core_pipeline, render_graph::RenderGraph, render_phase::DrawFunctions, RenderStage, }; @@ -22,9 +21,9 @@ impl Plugin for SpritePlugin { app.register_type::(); let render_app = app.sub_app_mut(0); render_app - .add_system_to_stage(RenderStage::Extract, render::extract_sprites.system()) - .add_system_to_stage(RenderStage::Prepare, render::prepare_sprites.system()) - .add_system_to_stage(RenderStage::Queue, queue_sprites.system()) + .add_system_to_stage(RenderStage::Extract, render::extract_sprites) + .add_system_to_stage(RenderStage::Prepare, render::prepare_sprites) + .add_system_to_stage(RenderStage::Queue, queue_sprites) .init_resource::() .init_resource::(); let draw_sprite = DrawSprite::new(&mut render_app.world); From e79c3179fbe43910b6c24d8bf1e3b9c5bcfd7ebc Mon Sep 17 00:00:00 2001 From: Carter Anderson Date: Sat, 24 Jul 2021 16:40:19 -0700 Subject: [PATCH 02/14] add pipelined examples to readme --- examples/README.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/examples/README.md b/examples/README.md index 37b76a3a34830..12856903adae3 100644 --- a/examples/README.md +++ b/examples/README.md @@ -96,14 +96,19 @@ Example | File | Description Example | File | Description --- | --- | --- `3d_scene` | [`3d/3d_scene.rs`](./3d/3d_scene.rs) | Simple 3D scene with basic shapes and lighting +`3d_scene_pipelined` | [`3d/3d_scene_pipelined.rs`](./3d/3d_scene_pipelined.rs) | Simple 3D scene with basic shapes and lighting +`cornell_box_pipelined` | [`3d/cornell_box_pipelined.rs`](./3d/cornell_box_pipelined.rs) | Re-production of the cornell box `load_gltf` | [`3d/load_gltf.rs`](./3d/load_gltf.rs) | Loads and renders a gltf file as a scene `msaa` | [`3d/msaa.rs`](./3d/msaa.rs) | Configures MSAA (Multi-Sample Anti-Aliasing) for smoother edges `orthographic` | [`3d/orthographic.rs`](./3d/orthographic.rs) | Shows how to create a 3D orthographic view (for isometric-look games or CAD applications) `parenting` | [`3d/parenting.rs`](./3d/parenting.rs) | Demonstrates parent->child relationships and relative transformations `pbr` | [`3d/pbr.rs`](./3d/pbr.rs) | Demonstrates use of Physically Based Rendering (PBR) properties +`pbr_pipelined` | [`3d/pbr_pipelined.rs`](./3d/pbr_pipelined.rs) | Demonstrates use of Physically Based Rendering (PBR) properties `render_to_texture` | [`3d/render_to_texture.rs`](./3d/render_to_texture.rs) | Shows how to render to texture +`shadow_biases_pipelined` | [`3d/shadow_biases_pipelined.rs`](./3d/shadow_biases_pipelined.rs) | Demonstrates how shadow biases affect shadows in a 3d scene `spawner` | [`3d/spawner.rs`](./3d/spawner.rs) | Renders a large number of cubes with changing position and material `texture` | [`3d/texture.rs`](./3d/texture.rs) | Shows configuration of texture materials +`texture_pipelined` | [`3d/texture_pipelined.rs`](./3d/texture_pipelined.rs) | Shows configuration of texture materials `update_gltf_scene` | [`3d/update_gltf_scene.rs`](./3d/update_gltf_scene.rs) | Update a scene from a gltf file, either by spawning the scene as a child of another entity, or by accessing the entities of the scene `wireframe` | [`3d/wireframe.rs`](./3d/wireframe.rs) | Showcases wireframe rendering `z_sort_debug` | [`3d/z_sort_debug.rs`](./3d/z_sort_debug.rs) | Visualizes camera Z-ordering @@ -230,6 +235,7 @@ Example | File | Description Example | File | Description --- | --- | --- `bevymark` | [`tools/bevymark.rs`](./tools/bevymark.rs) | A heavy workload to benchmark your system with Bevy +`bevymark_pipelined` | [`tools/bevymark_pipelined.rs`](./tools/bevymark_pipelined.rs) | A heavy workload to benchmark your system with Bevy ## UI (User Interface) From 0490ad5419e10cf51a15931f6c6367de12d12976 Mon Sep 17 00:00:00 2001 From: Carter Anderson Date: Sat, 24 Jul 2021 16:41:48 -0700 Subject: [PATCH 03/14] fix crevice markdown lints --- crates/crevice/README.md | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/crates/crevice/README.md b/crates/crevice/README.md index d8a700e6a9e3d..c8306125026a7 100644 --- a/crates/crevice/README.md +++ b/crates/crevice/README.md @@ -18,9 +18,9 @@ Examples in this crate use cgmath, but any math crate that works with the mint crate will also work. Some other crates include nalgebra, ultraviolet, glam, and vek. -### Examples +## Examples -#### Single Value +### Single Value Uploading many types can be done by deriving `AsStd140` and using [`as_std140`][std140::AsStd140::as_std140] and @@ -126,10 +126,11 @@ Crevice supports Rust 1.46.0 and newer due to use of new `const fn` features. Licensed under either of - * Apache License, Version 2.0, ([LICENSE-APACHE](LICENSE-APACHE) or http://www.apache.org/licenses/LICENSE-2.0) - * MIT license ([LICENSE-MIT](LICENSE-MIT) or http://opensource.org/licenses/MIT) +* Apache License, Version 2.0, ([LICENSE-APACHE](LICENSE-APACHE) or [http://www.apache.org/licenses/LICENSE-2.0](http://www.apache.org/licenses/LICENSE-2.0)) +* MIT license ([LICENSE-MIT](LICENSE-MIT) or [http://opensource.org/licenses/MIT](http://opensource.org/licenses/MIT)) at your option. ### Contribution + Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions. From 55275ac4052dab385eca1c82b4d21829eb0eed57 Mon Sep 17 00:00:00 2001 From: Carter Anderson Date: Sat, 24 Jul 2021 17:15:55 -0700 Subject: [PATCH 04/14] fix system param doc test --- crates/bevy_ecs/src/system/system_param.rs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/crates/bevy_ecs/src/system/system_param.rs b/crates/bevy_ecs/src/system/system_param.rs index 6194b0f3dcc58..385ec8af41095 100644 --- a/crates/bevy_ecs/src/system/system_param.rs +++ b/crates/bevy_ecs/src/system/system_param.rs @@ -27,11 +27,15 @@ use std::{ /// /// ``` /// # use bevy_ecs::prelude::*; +/// # use std::marker::PhantomData; /// use bevy_ecs::system::SystemParam; /// /// #[derive(SystemParam)] -/// struct MyParam<'a> { -/// foo: Res<'a, usize>, +/// struct MyParam<'s, 'w> { +/// foo: Res<'w, usize>, +/// // TODO: this isn't ideal ... maybe the SystemParam derive can be smarter about world and state lifetimes? +/// #[system_param(ignore)] +/// marker: PhantomData<&'s usize>, /// } /// /// fn my_system(param: MyParam) { From 0741eb36ccc58e9562170115790852b3ffdb2b3e Mon Sep 17 00:00:00 2001 From: Carter Anderson Date: Sat, 24 Jul 2021 17:22:39 -0700 Subject: [PATCH 05/14] remove changes.md and crevice changelog --- crates/crevice/CHANGELOG.md | 39 ------------------------------------- pipelined/changes.md | 10 ---------- 2 files changed, 49 deletions(-) delete mode 100644 crates/crevice/CHANGELOG.md delete mode 100644 pipelined/changes.md diff --git a/crates/crevice/CHANGELOG.md b/crates/crevice/CHANGELOG.md deleted file mode 100644 index 4400505fb88c1..0000000000000 --- a/crates/crevice/CHANGELOG.md +++ /dev/null @@ -1,39 +0,0 @@ -# Crevice Changelog - -## Unreleased Changes - -## [0.6.0][0.6.0] (2021-02-24) -* Added `std430` support. Most APIs between `std140` and `std430` are the same! -* Added the `WriteStd140` trait. This trait is more general than `AsStd140` and is automatically implemented for all existing `AsStd140` implementers. -* Added `Writer::write_std140` to write a type that implements `Std140`. -* Added `AsStd140::std140_size_static`. This is similar to the old size method, `std140_size`, but no longer requires a value to be passed. For size measurements that depend on a value, use `WriteStd140::std140_size` instead. -* Deprecated `Writer::write_slice`, as `Writer::write` now accepts slices. -* Changed bounds of some functions, like `Writer::write` to use `WriteStd140` instead of `AsStd140`. This should affect no existing consumers. -* Moved `std140_size` from `AsStd140` to `WriteStd140`. Some existing consumers may need to import the other trait to access this m ethod. - -[0.6.0]: https://github.com/LPGhatguy/crevice/releases/tag/v0.6.0 - -## 0.5.0 (2020-10-18) -* Added f64-based std140 types: `DVec2`, `DVec3`, `DVec4`, `DMat2`, `DMat3`, and `DMat4`. -* Added support for std140 structs with alignment greater than 16. -* Fixed padding for std140 matrices; they were previously missing trailing padding. - -## 0.4.0 (2020-10-01) -* Added `AsStd140::std140_size` for easily pre-sizing buffers. -* `Writer::write` and `Sizer::add` now return the offset the value is or would be written to. -* Added `std140::DynamicUniform` for aligning dynamic uniform members. -* Added `Writer::write_slice` for writing multiple values in a row. - -## 0.3.0 (2020-09-22) -* Added `Std140::as_bytes`, reducing the need to work with bytemuck directly. -* Removed public re-export of bytemuck. - -## 0.2.0 (2020-09-22) -* Added documentation for everything in the crate. -* Removed `type_layout` being exposed except for internal tests. -* Fixed alignment offset not taking into account previously added alignment. -* Added `std140::Writer`, for writing dynamically laid out types to buffers. -* Added `std140::Sizer`, for pre-calculating buffer sizes. - -## 0.1.0 (2020-09-18) -* Initial MVP release diff --git a/pipelined/changes.md b/pipelined/changes.md deleted file mode 100644 index bd374ca1254e7..0000000000000 --- a/pipelined/changes.md +++ /dev/null @@ -1,10 +0,0 @@ -* Remove AppBuilder -* Add SubApps -* `Res>` -> `Res` -* Removed RenderResourceBindings -* Made shaders and pipelines proper render resources (removes dependency on bevy_asset and is generally a cleaner api) -* Removed RenderResources / RenderResource traits -* Decoupled swap chain from Window in Renderer api -* Removed RenderResourceBindings -* Removed asset tracking from render resources -* Removed cruft from RenderResource api \ No newline at end of file From c37e26628237c9d1b7af7c63cdb77fe184201364 Mon Sep 17 00:00:00 2001 From: Carter Anderson Date: Sat, 24 Jul 2021 18:26:51 -0700 Subject: [PATCH 06/14] disable wasm builds --- .github/bors.toml | 5 +++-- .github/workflows/ci.yml | 46 ++++++++++++++++++++-------------------- 2 files changed, 26 insertions(+), 25 deletions(-) diff --git a/.github/bors.toml b/.github/bors.toml index 15d17706b39b8..45c784f105520 100644 --- a/.github/bors.toml +++ b/.github/bors.toml @@ -3,8 +3,9 @@ status = [ "build (stable, ubuntu-latest)", "build (stable, macos-latest)", "build (nightly, ubuntu-latest)", - "build-wasm (stable, ubuntu-latest)", - "build-wasm (nightly, ubuntu-latest)", + # TODO: re-enable after wasm works on pipelined-rendering + # "build-wasm (stable, ubuntu-latest)", + # "build-wasm (nightly, ubuntu-latest)", "markdownlint", "check-markdown-links", "run-examples", diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index af23b4c778af9..8337504aea8ab 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -45,27 +45,27 @@ jobs: env: CARGO_INCREMENTAL: 0 RUSTFLAGS: "-C debuginfo=0 -D warnings" - - build-wasm: - strategy: - matrix: - toolchain: [stable, nightly] - os: [ubuntu-latest] - runs-on: ${{ matrix.os }} - steps: - - uses: actions/checkout@v2 - - - uses: actions-rs/toolchain@v1 - with: - toolchain: ${{ matrix.toolchain }} - target: wasm32-unknown-unknown - override: true - - - name: Check wasm - uses: actions-rs/cargo@v1 - with: - command: check - args: --target wasm32-unknown-unknown --no-default-features --features bevy_winit,x11,hdr,bevy_gltf + # NOTE: temporarily disabled while we sort out pipelined-rendering support + # build-wasm: + # strategy: + # matrix: + # toolchain: [stable, nightly] + # os: [ubuntu-latest] + # runs-on: ${{ matrix.os }} + # steps: + # - uses: actions/checkout@v2 + + # - uses: actions-rs/toolchain@v1 + # with: + # toolchain: ${{ matrix.toolchain }} + # target: wasm32-unknown-unknown + # override: true + + # - name: Check wasm + # uses: actions-rs/cargo@v1 + # with: + # command: check + # args: --target wasm32-unknown-unknown --no-default-features --features bevy_winit,x11,hdr,bevy_gltf build-android: runs-on: ubuntu-latest @@ -130,14 +130,14 @@ jobs: - name: Build bevy run: | - cargo build --no-default-features --features "bevy_dynamic_plugin,bevy_gilrs,bevy_gltf,bevy_wgpu,bevy_winit,render,png,hdr,x11,bevy_ci_testing" + cargo build --no-default-features --features "bevy_dynamic_plugin,bevy_gilrs,bevy_gltf,bevy_winit,render,png,hdr,x11,bevy_ci_testing" - name: Run examples run: | for example in .github/example-run/*.ron; do example_name=`basename $example .ron` echo "running $example_name - "`date` - 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" + 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" sleep 10 done From 7665b51a1355ed095c29afc47475244e3d23bb7b Mon Sep 17 00:00:00 2001 From: Carter Anderson Date: Sat, 24 Jul 2021 18:27:11 -0700 Subject: [PATCH 07/14] fix doc tests and consolidate deps --- crates/bevy_app/src/app.rs | 2 +- pipelined/bevy_render2/Cargo.toml | 4 ++-- pipelined/bevy_render2/src/mesh/mesh/conversions.rs | 6 +++--- pipelined/bevy_render2/src/mesh/mesh/mod.rs | 4 ++-- pipelined/bevy_render2/src/shader/shader.rs | 2 +- 5 files changed, 9 insertions(+), 9 deletions(-) diff --git a/crates/bevy_app/src/app.rs b/crates/bevy_app/src/app.rs index f27f60699ff16..65ecd7217b5ab 100644 --- a/crates/bevy_app/src/app.rs +++ b/crates/bevy_app/src/app.rs @@ -544,7 +544,7 @@ impl App { /// # /// # struct MyOwnPlugin; /// # impl Plugin for MyOwnPlugin { - /// # fn build(&self, app: &mut AppBuilder){;} + /// # fn build(&self, app: &mut App) { } /// # } /// # /// App::new() diff --git a/pipelined/bevy_render2/Cargo.toml b/pipelined/bevy_render2/Cargo.toml index 35068605f0da8..7b1864d5d1e37 100644 --- a/pipelined/bevy_render2/Cargo.toml +++ b/pipelined/bevy_render2/Cargo.toml @@ -30,7 +30,7 @@ image = { version = "0.23.12", default-features = false } # misc wgpu = "0.9" -naga = { git = "https://github.com/gfx-rs/naga", rev = "0cf5484bba530f1134badbd2a1c1a8e9daf2e9c3", features = ["glsl-in", "spv-in", "spv-out", "wgsl-in", "wgsl-out"] } +naga = { version = "0.5", features = ["glsl-in", "spv-in", "spv-out", "wgsl-in", "wgsl-out"] } serde = { version = "1", features = ["derive"] } bitflags = "1.2.1" smallvec = { version = "1.6", features = ["union", "const_generics"] } @@ -40,7 +40,7 @@ thiserror = "1.0" futures-lite = "1.4.0" anyhow = "1.0" hex = "0.4.2" -hexasphere = "3.4" +hexasphere = "4.0" parking_lot = "0.11.0" crevice = { path = "../../crates/crevice" } diff --git a/pipelined/bevy_render2/src/mesh/mesh/conversions.rs b/pipelined/bevy_render2/src/mesh/mesh/conversions.rs index 51170afc2b22e..79b88498a88c6 100644 --- a/pipelined/bevy_render2/src/mesh/mesh/conversions.rs +++ b/pipelined/bevy_render2/src/mesh/mesh/conversions.rs @@ -4,16 +4,16 @@ //! # Examples //! //! ```rust -//! use bevy_render::mesh::VertexAttributeValues; +//! use bevy_render2::mesh::VertexAttributeValues; //! use std::convert::{ TryInto, TryFrom }; //! //! // creating std::vec::Vec //! let buffer = vec![[0_u32; 4]; 10]; //! -//! // converting std::vec::Vec to bevy_render::mesh::VertexAttributeValues +//! // converting std::vec::Vec to bevy_render2::mesh::VertexAttributeValues //! let values = VertexAttributeValues::from(buffer.clone()); //! -//! // converting bevy_render::mesh::VertexAttributeValues to std::vec::Vec with two ways +//! // converting bevy_render2::mesh::VertexAttributeValues to std::vec::Vec with two ways //! let result_into: Vec<[u32; 4]> = values.clone().try_into().unwrap(); //! let result_from: Vec<[u32; 4]> = Vec::try_from(values.clone()).unwrap(); //! diff --git a/pipelined/bevy_render2/src/mesh/mesh/mod.rs b/pipelined/bevy_render2/src/mesh/mesh/mod.rs index 4f04b66a50413..57f5ed80d444b 100644 --- a/pipelined/bevy_render2/src/mesh/mesh/mod.rs +++ b/pipelined/bevy_render2/src/mesh/mesh/mod.rs @@ -36,8 +36,8 @@ pub struct Mesh { /// /// Example of constructing a mesh: /// ``` -/// # use bevy_render::mesh::{Mesh, Indices}; -/// # use bevy_render::pipeline::PrimitiveTopology; +/// # use bevy_render2::mesh::{Mesh, Indices}; +/// # use bevy_render2::render_resource::PrimitiveTopology; /// fn create_triangle() -> Mesh { /// let mut mesh = Mesh::new(PrimitiveTopology::TriangleList); /// mesh.set_attribute(Mesh::ATTRIBUTE_POSITION, vec![[1.0, 0.0, 0.0], [0.0, 1.0, 0.0], [1.0, 1.0, 0.0]]); diff --git a/pipelined/bevy_render2/src/shader/shader.rs b/pipelined/bevy_render2/src/shader/shader.rs index 4fcf84d0f6b20..b27539dec9e2b 100644 --- a/pipelined/bevy_render2/src/shader/shader.rs +++ b/pipelined/bevy_render2/src/shader/shader.rs @@ -75,7 +75,7 @@ impl Shader { &source, &naga::front::glsl::Options { entry_points, - ..Default::default() + defines: Default::default(), }, )? } From 1b7301b9bd34b4b0fae52a1b4445a31bdc0076b8 Mon Sep 17 00:00:00 2001 From: Carter Anderson Date: Sat, 24 Jul 2021 18:53:27 -0700 Subject: [PATCH 08/14] remove cgmath --- crates/crevice/Cargo.toml | 1 - 1 file changed, 1 deletion(-) diff --git a/crates/crevice/Cargo.toml b/crates/crevice/Cargo.toml index 93a77d7da89cb..0213af371ed05 100644 --- a/crates/crevice/Cargo.toml +++ b/crates/crevice/Cargo.toml @@ -25,7 +25,6 @@ mint = "0.5.5" glam = "0.15.1" [dev-dependencies] -cgmath = { version = "0.17.0", features = ["mint"] } insta = "0.16.1" type-layout = { version = "0.2.0", features = ["serde1"] } crevice-derive = { version = "0.6.0", path = "crevice-derive" } From 71b8df24c873046d1a964036df836a631bed9d2c Mon Sep 17 00:00:00 2001 From: Carter Anderson Date: Sat, 24 Jul 2021 18:54:06 -0700 Subject: [PATCH 09/14] remove insta --- crates/crevice/Cargo.toml | 1 - 1 file changed, 1 deletion(-) diff --git a/crates/crevice/Cargo.toml b/crates/crevice/Cargo.toml index 0213af371ed05..447072f6dc8c1 100644 --- a/crates/crevice/Cargo.toml +++ b/crates/crevice/Cargo.toml @@ -25,6 +25,5 @@ mint = "0.5.5" glam = "0.15.1" [dev-dependencies] -insta = "0.16.1" type-layout = { version = "0.2.0", features = ["serde1"] } crevice-derive = { version = "0.6.0", path = "crevice-derive" } From 25f8f8043f6c6b947805fc8b234184154842a259 Mon Sep 17 00:00:00 2001 From: Carter Anderson Date: Mon, 26 Jul 2021 15:58:26 -0700 Subject: [PATCH 10/14] skip cgmath examples --- crates/crevice/src/lib.rs | 4 ++-- crates/crevice/src/std140/traits.rs | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/crates/crevice/src/lib.rs b/crates/crevice/src/lib.rs index 076f2c7ce4d78..16f0994474dfb 100644 --- a/crates/crevice/src/lib.rs +++ b/crates/crevice/src/lib.rs @@ -35,7 +35,7 @@ uniform MAIN { } main; ``` -```rust +```skip use crevice::std140::{AsStd140, Std140}; use cgmath::prelude::*; use cgmath::{Matrix3, Vector3}; @@ -76,7 +76,7 @@ buffer POINT_LIGHTS { } point_lights; ``` -```rust +```skip use crevice::std140::{self, AsStd140}; #[derive(AsStd140)] diff --git a/crates/crevice/src/std140/traits.rs b/crates/crevice/src/std140/traits.rs index 55eec47463aab..6e0cf172fb8da 100644 --- a/crates/crevice/src/std140/traits.rs +++ b/crates/crevice/src/std140/traits.rs @@ -87,7 +87,7 @@ uniform CAMERA { } camera; ``` -``` +```skip use cgmath::prelude::*; use cgmath::{Matrix4, Deg, perspective}; use crevice::std140::{AsStd140, Std140}; From 321c75eeb31ac3544fd29731d71a6232c28f5565 Mon Sep 17 00:00:00 2001 From: Carter Anderson Date: Mon, 26 Jul 2021 16:10:04 -0700 Subject: [PATCH 11/14] remove type-layout --- crates/crevice/Cargo.toml | 1 - crates/crevice/crevice-derive/Cargo.toml | 5 ----- crates/crevice/crevice-derive/src/lib.rs | 4 ---- 3 files changed, 10 deletions(-) diff --git a/crates/crevice/Cargo.toml b/crates/crevice/Cargo.toml index 447072f6dc8c1..f37325432f745 100644 --- a/crates/crevice/Cargo.toml +++ b/crates/crevice/Cargo.toml @@ -25,5 +25,4 @@ mint = "0.5.5" glam = "0.15.1" [dev-dependencies] -type-layout = { version = "0.2.0", features = ["serde1"] } crevice-derive = { version = "0.6.0", path = "crevice-derive" } diff --git a/crates/crevice/crevice-derive/Cargo.toml b/crates/crevice/crevice-derive/Cargo.toml index a84a1d462565e..25d0726c4ceb8 100644 --- a/crates/crevice/crevice-derive/Cargo.toml +++ b/crates/crevice/crevice-derive/Cargo.toml @@ -9,11 +9,6 @@ homepage = "https://github.com/LPGhatguy/crevice" repository = "https://github.com/LPGhatguy/crevice" license = "MIT OR Apache-2.0" -[features] -# Feature used for testing; enables type_layout derive on types. -# Requires crate using derive to depend on type_layout as well. -test_type_layout = [] - [lib] proc-macro = true diff --git a/crates/crevice/crevice-derive/src/lib.rs b/crates/crevice/crevice-derive/src/lib.rs index a4fbac11ae8e4..cfa52be4e1503 100644 --- a/crates/crevice/crevice-derive/src/lib.rs +++ b/crates/crevice/crevice-derive/src/lib.rs @@ -244,9 +244,6 @@ impl EmitOptions { }, ); - // For testing purposes, we can optionally generate type layout - // information using the type-layout crate. - let type_layout_derive = quote!(); quote! { #[allow(non_snake_case)] @@ -257,7 +254,6 @@ impl EmitOptions { } #[derive(Debug, Clone, Copy)] - #type_layout_derive #[repr(C)] #visibility struct #generated_name #ty_generics #where_clause { #( #generated_fields )* From 50f308696d6540ac7e85b5de016c31eed5ac5481 Mon Sep 17 00:00:00 2001 From: Carter Anderson Date: Mon, 26 Jul 2021 16:10:15 -0700 Subject: [PATCH 12/14] add cervice version --- pipelined/bevy_pbr2/Cargo.toml | 2 +- pipelined/bevy_render2/Cargo.toml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/pipelined/bevy_pbr2/Cargo.toml b/pipelined/bevy_pbr2/Cargo.toml index 613b36a298b2e..263089a07b91c 100644 --- a/pipelined/bevy_pbr2/Cargo.toml +++ b/pipelined/bevy_pbr2/Cargo.toml @@ -28,5 +28,5 @@ bevy_utils = { path = "../../crates/bevy_utils", version = "0.5.0" } bitflags = "1.2" # direct dependency required for derive macro bytemuck = { version = "1", features = ["derive"] } -crevice = { path = "../../crates/crevice" } +crevice = { path = "../../crates/crevice", version = "0.6.0" } wgpu = "0.9" diff --git a/pipelined/bevy_render2/Cargo.toml b/pipelined/bevy_render2/Cargo.toml index 7b1864d5d1e37..6d19db11ca5da 100644 --- a/pipelined/bevy_render2/Cargo.toml +++ b/pipelined/bevy_render2/Cargo.toml @@ -42,7 +42,7 @@ anyhow = "1.0" hex = "0.4.2" hexasphere = "4.0" parking_lot = "0.11.0" -crevice = { path = "../../crates/crevice" } +crevice = { path = "../../crates/crevice", version = "0.6.0" } [features] png = ["image/png"] From e5fd05c30f5da2369f7fef072a9b15afabf835d2 Mon Sep 17 00:00:00 2001 From: Carter Anderson Date: Mon, 26 Jul 2021 16:15:14 -0700 Subject: [PATCH 13/14] fmt --- crates/crevice/crevice-derive/src/lib.rs | 1 - 1 file changed, 1 deletion(-) diff --git a/crates/crevice/crevice-derive/src/lib.rs b/crates/crevice/crevice-derive/src/lib.rs index cfa52be4e1503..01d7376c4b321 100644 --- a/crates/crevice/crevice-derive/src/lib.rs +++ b/crates/crevice/crevice-derive/src/lib.rs @@ -244,7 +244,6 @@ impl EmitOptions { }, ); - quote! { #[allow(non_snake_case)] mod #alignment_mod_name { From c675b98f5be569db76866379b579e9df6914d689 Mon Sep 17 00:00:00 2001 From: Carter Anderson Date: Mon, 26 Jul 2021 16:29:36 -0700 Subject: [PATCH 14/14] re-add bevy_wgpu to example runners --- .github/workflows/ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 8337504aea8ab..78deb9dcead54 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -130,14 +130,14 @@ jobs: - name: Build bevy run: | - cargo build --no-default-features --features "bevy_dynamic_plugin,bevy_gilrs,bevy_gltf,bevy_winit,render,png,hdr,x11,bevy_ci_testing" + cargo build --no-default-features --features "bevy_dynamic_plugin,bevy_gilrs,bevy_gltf,bevy_wgpu,bevy_winit,render,png,hdr,x11,bevy_ci_testing" - name: Run examples run: | for example in .github/example-run/*.ron; do example_name=`basename $example .ron` echo "running $example_name - "`date` - 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" + 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" sleep 10 done