Upgrade to wgpu 24 (#127)

This commit is contained in:
Matheus Rangel 2025-01-18 22:59:56 -03:00 committed by GitHub
parent 7264e5f324
commit bff018f6af
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
7 changed files with 23 additions and 15 deletions

View file

@ -1,3 +1,5 @@
use wgpu::{BackendOptions, Dx12BackendOptions};
use pollster::block_on;
pub struct State {
@ -7,11 +9,17 @@ pub struct State {
impl State {
pub fn new() -> Self {
let instance = wgpu::Instance::new(wgpu::InstanceDescriptor {
let instance = wgpu::Instance::new(&wgpu::InstanceDescriptor {
backends: wgpu::Backends::all(),
flags: wgpu::InstanceFlags::empty(),
dx12_shader_compiler: wgpu::Dx12Compiler::Fxc,
gles_minor_version: wgpu::Gles3MinorVersion::Automatic,
backend_options: BackendOptions {
gl: wgpu::GlBackendOptions {
gles_minor_version: wgpu::Gles3MinorVersion::Automatic
},
dx12: Dx12BackendOptions {
shader_compiler: wgpu::Dx12Compiler::Fxc
},
}
});
let adapter = block_on(wgpu::util::initialize_adapter_from_env_or_default(