1
0
Fork 0

Update dependencies

This commit is contained in:
Florian RICHER 2023-04-13 14:09:57 +02:00
parent 8597694bcb
commit d4800a9cb1
No known key found for this signature in database
GPG key ID: 6BF27BF8A1E71623
5 changed files with 729 additions and 721 deletions

1400
Cargo.lock generated

File diff suppressed because it is too large Load diff

View file

@ -12,17 +12,17 @@ render = { path = "crates/render" }
cfg-if = "1"
anyhow = "1.0"
bytemuck = { version = "1.12", features = [ "derive" ] }
bytemuck = { version = "1.13", features = [ "derive" ] }
cgmath = "0.18"
env_logger = "0.10"
pollster = "0.2"
pollster = "0.3.0"
log = "0.4"
rayon = "1.6"
rayon = "1.7"
tobj = { version = "3.2", features = ["async"]}
wgpu = { version = "0.14" }
winit = "0.27"
wgpu = { version = "0.15" }
winit = "0.28"
instant = "0.1"
async-std = "1"
async-std = "1.12"
profiling = "1.0"
tracy-client = "0.15"
@ -34,8 +34,8 @@ features = ["png", "jpeg"]
[target.'cfg(target_arch = "wasm32")'.dependencies]
reqwest = { version = "0.11" }
console_error_panic_hook = "0.1"
console_log = "0.2"
wgpu = { version = "0.14", features = ["webgl"]}
console_log = "1.0.0"
wgpu = { version = "0.15", features = ["webgl"]}
wasm-bindgen = "0.2"
wasm-bindgen-futures = "0.4"
web-sys = { version = "0.3", features = [
@ -47,5 +47,5 @@ web-sys = { version = "0.3", features = [
[build-dependencies]
anyhow = "1.0"
fs_extra = "1.2"
fs_extra = "1.3"
glob = "0.3"

View file

@ -9,5 +9,5 @@ edition = "2021"
crate_type = ["dylib"]
[dependencies]
winit = "0.27"
wgpu = { version = "0.14"}
winit = "0.28"
wgpu = { version = "0.15"}

View file

@ -17,8 +17,8 @@ impl GraphicsRenderer {
// The instance is a handle to our GPU
// BackendBit::PRIMARY => Vulkan + Metal + DX12 + Browser WebGPU
let instance = wgpu::Instance::new(wgpu::Backends::all());
let surface = unsafe { instance.create_surface(window) };
let instance = wgpu::Instance::default();
let surface = unsafe { instance.create_surface(window).unwrap() };
let adapter = instance
.request_adapter(&wgpu::RequestAdapterOptions {
power_preference: wgpu::PowerPreference::default(),
@ -45,13 +45,18 @@ impl GraphicsRenderer {
.await
.unwrap();
let caps = surface.get_capabilities(&adapter);
let format = caps.formats[0];
let config = wgpu::SurfaceConfiguration {
usage: wgpu::TextureUsages::RENDER_ATTACHMENT,
format: surface.get_supported_formats(&adapter)[0],
format: format,
width: size.width,
height: size.height,
present_mode: wgpu::PresentMode::Fifo,
alpha_mode: wgpu::CompositeAlphaMode::Auto
alpha_mode: wgpu::CompositeAlphaMode::Auto,
view_formats: vec![
format
]
};
surface.configure(&device, &config);

View file

@ -29,6 +29,7 @@ impl Texture {
dimension: wgpu::TextureDimension::D2,
format: Self::DEPTH_FORMAT,
usage: wgpu::TextureUsages::RENDER_ATTACHMENT | wgpu::TextureUsages::TEXTURE_BINDING,
view_formats: &[Self::DEPTH_FORMAT]
};
let texture = device.create_texture(&desc);
let view = texture.create_view(&wgpu::TextureViewDescriptor::default());
@ -40,8 +41,6 @@ impl Texture {
min_filter: wgpu::FilterMode::Linear,
mipmap_filter: wgpu::FilterMode::Nearest,
compare: Some(wgpu::CompareFunction::LessEqual),
lod_min_clamp: -100.0,
lod_max_clamp: 100.0,
..Default::default()
});
@ -79,18 +78,20 @@ impl Texture {
height: dimensions.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 {
label,
size,
mip_level_count: 1,
sample_count: 1,
dimension: wgpu::TextureDimension::D2,
format: if is_normal_map {
wgpu::TextureFormat::Rgba8Unorm
} else {
wgpu::TextureFormat::Rgba8UnormSrgb
},
format,
usage: wgpu::TextureUsages::TEXTURE_BINDING | wgpu::TextureUsages::COPY_DST,
view_formats: &[format]
});
queue.write_texture(