Skip to content

Commit

Permalink
Make sure binding is ready before creating bind group
Browse files Browse the repository at this point in the history
  • Loading branch information
IceSentry committed Sep 25, 2024
1 parent a68fbd3 commit 7d11009
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 8 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[package]
edition = "2021"
name = "bevy_polyline"
version = "0.9.0"
version = "0.9.1"
description = "Polyline Rendering for Bevy"
license = "MIT OR Apache-2.0"
repository = "https://github.com/ForesightMiningSoftwareCorporation/bevy_polyline"
Expand Down
16 changes: 9 additions & 7 deletions src/polyline.rs
Original file line number Diff line number Diff line change
Expand Up @@ -319,13 +319,15 @@ pub fn prepare_polyline_bind_group(
render_device: Res<RenderDevice>,
polyline_uniforms: Res<ComponentUniforms<PolylineUniform>>,
) {
commands.insert_resource(PolylineBindGroup {
value: render_device.create_bind_group(
Some("polyline_bind_group"),
&polyline_pipeline.polyline_layout,
&BindGroupEntries::single(polyline_uniforms.uniforms()),
),
});
if let Some(binding) = polyline_uniforms.uniforms().binding() {
commands.insert_resource(PolylineBindGroup {
value: render_device.create_bind_group(
Some("polyline_bind_group"),
&polyline_pipeline.polyline_layout,
&BindGroupEntries::single(binding),
),
});
}
}

#[derive(Component)]
Expand Down

0 comments on commit 7d11009

Please sign in to comment.