mirror of
https://github.com/storytold/wgpu.git
synced 2026-11-19 14:01:08 +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
+13
-2
@@ -37,6 +37,12 @@ impl crate::Api for Api {
|
||||
}
|
||||
|
||||
impl crate::Instance<Api> for Context {
|
||||
unsafe fn create_surface(
|
||||
&self,
|
||||
rwh: &impl raw_window_handle::HasRawWindowHandle,
|
||||
) -> Result<Context, crate::UnsupportedWindow> {
|
||||
Ok(Context)
|
||||
}
|
||||
unsafe fn enumerate_adapters(&self) -> Vec<crate::ExposedAdapter<Api>> {
|
||||
Vec::new()
|
||||
}
|
||||
@@ -266,10 +272,10 @@ impl crate::CommandBuffer<Api> for Encoder {
|
||||
) {
|
||||
}
|
||||
|
||||
// render
|
||||
|
||||
unsafe fn begin_render_pass(&mut self, desc: &crate::RenderPassDescriptor<Api>) {}
|
||||
unsafe fn end_render_pass(&mut self) {}
|
||||
unsafe fn begin_compute_pass(&mut self) {}
|
||||
unsafe fn end_compute_pass(&mut self) {}
|
||||
|
||||
unsafe fn set_bind_group(
|
||||
&mut self,
|
||||
@@ -357,6 +363,11 @@ impl crate::CommandBuffer<Api> for Encoder {
|
||||
) {
|
||||
}
|
||||
|
||||
// compute
|
||||
|
||||
unsafe fn begin_compute_pass(&mut self) {}
|
||||
unsafe fn end_compute_pass(&mut self) {}
|
||||
|
||||
unsafe fn set_compute_pipeline(&mut self, pipeline: &Resource) {}
|
||||
|
||||
unsafe fn dispatch(&mut self, count: [u32; 3]) {}
|
||||
|
||||
@@ -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