diff --git a/Cargo.lock b/Cargo.lock index 7594ea442..11fd40c76 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -148,7 +148,6 @@ dependencies = [ "all-is-cubes-render", "all-is-cubes-ui", "anyhow", - "bytemuck", "cfg-if", "clap", "crossterm", @@ -5819,7 +5818,6 @@ dependencies = [ "all-is-cubes-render", "all-is-cubes-ui", "async_fn_traits", - "bytemuck", "clap", "exhaust", "futures-core", diff --git a/all-is-cubes-desktop/Cargo.toml b/all-is-cubes-desktop/Cargo.toml index abdaf79ee..906834312 100644 --- a/all-is-cubes-desktop/Cargo.toml +++ b/all-is-cubes-desktop/Cargo.toml @@ -36,7 +36,6 @@ all-is-cubes-port = { workspace = true } all-is-cubes-render = { workspace = true, features = ["raytracer"] } all-is-cubes-ui = { workspace = true } anyhow = { workspace = true } -bytemuck = { workspace = true } cfg-if = { workspace = true } clap = { workspace = true } # Note: keep crossterm in sync with ratatui's crossterm dependency. diff --git a/all-is-cubes-desktop/src/record/write_png.rs b/all-is-cubes-desktop/src/record/write_png.rs index e4ecb085c..8eed5cb01 100644 --- a/all-is-cubes-desktop/src/record/write_png.rs +++ b/all-is-cubes-desktop/src/record/write_png.rs @@ -23,9 +23,8 @@ pub(crate) fn threaded_write_frames( 'frame_loop: loop { match image_data_receiver.recv() { Ok((status, image)) => { - png_writer.write_image_data(bytemuck::cast_slice::<[u8; 4], u8>( - image.data.as_ref(), - ))?; + let image_data: &[[u8; 4]] = image.data.as_ref(); + png_writer.write_image_data(image_data.as_flattened())?; status_notifier.notify(status); } Err(mpsc::RecvError) => { diff --git a/all-is-cubes-gpu/src/in_wgpu/light_texture.rs b/all-is-cubes-gpu/src/in_wgpu/light_texture.rs index 6c4960cbc..df45794bc 100644 --- a/all-is-cubes-gpu/src/in_wgpu/light_texture.rs +++ b/all-is-cubes-gpu/src/in_wgpu/light_texture.rs @@ -376,11 +376,7 @@ impl LightTexture { // To do this optimally, `StagingBelt` will need to be modified to allow // us accessing its buffers to issue a `copy_buffer_to_texture` instead of // it issuing a `copy_buffer_to_buffer`. - queue.write_buffer( - &self.copy_buffer, - 0, - bytemuck::cast_slice::(&data[..batch_count]), - ); + queue.write_buffer(&self.copy_buffer, 0, data[..batch_count].as_flattened()); queue.submit([encoder.finish()]); } diff --git a/test-renderers/Cargo.toml b/test-renderers/Cargo.toml index b7bd25fe7..ff79137ba 100644 --- a/test-renderers/Cargo.toml +++ b/test-renderers/Cargo.toml @@ -68,7 +68,6 @@ all-is-cubes-port = { workspace = true, optional = true, features = [] } all-is-cubes-render = { workspace = true, features = ["raytracer", "std"] } all-is-cubes-ui = { workspace = true } async_fn_traits = { workspace = true } -bytemuck = { workspace = true } # Using clap for parsing test command-line arguments clap = { workspace = true } exhaust = { workspace = true } diff --git a/test-renderers/src/lib.rs b/test-renderers/src/lib.rs index 5c3d82b7c..da10718ba 100644 --- a/test-renderers/src/lib.rs +++ b/test-renderers/src/lib.rs @@ -209,7 +209,7 @@ pub fn compare_rendered_image( let actual_to_save = image::ImageBuffer::, _>::from_raw( actual_rendering.size.width, actual_rendering.size.height, - bytemuck::cast_slice::<[u8; 4], u8>(&actual_rendering.data), + actual_rendering.data.as_flattened(), ) .unwrap(); @@ -254,7 +254,7 @@ pub fn compare_rendered_image( RgbaImage::from_raw( image.width() as u32, image.height() as u32, - bytemuck::cast_vec::<[u8; 4], u8>(image.buf().to_vec()), + image.buf().to_vec().into_flattened(), ) .unwrap() .save(&diff_file_path)