mirror of
https://github.com/gfx-rs/wgpu.git
synced 2026-04-22 03:02:01 -04:00
update synchronization, fix last errors in wgc
This commit is contained in:
@@ -15,6 +15,7 @@ license = "MPL-2.0"
|
||||
|
||||
[dependencies]
|
||||
bitflags = "1.0"
|
||||
raw-window-handle = "0.3"
|
||||
smallvec = "1"
|
||||
thiserror = "1"
|
||||
wgt = { package = "wgpu-types", path = "../wgpu-types" }
|
||||
|
||||
@@ -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