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

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);