Skip to content

Commit

Permalink
Remove VERTEX_WRITABLE_STORAGE from examples
Browse files Browse the repository at this point in the history
The requesting of `VERTEX_WRITABLE_STORAGE` in all examples is a legacy
from the very start of the project, which has no reason to be. We have
already validated that everything works without it, and this creates
confusion for users.

Fixes #317
  • Loading branch information
djeedai committed Aug 2, 2024
1 parent d7d2d9c commit 294fc57
Show file tree
Hide file tree
Showing 11 changed files with 12 additions and 162 deletions.
13 changes: 1 addition & 12 deletions examples/2d.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,7 @@
use bevy::{
log::LogPlugin,
prelude::*,
render::{
camera::ScalingMode, render_resource::WgpuFeatures, settings::WgpuSettings, RenderPlugin,
},
render::camera::ScalingMode,
sprite::{MaterialMesh2dBundle, Mesh2dHandle},
};
use bevy_hanabi::prelude::*;
Expand All @@ -19,11 +17,6 @@ use bevy_inspector_egui::quick::WorldInspectorPlugin;
mod utils;

fn main() -> Result<(), Box<dyn std::error::Error>> {
let mut wgpu_settings = WgpuSettings::default();
wgpu_settings
.features
.set(WgpuFeatures::VERTEX_WRITABLE_STORAGE, true);

let mut app = App::default();
app.insert_resource(ClearColor(Color::BLACK))
.add_plugins(
Expand All @@ -33,10 +26,6 @@ fn main() -> Result<(), Box<dyn std::error::Error>> {
filter: "bevy_hanabi=warn,2d=trace".to_string(),
..default()
})
.set(RenderPlugin {
render_creation: wgpu_settings.into(),
synchronous_pipeline_compilation: false,
})
.set(WindowPlugin {
primary_window: Some(Window {
title: "πŸŽ† Hanabi β€” 2d".to_string(),
Expand Down
17 changes: 2 additions & 15 deletions examples/activate.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,8 @@
//! are despawned when reaching the surface.

use bevy::{
core_pipeline::tonemapping::Tonemapping,
log::LogPlugin,
prelude::*,
render::{
camera::ScalingMode, render_resource::WgpuFeatures, settings::WgpuSettings, RenderPlugin,
},
core_pipeline::tonemapping::Tonemapping, log::LogPlugin, prelude::*,
render::camera::ScalingMode,
};
use bevy_hanabi::prelude::*;
#[cfg(feature = "examples_world_inspector")]
Expand All @@ -25,11 +21,6 @@ use bevy_inspector_egui::quick::WorldInspectorPlugin;
mod utils;

fn main() -> Result<(), Box<dyn std::error::Error>> {
let mut wgpu_settings = WgpuSettings::default();
wgpu_settings
.features
.set(WgpuFeatures::VERTEX_WRITABLE_STORAGE, true);

let mut app = App::default();
app.insert_resource(ClearColor(Color::BLACK))
.add_plugins(
Expand All @@ -39,10 +30,6 @@ fn main() -> Result<(), Box<dyn std::error::Error>> {
filter: "bevy_hanabi=warn,activate=trace".to_string(),
..default()
})
.set(RenderPlugin {
render_creation: wgpu_settings.into(),
synchronous_pipeline_compilation: false,
})
.set(WindowPlugin {
primary_window: Some(Window {
title: "πŸŽ† Hanabi β€” activate".to_string(),
Expand Down
16 changes: 1 addition & 15 deletions examples/billboard.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,7 @@
use std::f32::consts::FRAC_PI_2;

use bevy::{
core_pipeline::tonemapping::Tonemapping,
log::LogPlugin,
prelude::*,
render::{
camera::Projection, render_resource::WgpuFeatures, settings::WgpuSettings, RenderPlugin,
},
core_pipeline::tonemapping::Tonemapping, log::LogPlugin, prelude::*, render::camera::Projection,
};
use bevy_hanabi::prelude::*;
#[cfg(feature = "examples_world_inspector")]
Expand All @@ -44,11 +39,6 @@ use bevy_inspector_egui::quick::WorldInspectorPlugin;
mod utils;

fn main() -> Result<(), Box<dyn std::error::Error>> {
let mut wgpu_settings = WgpuSettings::default();
wgpu_settings
.features
.set(WgpuFeatures::VERTEX_WRITABLE_STORAGE, true);

let mut app = App::default();
app.insert_resource(ClearColor(Color::BLACK))
.add_plugins(
Expand All @@ -58,10 +48,6 @@ fn main() -> Result<(), Box<dyn std::error::Error>> {
filter: "bevy_hanabi=warn,billboard=trace".to_string(),
..default()
})
.set(RenderPlugin {
render_creation: wgpu_settings.into(),
synchronous_pipeline_compilation: false,
})
.set(WindowPlugin {
primary_window: Some(Window {
title: "πŸŽ† Hanabi β€” billboard".to_string(),
Expand Down
16 changes: 1 addition & 15 deletions examples/circle.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,7 @@

use std::f32::consts::FRAC_PI_2;

use bevy::{
core_pipeline::tonemapping::Tonemapping,
log::LogPlugin,
prelude::*,
render::{render_resource::WgpuFeatures, settings::WgpuSettings, RenderPlugin},
};
use bevy::{core_pipeline::tonemapping::Tonemapping, log::LogPlugin, prelude::*};
use bevy_hanabi::prelude::*;
#[cfg(feature = "examples_world_inspector")]
use bevy_inspector_egui::quick::WorldInspectorPlugin;
Expand All @@ -21,11 +16,6 @@ mod utils;
use texutils::make_anim_img;

fn main() -> Result<(), Box<dyn std::error::Error>> {
let mut wgpu_settings = WgpuSettings::default();
wgpu_settings
.features
.set(WgpuFeatures::VERTEX_WRITABLE_STORAGE, true);

let mut app = App::default();
app.insert_resource(ClearColor(Color::BLACK))
.add_plugins(
Expand All @@ -35,10 +25,6 @@ fn main() -> Result<(), Box<dyn std::error::Error>> {
filter: "bevy_hanabi=warn,circle=trace".to_string(),
..default()
})
.set(RenderPlugin {
render_creation: wgpu_settings.into(),
synchronous_pipeline_compilation: false,
})
.set(WindowPlugin {
primary_window: Some(Window {
title: "πŸŽ† Hanabi β€” circle".to_string(),
Expand Down
16 changes: 1 addition & 15 deletions examples/force_field.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,24 +14,14 @@
//! to the projection on screen; however those particles are actually at a
//! different depth, in front or behind the sphere.

use bevy::{
core_pipeline::tonemapping::Tonemapping,
log::LogPlugin,
prelude::*,
render::{render_resource::WgpuFeatures, settings::WgpuSettings, RenderPlugin},
};
use bevy::{core_pipeline::tonemapping::Tonemapping, log::LogPlugin, prelude::*};
use bevy_hanabi::prelude::*;
#[cfg(feature = "examples_world_inspector")]
use bevy_inspector_egui::quick::WorldInspectorPlugin;

mod utils;

fn main() -> Result<(), Box<dyn std::error::Error>> {
let mut wgpu_settings = WgpuSettings::default();
wgpu_settings
.features
.set(WgpuFeatures::VERTEX_WRITABLE_STORAGE, true);

let mut app = App::default();
app.insert_resource(ClearColor(Color::BLACK))
.add_plugins(
Expand All @@ -41,10 +31,6 @@ fn main() -> Result<(), Box<dyn std::error::Error>> {
filter: "bevy_hanabi=warn,force_field=trace".to_string(),
..default()
})
.set(RenderPlugin {
render_creation: wgpu_settings.into(),
synchronous_pipeline_compilation: false,
})
.set(WindowPlugin {
primary_window: Some(Window {
title: "πŸŽ† Hanabi β€” force field".to_string(),
Expand Down
16 changes: 1 addition & 15 deletions examples/gradient.rs
Original file line number Diff line number Diff line change
@@ -1,12 +1,7 @@
use std::f32::consts::PI;

use bevy::{
core_pipeline::tonemapping::Tonemapping,
log::LogPlugin,
prelude::*,
render::{
render_resource::WgpuFeatures, settings::WgpuSettings, view::RenderLayers, RenderPlugin,
},
core_pipeline::tonemapping::Tonemapping, log::LogPlugin, prelude::*, render::view::RenderLayers,
};
use bevy_hanabi::prelude::*;
#[cfg(feature = "examples_world_inspector")]
Expand All @@ -15,11 +10,6 @@ use bevy_inspector_egui::quick::WorldInspectorPlugin;
mod utils;

fn main() -> Result<(), Box<dyn std::error::Error>> {
let mut wgpu_settings = WgpuSettings::default();
wgpu_settings
.features
.set(WgpuFeatures::VERTEX_WRITABLE_STORAGE, true);

let mut app = App::default();
app.insert_resource(ClearColor(Color::BLACK))
.add_plugins(
Expand All @@ -29,10 +19,6 @@ fn main() -> Result<(), Box<dyn std::error::Error>> {
filter: "bevy_hanabi=warn,gradient=trace".to_string(),
..default()
})
.set(RenderPlugin {
render_creation: wgpu_settings.into(),
synchronous_pipeline_compilation: false,
})
.set(WindowPlugin {
primary_window: Some(Window {
title: "πŸŽ† Hanabi β€” gradient".to_string(),
Expand Down
16 changes: 1 addition & 15 deletions examples/init.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,7 @@

use std::f32::consts::PI;

use bevy::{
core_pipeline::tonemapping::Tonemapping,
log::LogPlugin,
prelude::*,
render::{render_resource::WgpuFeatures, settings::WgpuSettings, RenderPlugin},
};
use bevy::{core_pipeline::tonemapping::Tonemapping, log::LogPlugin, prelude::*};
use bevy_hanabi::prelude::*;
#[cfg(feature = "examples_world_inspector")]
use bevy_inspector_egui::quick::WorldInspectorPlugin;
Expand All @@ -23,11 +18,6 @@ mod utils;
struct RotateSpeed(pub f32);

fn main() -> Result<(), Box<dyn std::error::Error>> {
let mut wgpu_settings = WgpuSettings::default();
wgpu_settings
.features
.set(WgpuFeatures::VERTEX_WRITABLE_STORAGE, true);

let mut app = App::default();
app.insert_resource(ClearColor(Color::BLACK))
.add_plugins(
Expand All @@ -37,10 +27,6 @@ fn main() -> Result<(), Box<dyn std::error::Error>> {
filter: "bevy_hanabi=warn,init=trace".to_string(),
..default()
})
.set(RenderPlugin {
render_creation: wgpu_settings.into(),
synchronous_pipeline_compilation: false,
})
.set(WindowPlugin {
primary_window: Some(Window {
title: "πŸŽ† Hanabi β€” init".to_string(),
Expand Down
16 changes: 1 addition & 15 deletions examples/lifetime.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,24 +11,14 @@
//! quickly, and during 2.25 seconds there's no particle, until the next burst
//! spawns some more.

use bevy::{
core_pipeline::tonemapping::Tonemapping,
log::LogPlugin,
prelude::*,
render::{render_resource::WgpuFeatures, settings::WgpuSettings, RenderPlugin},
};
use bevy::{core_pipeline::tonemapping::Tonemapping, log::LogPlugin, prelude::*};
use bevy_hanabi::prelude::*;
#[cfg(feature = "examples_world_inspector")]
use bevy_inspector_egui::quick::WorldInspectorPlugin;

mod utils;

fn main() -> Result<(), Box<dyn std::error::Error>> {
let mut wgpu_settings = WgpuSettings::default();
wgpu_settings
.features
.set(WgpuFeatures::VERTEX_WRITABLE_STORAGE, true);

let mut app = App::default();
app.insert_resource(ClearColor(Color::BLACK))
.add_plugins(
Expand All @@ -38,10 +28,6 @@ fn main() -> Result<(), Box<dyn std::error::Error>> {
filter: "bevy_hanabi=warn,lifetime=trace".to_string(),
..default()
})
.set(RenderPlugin {
render_creation: wgpu_settings.into(),
synchronous_pipeline_compilation: false,
})
.set(WindowPlugin {
primary_window: Some(Window {
title: "πŸŽ† Hanabi β€” lifetime".to_string(),
Expand Down
16 changes: 1 addition & 15 deletions examples/random.rs
Original file line number Diff line number Diff line change
@@ -1,24 +1,14 @@
//! Example of using random spawner params.
//! Spawns a random number of particles at random times.

use bevy::{
core_pipeline::tonemapping::Tonemapping,
log::LogPlugin,
prelude::*,
render::{render_resource::WgpuFeatures, settings::WgpuSettings, RenderPlugin},
};
use bevy::{core_pipeline::tonemapping::Tonemapping, log::LogPlugin, prelude::*};
use bevy_hanabi::prelude::*;
#[cfg(feature = "examples_world_inspector")]
use bevy_inspector_egui::quick::WorldInspectorPlugin;

mod utils;

fn main() -> Result<(), Box<dyn std::error::Error>> {
let mut wgpu_settings = WgpuSettings::default();
wgpu_settings
.features
.set(WgpuFeatures::VERTEX_WRITABLE_STORAGE, true);

let mut app = App::default();
app.insert_resource(ClearColor(Color::BLACK))
.add_plugins(
Expand All @@ -28,10 +18,6 @@ fn main() -> Result<(), Box<dyn std::error::Error>> {
filter: "bevy_hanabi=warn,random=trace".to_string(),
..default()
})
.set(RenderPlugin {
render_creation: wgpu_settings.into(),
synchronous_pipeline_compilation: false,
})
.set(WindowPlugin {
primary_window: Some(Window {
title: "πŸŽ† Hanabi β€” random".to_string(),
Expand Down
16 changes: 1 addition & 15 deletions examples/spawn_on_command.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,7 @@ use bevy::{
log::LogPlugin,
math::Vec3Swizzles,
prelude::*,
render::{
camera::{Projection, ScalingMode},
render_resource::WgpuFeatures,
settings::WgpuSettings,
RenderPlugin,
},
render::camera::{Projection, ScalingMode},
};
use bevy_hanabi::prelude::*;
#[cfg(feature = "examples_world_inspector")]
Expand All @@ -24,11 +19,6 @@ use bevy_inspector_egui::quick::WorldInspectorPlugin;
mod utils;

fn main() -> Result<(), Box<dyn std::error::Error>> {
let mut wgpu_settings = WgpuSettings::default();
wgpu_settings
.features
.set(WgpuFeatures::VERTEX_WRITABLE_STORAGE, true);

let mut app = App::default();
app.insert_resource(ClearColor(Color::linear_rgb(0.1, 0.1, 0.1)))
.add_plugins(
Expand All @@ -38,10 +28,6 @@ fn main() -> Result<(), Box<dyn std::error::Error>> {
filter: "bevy_hanabi=warn,spawn_on_command=trace".to_string(),
..default()
})
.set(RenderPlugin {
render_creation: wgpu_settings.into(),
synchronous_pipeline_compilation: false,
})
.set(WindowPlugin {
primary_window: Some(Window {
title: "πŸŽ† Hanabi β€” spawn on command".to_string(),
Expand Down
Loading

0 comments on commit 294fc57

Please sign in to comment.