diff --git a/Cargo.lock b/Cargo.lock index 8edefa9..37e4847 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -832,7 +832,6 @@ dependencies = [ "bevy", "bitfield", "bitflags 2.4.1", - "bytemuck", "smallvec", "wgpu", ] diff --git a/Cargo.toml b/Cargo.toml index 009d2de..4ea1b42 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -28,6 +28,5 @@ bevy = { version = "0.12" , default-features = false, features = [ ]} bitfield = "0.14.0" bitflags = "2.3" -bytemuck = "1.13.1" -smallvec = "1.10.0" +smallvec = "1.11.1" wgpu = "0.17.1" diff --git a/src/render/commands.rs b/src/render/commands.rs index f0e03d2..61052ad 100644 --- a/src/render/commands.rs +++ b/src/render/commands.rs @@ -50,10 +50,7 @@ pub fn prepare_shape_view_bind_groups( let view_bind_group = render_device.create_bind_group( "shape_view_bind_group", &shape_pipeline.view_layout, - &[BindGroupEntry { - binding: 0, - resource: view_binding.clone(), - }], + &BindGroupEntries::single(view_binding.clone()), ); commands.entity(entity).insert(ShapeViewBindGroup { @@ -85,16 +82,10 @@ pub fn prepare_shape_texture_bind_groups( render_device.create_bind_group( "shape_texture_bind_group", &shape_pipelines.texture_layout, - &[ - BindGroupEntry { - binding: 0, - resource: BindingResource::TextureView(&gpu_image.texture_view), - }, - BindGroupEntry { - binding: 1, - resource: BindingResource::Sampler(&gpu_image.sampler), - }, - ], + &BindGroupEntries::sequential(( + &gpu_image.texture_view, + &gpu_image.sampler, + )), ) }); } @@ -119,10 +110,7 @@ pub fn prepare_shape_bind_group( value: render_device.create_bind_group( "shape_bind_group", &pipeline.layout, - &[BindGroupEntry { - binding: 0, - resource: binding, - }], + &BindGroupEntries::single(binding), ), _marker: PhantomData::, }); diff --git a/src/shapes/disc.rs b/src/shapes/disc.rs index 08003eb..880ce4d 100644 --- a/src/shapes/disc.rs +++ b/src/shapes/disc.rs @@ -1,5 +1,4 @@ use bevy::{ - core::{Pod, Zeroable}, prelude::*, reflect::Reflect, render::render_resource::{ShaderRef, ShaderType}, @@ -113,7 +112,7 @@ impl Default for Disc { } /// Raw data sent to the disc shader to draw a disc -#[derive(Clone, Copy, Reflect, Pod, Zeroable, Default, Debug, ShaderType)] +#[derive(Clone, Copy, Reflect, Default, Debug, ShaderType)] #[repr(C)] pub struct DiscData { transform: [[f32; 4]; 4], diff --git a/src/shapes/line.rs b/src/shapes/line.rs index 6f637a9..27a42d3 100644 --- a/src/shapes/line.rs +++ b/src/shapes/line.rs @@ -1,5 +1,4 @@ use bevy::{ - core::{Pod, Zeroable}, prelude::*, reflect::Reflect, render::render_resource::{ShaderRef, ShaderType}, @@ -79,7 +78,7 @@ impl ShapeComponent for Line { } /// Raw data sent to the line shader to draw a line -#[derive(Clone, Copy, Reflect, Pod, Zeroable, Default, Debug, ShaderType)] +#[derive(Clone, Copy, Reflect, Default, Debug, ShaderType)] #[repr(C)] pub struct LineData { transform: [[f32; 4]; 4], diff --git a/src/shapes/rectangle.rs b/src/shapes/rectangle.rs index d2c0fd1..7ec9067 100644 --- a/src/shapes/rectangle.rs +++ b/src/shapes/rectangle.rs @@ -1,5 +1,4 @@ use bevy::{ - core::{Pod, Zeroable}, prelude::*, reflect::Reflect, render::render_resource::{ShaderRef, ShaderType}, @@ -79,7 +78,7 @@ impl Default for Rectangle { } /// Raw data sent to the rectangle shader to draw a rectangle -#[derive(Clone, Copy, Reflect, Pod, Zeroable, Default, Debug, ShaderType)] +#[derive(Clone, Copy, Reflect, Default, Debug, ShaderType)] #[repr(C)] pub struct RectData { transform: [[f32; 4]; 4], diff --git a/src/shapes/regular_polygon.rs b/src/shapes/regular_polygon.rs index 8139dc5..37a7c25 100644 --- a/src/shapes/regular_polygon.rs +++ b/src/shapes/regular_polygon.rs @@ -1,5 +1,4 @@ use bevy::{ - core::{Pod, Zeroable}, prelude::*, reflect::Reflect, render::render_resource::{ShaderRef, ShaderType}, @@ -86,7 +85,7 @@ impl Default for RegularPolygon { } /// Raw data sent to the regular polygon shader to draw a regular polygon -#[derive(Clone, Copy, Reflect, Pod, Zeroable, Default, Debug, ShaderType)] +#[derive(Clone, Copy, Reflect, Default, Debug, ShaderType)] #[repr(C)] pub struct NgonData { transform: [[f32; 4]; 4], diff --git a/src/shapes/triangle.rs b/src/shapes/triangle.rs index 4e1eec6..75ec2f2 100644 --- a/src/shapes/triangle.rs +++ b/src/shapes/triangle.rs @@ -1,5 +1,4 @@ use bevy::{ - core::{Pod, Zeroable}, math::vec2, prelude::*, reflect::Reflect, @@ -82,7 +81,7 @@ impl Default for Triangle { } /// Raw data sent to the triangle shader to draw a triangle -#[derive(Clone, Copy, Reflect, Pod, Zeroable, Default, Debug, ShaderType)] +#[derive(Clone, Copy, Reflect, Default, Debug, ShaderType)] #[repr(C)] pub struct TriangleData { transform: [[f32; 4]; 4],