mirror of
https://github.com/storytold/wgpu.git
synced 2026-11-28 00:59:12 +01:00
update synchronization, fix last errors in wgc
This commit is contained in:
1 parent
0a82c232ba
commit
ff2a3e84fc
16 files changed
+253
-255
No files matched your search
@@ -96,6 +96,10 @@ pub enum SurfaceError {
|
||||
Other(&'static str),
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug, PartialEq, Error)]
|
||||
#[error("Window handle is not supported")]
|
||||
pub struct UnsupportedWindow;
|
||||
|
||||
pub trait Api: Clone + Sized {
|
||||
type Instance: Instance<Self>;
|
||||
type Surface: Surface<Self>;
|
||||
@@ -121,6 +125,10 @@ pub trait Api: Clone + Sized {
|
||||
}
|
||||
|
||||
pub trait Instance<A: Api> {
|
||||
unsafe fn create_surface(
|
||||
&self,
|
||||
rwh: &impl raw_window_handle::HasRawWindowHandle,
|
||||
) -> Result<A::Surface, UnsupportedWindow>;
|
||||
unsafe fn enumerate_adapters(&self) -> Vec<ExposedAdapter<A>>;
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user