Merge branch 'master' into beacon

This commit is contained in:
Héctor Ramón Jiménez 2025-03-11 22:25:06 +01:00
commit ebfcb65841
No known key found for this signature in database
GPG key ID: 7CC46565708259A7
41 changed files with 805 additions and 589 deletions

View file

@ -54,7 +54,7 @@ impl Compositor {
settings: Settings,
compatible_window: Option<W>,
) -> Result<Self, Error> {
let instance = wgpu::Instance::new(wgpu::InstanceDescriptor {
let instance = wgpu::Instance::new(&wgpu::InstanceDescriptor {
backends: settings.backends,
flags: if cfg!(feature = "strict-assertions") {
wgpu::InstanceFlags::debugging()
@ -81,12 +81,13 @@ impl Compositor {
.and_then(|window| instance.create_surface(window).ok());
let adapter_options = wgpu::RequestAdapterOptions {
power_preference: wgpu::util::power_preference_from_env()
.unwrap_or(if settings.antialiasing.is_none() {
power_preference: wgpu::PowerPreference::from_env().unwrap_or(
if settings.antialiasing.is_none() {
wgpu::PowerPreference::LowPower
} else {
wgpu::PowerPreference::HighPerformance
}),
},
),
compatible_surface: compatible_surface.as_ref(),
force_fallback_adapter: false,
};
@ -261,6 +262,7 @@ pub fn present(
wgpu::SurfaceError::OutOfMemory => {
Err(compositor::SurfaceError::OutOfMemory)
}
wgpu::SurfaceError::Other => Err(compositor::SurfaceError::Other),
},
}
}
@ -278,7 +280,7 @@ impl graphics::Compositor for Compositor {
None | Some("wgpu") => {
let mut settings = Settings::from(settings);
if let Some(backends) = wgpu::util::backend_bits_from_env() {
if let Some(backends) = wgpu::Backends::from_env() {
settings.backends = backends;
}
@ -445,9 +447,9 @@ pub fn screenshot(
encoder.copy_texture_to_buffer(
texture.as_image_copy(),
wgpu::ImageCopyBuffer {
wgpu::TexelCopyBufferInfo {
buffer: &output_buffer,
layout: wgpu::ImageDataLayout {
layout: wgpu::TexelCopyBufferLayout {
offset: 0,
bytes_per_row: Some(dimensions.padded_bytes_per_row as u32),
rows_per_image: None,