Update dependencies
This commit is contained in:
parent
8597694bcb
commit
d4800a9cb1
5 changed files with 729 additions and 721 deletions
1400
Cargo.lock
generated
1400
Cargo.lock
generated
File diff suppressed because it is too large
Load diff
18
Cargo.toml
18
Cargo.toml
|
@ -12,17 +12,17 @@ render = { path = "crates/render" }
|
||||||
|
|
||||||
cfg-if = "1"
|
cfg-if = "1"
|
||||||
anyhow = "1.0"
|
anyhow = "1.0"
|
||||||
bytemuck = { version = "1.12", features = [ "derive" ] }
|
bytemuck = { version = "1.13", features = [ "derive" ] }
|
||||||
cgmath = "0.18"
|
cgmath = "0.18"
|
||||||
env_logger = "0.10"
|
env_logger = "0.10"
|
||||||
pollster = "0.2"
|
pollster = "0.3.0"
|
||||||
log = "0.4"
|
log = "0.4"
|
||||||
rayon = "1.6"
|
rayon = "1.7"
|
||||||
tobj = { version = "3.2", features = ["async"]}
|
tobj = { version = "3.2", features = ["async"]}
|
||||||
wgpu = { version = "0.14" }
|
wgpu = { version = "0.15" }
|
||||||
winit = "0.27"
|
winit = "0.28"
|
||||||
instant = "0.1"
|
instant = "0.1"
|
||||||
async-std = "1"
|
async-std = "1.12"
|
||||||
profiling = "1.0"
|
profiling = "1.0"
|
||||||
tracy-client = "0.15"
|
tracy-client = "0.15"
|
||||||
|
|
||||||
|
@ -34,8 +34,8 @@ features = ["png", "jpeg"]
|
||||||
[target.'cfg(target_arch = "wasm32")'.dependencies]
|
[target.'cfg(target_arch = "wasm32")'.dependencies]
|
||||||
reqwest = { version = "0.11" }
|
reqwest = { version = "0.11" }
|
||||||
console_error_panic_hook = "0.1"
|
console_error_panic_hook = "0.1"
|
||||||
console_log = "0.2"
|
console_log = "1.0.0"
|
||||||
wgpu = { version = "0.14", features = ["webgl"]}
|
wgpu = { version = "0.15", features = ["webgl"]}
|
||||||
wasm-bindgen = "0.2"
|
wasm-bindgen = "0.2"
|
||||||
wasm-bindgen-futures = "0.4"
|
wasm-bindgen-futures = "0.4"
|
||||||
web-sys = { version = "0.3", features = [
|
web-sys = { version = "0.3", features = [
|
||||||
|
@ -47,5 +47,5 @@ web-sys = { version = "0.3", features = [
|
||||||
|
|
||||||
[build-dependencies]
|
[build-dependencies]
|
||||||
anyhow = "1.0"
|
anyhow = "1.0"
|
||||||
fs_extra = "1.2"
|
fs_extra = "1.3"
|
||||||
glob = "0.3"
|
glob = "0.3"
|
|
@ -9,5 +9,5 @@ edition = "2021"
|
||||||
crate_type = ["dylib"]
|
crate_type = ["dylib"]
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
winit = "0.27"
|
winit = "0.28"
|
||||||
wgpu = { version = "0.14"}
|
wgpu = { version = "0.15"}
|
|
@ -17,8 +17,8 @@ impl GraphicsRenderer {
|
||||||
|
|
||||||
// The instance is a handle to our GPU
|
// The instance is a handle to our GPU
|
||||||
// BackendBit::PRIMARY => Vulkan + Metal + DX12 + Browser WebGPU
|
// BackendBit::PRIMARY => Vulkan + Metal + DX12 + Browser WebGPU
|
||||||
let instance = wgpu::Instance::new(wgpu::Backends::all());
|
let instance = wgpu::Instance::default();
|
||||||
let surface = unsafe { instance.create_surface(window) };
|
let surface = unsafe { instance.create_surface(window).unwrap() };
|
||||||
let adapter = instance
|
let adapter = instance
|
||||||
.request_adapter(&wgpu::RequestAdapterOptions {
|
.request_adapter(&wgpu::RequestAdapterOptions {
|
||||||
power_preference: wgpu::PowerPreference::default(),
|
power_preference: wgpu::PowerPreference::default(),
|
||||||
|
@ -45,13 +45,18 @@ impl GraphicsRenderer {
|
||||||
.await
|
.await
|
||||||
.unwrap();
|
.unwrap();
|
||||||
|
|
||||||
|
let caps = surface.get_capabilities(&adapter);
|
||||||
|
let format = caps.formats[0];
|
||||||
let config = wgpu::SurfaceConfiguration {
|
let config = wgpu::SurfaceConfiguration {
|
||||||
usage: wgpu::TextureUsages::RENDER_ATTACHMENT,
|
usage: wgpu::TextureUsages::RENDER_ATTACHMENT,
|
||||||
format: surface.get_supported_formats(&adapter)[0],
|
format: format,
|
||||||
width: size.width,
|
width: size.width,
|
||||||
height: size.height,
|
height: size.height,
|
||||||
present_mode: wgpu::PresentMode::Fifo,
|
present_mode: wgpu::PresentMode::Fifo,
|
||||||
alpha_mode: wgpu::CompositeAlphaMode::Auto
|
alpha_mode: wgpu::CompositeAlphaMode::Auto,
|
||||||
|
view_formats: vec![
|
||||||
|
format
|
||||||
|
]
|
||||||
};
|
};
|
||||||
|
|
||||||
surface.configure(&device, &config);
|
surface.configure(&device, &config);
|
||||||
|
|
|
@ -29,6 +29,7 @@ impl Texture {
|
||||||
dimension: wgpu::TextureDimension::D2,
|
dimension: wgpu::TextureDimension::D2,
|
||||||
format: Self::DEPTH_FORMAT,
|
format: Self::DEPTH_FORMAT,
|
||||||
usage: wgpu::TextureUsages::RENDER_ATTACHMENT | wgpu::TextureUsages::TEXTURE_BINDING,
|
usage: wgpu::TextureUsages::RENDER_ATTACHMENT | wgpu::TextureUsages::TEXTURE_BINDING,
|
||||||
|
view_formats: &[Self::DEPTH_FORMAT]
|
||||||
};
|
};
|
||||||
let texture = device.create_texture(&desc);
|
let texture = device.create_texture(&desc);
|
||||||
let view = texture.create_view(&wgpu::TextureViewDescriptor::default());
|
let view = texture.create_view(&wgpu::TextureViewDescriptor::default());
|
||||||
|
@ -40,8 +41,6 @@ impl Texture {
|
||||||
min_filter: wgpu::FilterMode::Linear,
|
min_filter: wgpu::FilterMode::Linear,
|
||||||
mipmap_filter: wgpu::FilterMode::Nearest,
|
mipmap_filter: wgpu::FilterMode::Nearest,
|
||||||
compare: Some(wgpu::CompareFunction::LessEqual),
|
compare: Some(wgpu::CompareFunction::LessEqual),
|
||||||
lod_min_clamp: -100.0,
|
|
||||||
lod_max_clamp: 100.0,
|
|
||||||
..Default::default()
|
..Default::default()
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -79,18 +78,20 @@ impl Texture {
|
||||||
height: dimensions.1,
|
height: dimensions.1,
|
||||||
depth_or_array_layers: 1,
|
depth_or_array_layers: 1,
|
||||||
};
|
};
|
||||||
|
let format = if is_normal_map {
|
||||||
|
wgpu::TextureFormat::Rgba8Unorm
|
||||||
|
} else {
|
||||||
|
wgpu::TextureFormat::Rgba8UnormSrgb
|
||||||
|
};
|
||||||
let texture = device.create_texture(&wgpu::TextureDescriptor {
|
let texture = device.create_texture(&wgpu::TextureDescriptor {
|
||||||
label,
|
label,
|
||||||
size,
|
size,
|
||||||
mip_level_count: 1,
|
mip_level_count: 1,
|
||||||
sample_count: 1,
|
sample_count: 1,
|
||||||
dimension: wgpu::TextureDimension::D2,
|
dimension: wgpu::TextureDimension::D2,
|
||||||
format: if is_normal_map {
|
format,
|
||||||
wgpu::TextureFormat::Rgba8Unorm
|
|
||||||
} else {
|
|
||||||
wgpu::TextureFormat::Rgba8UnormSrgb
|
|
||||||
},
|
|
||||||
usage: wgpu::TextureUsages::TEXTURE_BINDING | wgpu::TextureUsages::COPY_DST,
|
usage: wgpu::TextureUsages::TEXTURE_BINDING | wgpu::TextureUsages::COPY_DST,
|
||||||
|
view_formats: &[format]
|
||||||
});
|
});
|
||||||
|
|
||||||
queue.write_texture(
|
queue.write_texture(
|
||||||
|
|
Loading…
Reference in a new issue