dynamic image size
This commit is contained in:
parent
bc8f2bd566
commit
e27ce3b507
12
src/main.rs
12
src/main.rs
@ -626,9 +626,13 @@ impl strafe_client::framework::Example for GraphicsData {
|
|||||||
|
|
||||||
//squid
|
//squid
|
||||||
let squid_texture_view={
|
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 {
|
let size = wgpu::Extent3d {
|
||||||
width: 1076,
|
width: image.get_width(),
|
||||||
height: 1076,
|
height: image.get_height(),
|
||||||
depth_or_array_layers: 1,
|
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 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(
|
let texture = device.create_texture_with_data(
|
||||||
queue,
|
queue,
|
||||||
&wgpu::TextureDescriptor {
|
&wgpu::TextureDescriptor {
|
||||||
|
Loading…
Reference in New Issue
Block a user