Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ jobs:
key: ${{ runner.os }}-cargo-build-msrv-stable-${{ hashFiles('**/Cargo.toml') }}
- uses: dtolnay/rust-toolchain@stable
with:
toolchain: 1.88
toolchain: 1.89
components: rustfmt, clippy
- name: Check
run: cargo check --lib --all-features
Expand Down Expand Up @@ -250,7 +250,7 @@ jobs:
# if: runner.os == 'linux'
- name: Install cargo-tarpaulin
run: |
RUST_BACKTRACE=1 cargo install --version 0.31.2 cargo-tarpaulin
RUST_BACKTRACE=1 cargo install --version 0.32.8 cargo-tarpaulin
- name: Generate code coverage
run: |
RUST_BACKTRACE=1 cargo tarpaulin --engine llvm --verbose --timeout 120 --out Lcov --workspace --all-features
Expand Down
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,14 @@
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## Unreleased

_This version is compatible with Bevy 0.18_

### Changed

- Compatible with Bevy 0.18

## [0.17.0] 2025-10-05

_This version is compatible with Bevy 0.17_
Expand Down
24 changes: 16 additions & 8 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
[package]
name = "bevy_hanabi"
version = "0.17.0"
version = "0.18.0"
authors = ["Jerome Humbert <djeedai@gmail.com>"]
edition = "2021"
rust-version = "1.88.0"
rust-version = "1.89.0"
description = "Hanabi GPU particle system for the Bevy game engine"
repository = "https://github.com/djeedai/bevy_hanabi"
homepage = "https://github.com/djeedai/bevy_hanabi"
Expand Down Expand Up @@ -62,20 +62,26 @@ ron = "0.8"
bitflags = "2.3"
typetag = { version = "0.2", optional = true }
thiserror = "2"
# Same versions as Bevy 0.17 (bevy_render)
wgpu = { version = "26", default-features = false, features = [
# Same versions as Bevy 0.18 (bevy_render)
wgpu = { version = "27", default-features = false, features = [
"wgsl",
"dx12",
"metal",
"vulkan",
"naga-ir",
"fragile-send-sync-non-atomic-wasm",
] }
naga = { version = "26", features = ["wgsl-in"] }
naga_oil = { version = "0.19", default-features = false, features = ["test_shader"] }
naga = { version = "27", features = ["wgsl-in"] }
naga_oil = { version = "0.20", default-features = false, features = ["test_shader"] }

# getrandom requires both 'wasm_js' as a feature AND as a RUSTFLAGS to work on wasm
[target.'cfg(target_arch = "wasm32")'.dependencies]
getrandom = { version = "0.3", default-features = false, features = [
"wasm_js",
] }

[dependencies.bevy]
version = "0.17"
version = "0.18"
default-features = false
features = [
"bevy_core_pipeline",
Expand All @@ -89,7 +95,9 @@ features = [
all-features = true

[dev-dependencies]
bevy = { version = "0.17", default-features = true }
# Enable all features by default in examples to make it easier to run them and to use
# extra features like text rendering or gizmos, which are example-specific.
bevy = { version = "0.18", default-features = true }

# For procedural texture generation in examples
noise = "0.9"
Expand Down
2 changes: 1 addition & 1 deletion build_examples_wasm.bat
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
@echo on

echo Check that wasm-bindgen -V returns 0.2.104, otherwise cargo install wasm-bindgen-cli --version 0.2.104
echo Check that wasm-bindgen -V returns 0.2.108, otherwise cargo install wasm-bindgen-cli --version 0.2.108

echo Setting RUSTFLAGS to enable unstable web_sys APIs...
set RUSTFLAGS=--cfg web_sys_unstable_apis --cfg getrandom_backend="wasm_js"
Expand Down
2 changes: 1 addition & 1 deletion examples/puffs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ fn main() -> Result<(), Box<dyn Error>> {
let app_exit = DemoApp::new("puffs")
.with_desc(DEMO_DESC)
.build()
.insert_resource(AmbientLight {
.insert_resource(GlobalAmbientLight {
color: Color::WHITE,
brightness: 500.0,
..default()
Expand Down
2 changes: 1 addition & 1 deletion examples/utils/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -195,11 +195,11 @@ fn spawn_demo_ui(mut cmd: Commands, demo: Res<Demo>) {
min_width: width,
width,
border: UiRect::all(Val::Px(1.)),
border_radius: BorderRadius::all(Val::Px(8.)),
..default()
},
BackgroundColor(Color::linear_rgba(0., 0., 0., 0.8)),
BorderColor::all(Color::linear_rgb(0.8, 0.8, 0.8)),
BorderRadius::all(Val::Px(8.)),
ZIndex(3000),
children![
(
Expand Down
4 changes: 3 additions & 1 deletion src/asset.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
#[cfg(feature = "serde")]
use bevy::asset::{io::Reader, AssetLoader, LoadContext};
#[cfg(feature = "serde")]
use bevy::reflect::TypePath;
use bevy::{
asset::{Asset, Assets, Handle},
log::trace,
Expand Down Expand Up @@ -645,7 +647,7 @@ impl EffectAsset {
///
/// Effet assets take the `.effect` extension.
#[cfg(feature = "serde")]
#[derive(Default)]
#[derive(Default, TypePath)]
pub struct EffectAssetLoader;

/// Error for the [`EffectAssetLoader`] loading an [`EffectAsset`].
Expand Down
6 changes: 3 additions & 3 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2052,12 +2052,12 @@ else { return c1; }
.world_mut()
.get_resource_or_insert_with::<AssetSourceBuilders>(Default::default);
let dir = Dir::default();
let dummy_builder = AssetSourceBuilder::default()
.with_reader(move || Box::new(MemoryAssetReader { root: dir.clone() }));
let dummy_builder =
AssetSourceBuilder::new(move || Box::new(MemoryAssetReader { root: dir.clone() }));
builders.insert(AssetSourceId::Default, dummy_builder);
let sources = builders.build_sources(watch_for_changes, false);
let asset_server = AssetServer::new(
sources,
sources.into(),
AssetServerMode::Unprocessed,
watch_for_changes,
UnapprovedPathMode::Forbid,
Expand Down
1 change: 1 addition & 0 deletions src/plugin.rs
Original file line number Diff line number Diff line change
Expand Up @@ -508,6 +508,7 @@ impl Plugin for HanabiPlugin {
.in_set(EffectSystems::PrepareEffectGpuResources)
.after(prepare_gpu_resources)
.before(prepare_bind_groups),
// Prepare the bind groups
prepare_bind_groups
.in_set(EffectSystems::PrepareBindGroups)
.after(queue_effects)
Expand Down
2 changes: 1 addition & 1 deletion src/properties.rs
Original file line number Diff line number Diff line change
Expand Up @@ -881,7 +881,7 @@ mod tests {
};

use bevy::{
ecs::{change_detection::MaybeLocation, component::Tick},
ecs::change_detection::{MaybeLocation, Tick},
math::{Vec2, Vec3, Vec4},
};

Expand Down
10 changes: 8 additions & 2 deletions src/render/aligned_buffer_vec.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1196,7 +1196,10 @@ mod gpu_tests {
queue.on_submitted_work_done(move || {
tx.send(()).unwrap();
});
let _ = device.poll(wgpu::PollType::Wait);
let _ = device.poll(wgpu::PollType::Wait {
submission_index: None,
timeout: None,
});
let _ = futures::executor::block_on(rx);
println!("Buffer written");

Expand All @@ -1208,7 +1211,10 @@ mod gpu_tests {
buffer.map_async(wgpu::MapMode::Read, move |result| {
tx.send(result).unwrap();
});
let _ = device.poll(wgpu::PollType::Wait);
let _ = device.poll(wgpu::PollType::Wait {
submission_index: None,
timeout: None,
});
let _result = futures::executor::block_on(rx);
let view = buffer.get_mapped_range();

Expand Down
2 changes: 1 addition & 1 deletion src/render/batch.rs
Original file line number Diff line number Diff line change
Expand Up @@ -403,7 +403,7 @@ impl EffectBatch {
texture_layout: extracted_effect.texture_layout.clone(),
textures: extracted_effect.textures.clone(),
alpha_mode: extracted_effect.alpha_mode,
entities: vec![main_entity.index()],
entities: vec![main_entity.index_u32()],
cached_effect_events: cached_effect_events.cloned(),
sort_fill_indirect_dispatch_index: None, // set later as needed
}
Expand Down
12 changes: 9 additions & 3 deletions src/render/buffer_table.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1085,12 +1085,15 @@ mod gpu_tests {
///
/// This call blocks until the data is available on CPU. Used for testing
/// only.
fn read_back_gpu<'a>(device: &RenderDevice, slice: BufferSlice<'a>) -> BufferView<'a> {
fn read_back_gpu(device: &RenderDevice, slice: BufferSlice<'_>) -> BufferView {
let (tx, rx) = futures::channel::oneshot::channel();
slice.map_async(wgpu::MapMode::Read, move |result| {
tx.send(result).unwrap();
});
let _ = device.poll(wgpu::PollType::Wait);
let _ = device.poll(wgpu::PollType::Wait {
submission_index: None,
timeout: None,
});
let result = futures::executor::block_on(rx);
assert!(result.is_ok());
slice.get_mapped_range()
Expand All @@ -1115,7 +1118,10 @@ mod gpu_tests {
});

// Poll device, checking for completion and raising callback
let _ = device.poll(wgpu::PollType::Wait);
let _ = device.poll(wgpu::PollType::Wait {
submission_index: None,
timeout: None,
});

// Wait for callback to be raised. This was need in previous versions, however
// it's a bit unclear if it's still needed or if device.poll() is enough to
Expand Down
Loading
Loading