diff --git a/src/main.rs b/src/main.rs index 43811e19..564f9483 100644 --- a/src/main.rs +++ b/src/main.rs @@ -626,9 +626,13 @@ impl strafe_client::framework::Example for GraphicsData { //squid let squid_texture_view={ + let bytes = &include_bytes!("../images/squid.dds")[..]; + + let image = ddsfile::Dds::read(&mut std::io::Cursor::new(&bytes)).unwrap(); + let size = wgpu::Extent3d { - width: 1076, - height: 1076, + width: image.get_width(), + height: image.get_height(), depth_or_array_layers: 1, }; @@ -638,10 +642,6 @@ impl strafe_client::framework::Example for GraphicsData { }; let max_mips = layer_size.max_mips(wgpu::TextureDimension::D2); - let bytes = &include_bytes!("../images/squid.dds")[..]; - - let image = ddsfile::Dds::read(&mut std::io::Cursor::new(&bytes)).unwrap(); - let texture = device.create_texture_with_data( queue, &wgpu::TextureDescriptor {