Fix Vulkan surface capabilities being advertised when its query failed. (#6510)

Leaves out portions of #6510 that changed the interface
This commit is contained in:
Andreas Reich committed 2024-11-24 20:08:58 +01:00
1 parent 5ea7288988
commit 1f49837cb0
3 files changed
+9 -6

No files matched your search

+4
View File
@@ -53,6 +53,10 @@ Bottom level categories:
- Fix surface creation crashing on iOS. By @mockersf in [#6535](https://github.com/gfx-rs/wgpu/pull/6535)
#### Vulkan
- Fix surface capabilities being advertised when its query failed. By @wumpf in [#6510](https://github.com/gfx-rs/wgpu/pull/6510)
## 23.0.0 (2024-10-25)
### Themes of this release
+4 -2
View File
@@ -2254,7 +2254,8 @@ impl crate::Adapter for super::Adapter {
Ok(present_modes) => present_modes,
Err(e) => {
log::error!("get_physical_device_surface_present_modes: {}", e);
Vec::new()
// Per definition of `SurfaceCapabilities`, there must be at least one present mode.
return None;
}
}
};
@@ -2269,7 +2270,8 @@ impl crate::Adapter for super::Adapter {
Ok(formats) => formats,
Err(e) => {
log::error!("get_physical_device_surface_formats: {}", e);
Vec::new()
// Per definition of `SurfaceCapabilities`, there must be at least one present format.
return None;
}
}
};
+1 -4
View File
@@ -702,10 +702,7 @@ impl crate::Context for ContextWgpuCore {
.surface_get_capabilities(surface_data.id, *adapter_data)
{
Ok(caps) => caps,
Err(wgc::instance::GetSurfaceSupportError::Unsupported) => {
wgt::SurfaceCapabilities::default()
}
Err(err) => self.handle_error_fatal(err, "Surface::get_supported_formats"),
Err(_) => wgt::SurfaceCapabilities::default(),
}
}