Skip to content

Commit

Permalink
Merge pull request #5 from aevyrie/bytemuck_update
Browse files Browse the repository at this point in the history
Update to bytemuck
  • Loading branch information
mtsr authored May 19, 2021
2 parents b4e6a26 + d4691ea commit 638fb4d
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
use bevy::{
core::{AsBytes, Bytes},
core::cast_slice,
ecs::{reflect::ReflectComponent, system::IntoSystem},
math::{Vec2, Vec3},
prelude::{
Expand Down Expand Up @@ -190,11 +190,11 @@ pub fn polyline_resource_provider_system(

let buffer_id = render_resource_context.create_buffer_with_data(
BufferInfo {
size: polyline.vertices.byte_len(),
size: std::mem::size_of_val(&polyline.vertices),
buffer_usage: BufferUsage::VERTEX | BufferUsage::COPY_DST,
mapped_at_creation: false,
},
polyline.vertices.as_bytes(),
cast_slice(polyline.vertices.as_slice()),
);

render_pipelines
Expand Down

0 comments on commit 638fb4d

Please sign in to comment.