Skip to content

Commit

Permalink
v0.5.1 - Release (#63)
Browse files Browse the repository at this point in the history
## 0.5.1

### Fixed

- Updated to patch vello 0.2.1. It is now no-longer possible to panic
when the vello encodings are empty.
- The demo CI now deploys that bevy_pancam has been updated to bevy 0.14
  • Loading branch information
simbleau authored Jul 16, 2024
1 parent 5899e35 commit 4d8f874
Show file tree
Hide file tree
Showing 6 changed files with 28 additions and 40 deletions.
3 changes: 3 additions & 0 deletions .cargo/config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,6 @@ run_wasm = "run --release --package run_wasm --"
# Other crates use the alias run-wasm, even though crate names should use `_`s not `-`s
# Allow this to be used
run-wasm = "run_wasm"

[target.'cfg(target_family = "wasm")']
rustflags = ["--cfg=web_sys_unstable_apis"]
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,13 @@ Subheadings to categorize changes are `added, changed, deprecated, removed, fixe

## Unreleased

## 0.5.1

### Fixed

- Updated to patch vello 0.2.1. It is now no-longer possible to panic when the vello encodings are empty.
- The demo CI now deploys that bevy_pancam has been updated to bevy 0.14

## 0.5.0

### Added
Expand Down
4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ members = [

[workspace.package]
edition = "2021"
version = "0.5.0"
version = "0.5.1"
license = "MIT OR Apache-2.0"
repository = "https://github.com/linebender/bevy_vello"

Expand Down Expand Up @@ -50,7 +50,7 @@ repository.workspace = true
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[dependencies]
bevy = { workspace = true }
vello = "0.2.0"
vello = "0.2.1"
vello_svg = "0.3.0"
velato = "0.3.0"
thiserror = "1.0.61"
Expand Down
2 changes: 1 addition & 1 deletion examples/demo/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,5 @@ publish = false
[dependencies]
bevy_vello = { path = "../../", features = ["experimental-dotLottie"] }
bevy = { workspace = true }
bevy_pancam = { version = "0.11", features = ["bevy_egui"] }
bevy_pancam = { version = "0.12.0", features = ["bevy_egui"] }
bevy_egui = "0.28.0"
5 changes: 2 additions & 3 deletions examples/demo/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,16 +17,15 @@ fn main() {
.add_plugins(EguiPlugin)
.add_plugins(VelloPlugin)
.init_resource::<EmbeddedAssetRegistry>()
//.add_plugins(bevy_pancam::PanCamPlugin)
.add_plugins(bevy_pancam::PanCamPlugin)
.add_systems(Startup, setup_vector_graphics)
.add_systems(Update, (print_metadata, ui::controls_ui));
embedded_asset!(app, "assets/calendar.json");
app.run();
}

fn setup_vector_graphics(mut commands: Commands, asset_server: ResMut<AssetServer>) {
commands.spawn(Camera2dBundle::default());
//commands.spawn((Camera2dBundle::default(), bevy_pancam::PanCam::default()));
commands.spawn((Camera2dBundle::default(), bevy_pancam::PanCam::default()));
commands
.spawn(VelloAssetBundle {
vector: asset_server.load::<VelloAsset>("embedded://demo/assets/calendar.json"),
Expand Down
47 changes: 13 additions & 34 deletions src/render/systems.rs
Original file line number Diff line number Diff line change
Expand Up @@ -213,41 +213,20 @@ pub fn render_scene(
}
}

// TODO: Vello should be ignoring 0-sized buffers in the future, so this could go away.
// Prevent a panic in the vello renderer if all the items contain empty encoding data
let empty_encodings = render_queue
.iter()
.filter(|(_, _, (_, item))| match item {
RenderItem::Asset(a) => match &a.asset.file {
#[cfg(feature = "svg")]
crate::VectorFile::Svg(scene) => scene.encoding().is_empty(),
#[cfg(feature = "lottie")]
crate::VectorFile::Lottie(composition) => composition.layers.is_empty(),
#[cfg(not(any(feature = "svg", feature = "lottie")))]
_ => unimplemented!(),
renderer
.render_to_texture(
device.wgpu_device(),
&queue,
&scene_buffer,
&gpu_image.texture_view,
&RenderParams {
base_color: vello::peniko::Color::TRANSPARENT,
width: gpu_image.size.x as u32,
height: gpu_image.size.y as u32,
antialiasing_method: vello::AaConfig::Area,
},
RenderItem::Scene(s) => s.scene.encoding().is_empty(),
RenderItem::Text(t) => t.text.content.is_empty(),
})
.count()
== render_queue.len();

if !render_queue.is_empty() && !empty_encodings {
renderer
.render_to_texture(
device.wgpu_device(),
&queue,
&scene_buffer,
&gpu_image.texture_view,
&RenderParams {
base_color: vello::peniko::Color::TRANSPARENT,
width: gpu_image.size.x as u32,
height: gpu_image.size.y as u32,
antialiasing_method: vello::AaConfig::Area,
},
)
.unwrap();
}
)
.unwrap();
}

pub fn resize_rendertargets(
Expand Down

0 comments on commit 4d8f874

Please sign in to comment.